* gdbserver/low-hppabsd.c (read_inferior_memory): Add explicit
[deliverable/binutils-gdb.git] / gdb / findvar.c
index 002f3f328435cd79546cf82e18181e6d383173df..c5bf50755dcabf81b5fb7f3c08b6dd8528c71279 100644 (file)
@@ -1,5 +1,6 @@
 /* Find a variable's value in memory, for GDB, the GNU debugger.
-   Copyright 1986, 87, 89, 91, 94, 95, 96, 1998
+   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000, 2001
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -30,6 +31,7 @@
 #include "gdb_string.h"
 #include "floatformat.h"
 #include "symfile.h"           /* for overlay functions */
+#include "regcache.h"
 
 /* This is used to indicate that we don't know the format of the floating point
    number.  Typically, this is useful for native ports, where the actual format
@@ -190,7 +192,8 @@ extract_typed_address (void *buf, struct type *type)
 {
   if (TYPE_CODE (type) != TYPE_CODE_PTR
       && TYPE_CODE (type) != TYPE_CODE_REF)
-    internal_error ("findvar.c (extract_typed_address): "
+    internal_error (__FILE__, __LINE__,
+                   "extract_typed_address: "
                    "type is not a pointer or reference");
 
   return POINTER_TO_ADDRESS (type, buf);
@@ -276,7 +279,8 @@ store_typed_address (void *buf, struct type *type, CORE_ADDR addr)
 {
   if (TYPE_CODE (type) != TYPE_CODE_PTR
       && TYPE_CODE (type) != TYPE_CODE_REF)
-    internal_error ("findvar.c (store_typed_address): "
+    internal_error (__FILE__, __LINE__,
+                   "store_typed_address: "
                    "type is not a pointer or reference");
 
   ADDRESS_TO_POINTER (type, buf, addr);
@@ -393,7 +397,7 @@ value_of_register (int regnum)
   CORE_ADDR addr;
   int optim;
   register value_ptr reg_val;
-  char raw_buffer[MAX_REGISTER_RAW_SIZE];
+  char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
   enum lval_type lval;
 
   get_saved_register (raw_buffer, &optim, &addr,
@@ -415,7 +419,8 @@ value_of_register (int regnum)
     memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer,
            REGISTER_RAW_SIZE (regnum));
   else
-    internal_error ("Register \"%s\" (%d) has conflicting raw (%d) and virtual (%d) size",
+    internal_error (__FILE__, __LINE__,
+                   "Register \"%s\" (%d) has conflicting raw (%d) and virtual (%d) size",
                    REGISTER_NAME (regnum),
                    regnum,
                    REGISTER_RAW_SIZE (regnum),
@@ -606,7 +611,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
     case LOC_BASEREG:
     case LOC_BASEREG_ARG:
       {
-       char buf[MAX_REGISTER_RAW_SIZE];
+       char *buf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
        get_saved_register (buf, NULL, NULL, frame, SYMBOL_BASEREG (var),
                            NULL);
        addr = extract_address (buf, REGISTER_RAW_SIZE (SYMBOL_BASEREG (var)));
@@ -616,7 +621,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
 
     case LOC_THREAD_LOCAL_STATIC:
       {
-       char buf[MAX_REGISTER_RAW_SIZE];
+       char *buf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
 
        get_saved_register (buf, NULL, NULL, frame, SYMBOL_BASEREG (var),
                            NULL);
@@ -711,7 +716,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
 value_ptr
 value_from_register (struct type *type, int regnum, struct frame_info *frame)
 {
-  char raw_buffer[MAX_REGISTER_RAW_SIZE];
+  char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
   CORE_ADDR addr;
   int optim;
   value_ptr v = allocate_value (type);
@@ -874,7 +879,8 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
          VALUE_ADDRESS (v) = first_addr;
        }
       else
-       internal_error ("value_from_register: Value not stored anywhere!");
+       internal_error (__FILE__, __LINE__,
+                       "value_from_register: Value not stored anywhere!");
 
       VALUE_OPTIMIZED_OUT (v) = optim;
 
This page took 0.024898 seconds and 4 git commands to generate.