* source.c (openp): Squelch warning about "filename".
[deliverable/binutils-gdb.git] / gdb / findvar.c
index a0baa47c2eccb486d3f89952f437474c2d25235c..980bb57880eb35da1713ac25c2fcd45884218b1b 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.
 #include "inferior.h"
 #include "target.h"
 #include "gdb_string.h"
+#include "gdb_assert.h"
 #include "floatformat.h"
 #include "symfile.h"           /* for overlay functions */
-
-/* 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
-   is irrelevant, since no conversions will be taking place.  */
-
-const struct floatformat floatformat_unknown;
+#include "regcache.h"
+#include "builtin-regs.h"
 
 /* Basic byte-swapping routines.  GDB has needed these for a long time...
    All extract a target-format integer at ADDR which is LEN bytes long.  */
@@ -49,21 +47,21 @@ you lose
 #endif
 
 LONGEST
-extract_signed_integer (void *addr, int len)
+extract_signed_integer (const void *addr, int len)
 {
   LONGEST retval;
-  unsigned char *p;
-  unsigned char *startaddr = (unsigned char *) addr;
-  unsigned char *endaddr = startaddr + len;
+  const unsigned char *p;
+  const unsigned char *startaddr = addr;
+  const unsigned char *endaddr = startaddr + len;
 
   if (len > (int) sizeof (LONGEST))
     error ("\
 That operation is not available on integers of more than %d bytes.",
-          sizeof (LONGEST));
+          (int) sizeof (LONGEST));
 
   /* Start at the most significant end of the integer, and work towards
      the least significant.  */
-  if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
     {
       p = startaddr;
       /* Do the sign extension once at the start.  */
@@ -83,22 +81,22 @@ That operation is not available on integers of more than %d bytes.",
 }
 
 ULONGEST
-extract_unsigned_integer (void *addr, int len)
+extract_unsigned_integer (const void *addr, int len)
 {
   ULONGEST retval;
-  unsigned char *p;
-  unsigned char *startaddr = (unsigned char *) addr;
-  unsigned char *endaddr = startaddr + len;
+  const unsigned char *p;
+  const unsigned char *startaddr = addr;
+  const unsigned char *endaddr = startaddr + len;
 
   if (len > (int) sizeof (ULONGEST))
     error ("\
 That operation is not available on integers of more than %d bytes.",
-          sizeof (ULONGEST));
+          (int) sizeof (ULONGEST));
 
   /* Start at the most significant end of the integer, and work towards
      the least significant.  */
   retval = 0;
-  if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
     {
       for (p = startaddr; p < endaddr; ++p)
        retval = (retval << 8) | *p;
@@ -117,13 +115,13 @@ That operation is not available on integers of more than %d bytes.",
    function returns 1 and sets *PVAL.  Otherwise it returns 0.  */
 
 int
-extract_long_unsigned_integer (void *addr, int orig_len, LONGEST *pval)
+extract_long_unsigned_integer (const void *addr, int orig_len, LONGEST *pval)
 {
   char *p, *first_addr;
   int len;
 
   len = orig_len;
-  if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
     {
       for (p = (char *) addr;
           len > (int) sizeof (LONGEST) && p < (char *) addr + orig_len;
@@ -175,7 +173,7 @@ extract_long_unsigned_integer (void *addr, int orig_len, LONGEST *pval)
    else based on POINTER_TO_ADDRESS.  */
 
 CORE_ADDR
-extract_address (void *addr, int len)
+extract_address (const void *addr, int len)
 {
   /* Assume a CORE_ADDR can fit in a LONGEST (for now).  Not sure
      whether we want this to be true eventually.  */
@@ -186,11 +184,12 @@ extract_address (void *addr, int len)
 /* Treat the bytes at BUF as a pointer of type TYPE, and return the
    address it represents.  */
 CORE_ADDR
-extract_typed_address (void *buf, struct type *type)
+extract_typed_address (const 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);
@@ -206,7 +205,7 @@ store_signed_integer (void *addr, int len, LONGEST val)
 
   /* Start at the least significant end of the integer, and work towards
      the most significant.  */
-  if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
     {
       for (p = endaddr - 1; p >= startaddr; --p)
        {
@@ -233,7 +232,7 @@ store_unsigned_integer (void *addr, int len, ULONGEST val)
 
   /* Start at the least significant end of the integer, and work towards
      the most significant.  */
-  if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
     {
       for (p = endaddr - 1; p >= startaddr; --p)
        {
@@ -276,7 +275,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);
@@ -284,121 +284,36 @@ store_typed_address (void *buf, struct type *type, CORE_ADDR addr)
 
 
 
-\f
-/* Extract a floating-point number from a target-order byte-stream at ADDR.
-   Returns the value as type DOUBLEST.
+/* Return a `value' with the contents of (virtual or cooked) register
+   REGNUM as found in the specified FRAME.  The register's type is
+   determined by REGISTER_VIRTUAL_TYPE.
 
-   If the host and target formats agree, we just copy the raw data into the
-   appropriate type of variable and return, letting the host increase precision
-   as necessary.  Otherwise, we call the conversion routine and let it do the
-   dirty work.  */
+   NOTE: returns NULL if register value is not available.  Caller will
+   check return value or die!  */
 
-DOUBLEST
-extract_floating (void *addr, int len)
-{
-  DOUBLEST dretval;
-
-  if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT)
-    {
-      if (HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT)
-       {
-         float retval;
-
-         memcpy (&retval, addr, sizeof (retval));
-         return retval;
-       }
-      else
-       floatformat_to_doublest (TARGET_FLOAT_FORMAT, addr, &dretval);
-    }
-  else if (len * TARGET_CHAR_BIT == TARGET_DOUBLE_BIT)
-    {
-      if (HOST_DOUBLE_FORMAT == TARGET_DOUBLE_FORMAT)
-       {
-         double retval;
-
-         memcpy (&retval, addr, sizeof (retval));
-         return retval;
-       }
-      else
-       floatformat_to_doublest (TARGET_DOUBLE_FORMAT, addr, &dretval);
-    }
-  else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT)
-    {
-      if (HOST_LONG_DOUBLE_FORMAT == TARGET_LONG_DOUBLE_FORMAT)
-       {
-         DOUBLEST retval;
-
-         memcpy (&retval, addr, sizeof (retval));
-         return retval;
-       }
-      else
-       floatformat_to_doublest (TARGET_LONG_DOUBLE_FORMAT, addr, &dretval);
-    }
-  else
-    {
-      error ("Can't deal with a floating point number of %d bytes.", len);
-    }
-
-  return dretval;
-}
-
-void
-store_floating (void *addr, int len, DOUBLEST val)
-{
-  if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT)
-    {
-      if (HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT)
-       {
-         float floatval = val;
-
-         memcpy (addr, &floatval, sizeof (floatval));
-       }
-      else
-       floatformat_from_doublest (TARGET_FLOAT_FORMAT, &val, addr);
-    }
-  else if (len * TARGET_CHAR_BIT == TARGET_DOUBLE_BIT)
-    {
-      if (HOST_DOUBLE_FORMAT == TARGET_DOUBLE_FORMAT)
-       {
-         double doubleval = val;
-
-         memcpy (addr, &doubleval, sizeof (doubleval));
-       }
-      else
-       floatformat_from_doublest (TARGET_DOUBLE_FORMAT, &val, addr);
-    }
-  else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT)
-    {
-      if (HOST_LONG_DOUBLE_FORMAT == TARGET_LONG_DOUBLE_FORMAT)
-       memcpy (addr, &val, sizeof (val));
-      else
-       floatformat_from_doublest (TARGET_LONG_DOUBLE_FORMAT, &val, addr);
-    }
-  else
-    {
-      error ("Can't deal with a floating point number of %d bytes.", len);
-    }
-}
-
-/* Return a `value' with the contents of register REGNUM
-   in its virtual format, with the type specified by
-   REGISTER_VIRTUAL_TYPE.  
-
-   NOTE: returns NULL if register value is not available.
-   Caller will check return value or die!  */
-
-value_ptr
-value_of_register (regnum)
-     int regnum;
+struct value *
+value_of_register (int regnum, struct frame_info *frame)
 {
   CORE_ADDR addr;
   int optim;
-  register value_ptr reg_val;
-  char raw_buffer[MAX_REGISTER_RAW_SIZE];
+  struct value *reg_val;
+  char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
   enum lval_type lval;
 
+  /* Builtin registers lie completly outside of the range of normal
+     registers.  Catch them early so that the target never sees them.  */
+  if (regnum >= NUM_REGS + NUM_PSEUDO_REGS)
+    return value_of_builtin_reg (regnum, deprecated_selected_frame);
+
   get_saved_register (raw_buffer, &optim, &addr,
-                     selected_frame, regnum, &lval);
+                     frame, regnum, &lval);
+
+  /* FIXME: cagney/2002-05-15: This test is just bogus.
+
+     It indicates that the target failed to supply a value for a
+     register because it was "not available" at this time.  Problem
+     is, the target still has the register and so get saved_register()
+     may be returning a value saved on the stack.  */
 
   if (register_cached (regnum) < 0)
     return NULL;               /* register value not available */
@@ -416,7 +331,8 @@ value_of_register (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),
@@ -431,13 +347,13 @@ value_of_register (regnum)
 /* Given a pointer of type TYPE in target form in BUF, return the
    address it represents.  */
 CORE_ADDR
-unsigned_pointer_to_address (struct type *type, void *buf)
+unsigned_pointer_to_address (struct type *type, const void *buf)
 {
   return extract_address (buf, TYPE_LENGTH (type));
 }
 
 CORE_ADDR
-signed_pointer_to_address (struct type *type, void *buf)
+signed_pointer_to_address (struct type *type, const void *buf)
 {
   return extract_signed_integer (buf, TYPE_LENGTH (type));
 }
@@ -460,8 +376,7 @@ address_to_signed_pointer (struct type *type, void *buf, CORE_ADDR addr)
    up caring what frame it is being evaluated relative to?  SYM must
    be non-NULL.  */
 int
-symbol_read_needs_frame (sym)
-     struct symbol *sym;
+symbol_read_needs_frame (struct symbol *sym)
 {
   switch (SYMBOL_CLASS (sym))
     {
@@ -476,7 +391,7 @@ symbol_read_needs_frame (sym)
     case LOC_LOCAL_ARG:
     case LOC_BASEREG:
     case LOC_BASEREG_ARG:
-    case LOC_THREAD_LOCAL_STATIC:
+    case LOC_HP_THREAD_LOCAL_STATIC:
       return 1;
 
     case LOC_UNDEF:
@@ -503,14 +418,12 @@ symbol_read_needs_frame (sym)
    and a stack frame id, read the value of the variable
    and return a (pointer to a) struct value containing the value. 
    If the variable cannot be found, return a zero pointer.
-   If FRAME is NULL, use the selected_frame.  */
+   If FRAME is NULL, use the deprecated_selected_frame.  */
 
-value_ptr
-read_var_value (var, frame)
-     register struct symbol *var;
-     struct frame_info *frame;
+struct value *
+read_var_value (register struct symbol *var, struct frame_info *frame)
 {
-  register value_ptr v;
+  register struct value *v;
   struct type *type = SYMBOL_TYPE (var);
   CORE_ADDR addr;
   register int len;
@@ -522,7 +435,7 @@ read_var_value (var, frame)
   len = TYPE_LENGTH (type);
 
   if (frame == NULL)
-    frame = selected_frame;
+    frame = deprecated_selected_frame;
 
   switch (SYMBOL_CLASS (var))
     {
@@ -566,18 +479,21 @@ read_var_value (var, frame)
       break;
 
     case LOC_INDIRECT:
-      /* The import slot does not have a real address in it from the
-         dynamic loader (dld.sl on HP-UX), if the target hasn't begun
-         execution yet, so check for that. */
-      if (!target_has_execution)
-       error ("\
+      {
+       /* The import slot does not have a real address in it from the
+          dynamic loader (dld.sl on HP-UX), if the target hasn't
+          begun execution yet, so check for that. */
+       CORE_ADDR locaddr;
+       struct value *loc;
+       if (!target_has_execution)
+         error ("\
 Attempt to access variable defined in different shared object or load module when\n\
 addresses have not been bound by the dynamic loader. Try again when executable is running.");
 
-      addr = SYMBOL_VALUE_ADDRESS (var);
-      addr = read_memory_unsigned_integer
-       (addr, TARGET_PTR_BIT / TARGET_CHAR_BIT);
-      break;
+       locaddr = SYMBOL_VALUE_ADDRESS (var);
+       loc = value_at (lookup_pointer_type (type), locaddr, NULL);
+       addr = value_as_address (loc);
+      }
 
     case LOC_ARG:
       if (frame == NULL)
@@ -589,15 +505,19 @@ addresses have not been bound by the dynamic loader. Try again when executable i
       break;
 
     case LOC_REF_ARG:
-      if (frame == NULL)
-       return 0;
-      addr = FRAME_ARGS_ADDRESS (frame);
-      if (!addr)
-       return 0;
-      addr += SYMBOL_VALUE (var);
-      addr = read_memory_unsigned_integer
-       (addr, TARGET_PTR_BIT / TARGET_CHAR_BIT);
-      break;
+      {
+       struct value *ref;
+       CORE_ADDR argref;
+       if (frame == NULL)
+         return 0;
+       argref = FRAME_ARGS_ADDRESS (frame);
+       if (!argref)
+         return 0;
+       argref += SYMBOL_VALUE (var);
+       ref = value_at (lookup_pointer_type (type), argref, NULL);
+       addr = value_as_address (ref);
+       break;
+      }
 
     case LOC_LOCAL:
     case LOC_LOCAL_ARG:
@@ -609,24 +529,31 @@ addresses have not been bound by the dynamic loader. Try again when executable i
 
     case LOC_BASEREG:
     case LOC_BASEREG_ARG:
+    case LOC_HP_THREAD_LOCAL_STATIC:
       {
-       char buf[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)));
+       struct value *regval;
+
+       regval = value_from_register (lookup_pointer_type (type),
+                                     SYMBOL_BASEREG (var), frame);
+       if (regval == NULL)
+         error ("Value of base register not available.");
+       addr = value_as_address (regval);
        addr += SYMBOL_VALUE (var);
        break;
       }
 
     case LOC_THREAD_LOCAL_STATIC:
       {
-       char buf[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)));
-       addr += SYMBOL_VALUE (var);
-       break;
+        if (target_get_thread_local_address_p ())
+          addr = target_get_thread_local_address (inferior_ptid,
+                                                  SYMBOL_OBJFILE (var),
+                                                  SYMBOL_VALUE_ADDRESS (var));
+        /* It wouldn't be wrong here to try a gdbarch method, too;
+           finding TLS is an ABI-specific thing.  But we don't do that
+           yet.  */
+        else
+          error ("Cannot find thread-local variables on this target");
+        break;
       }
 
     case LOC_TYPEDEF:
@@ -647,11 +574,11 @@ addresses have not been bound by the dynamic loader. Try again when executable i
       {
        struct block *b;
        int regno = SYMBOL_VALUE (var);
-       value_ptr regval;
+       struct value *regval;
 
        if (frame == NULL)
          return 0;
-       b = get_frame_block (frame);
+       b = get_frame_block (frame, 0);
 
        if (SYMBOL_CLASS (var) == LOC_REGPARM_ADDR)
          {
@@ -662,7 +589,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
            if (regval == NULL)
              error ("Value of register variable not available.");
 
-           addr = value_as_pointer (regval);
+           addr = value_as_address (regval);
            VALUE_LVAL (v) = lval_memory;
          }
        else
@@ -712,16 +639,13 @@ addresses have not been bound by the dynamic loader. Try again when executable i
    NOTE: returns NULL if register value is not available.
    Caller will check return value or die!  */
 
-value_ptr
-value_from_register (type, regnum, frame)
-     struct type *type;
-     int regnum;
-     struct frame_info *frame;
+struct value *
+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);
+  struct value *v = allocate_value (type);
   char *value_bytes = 0;
   int value_bytes_copied = 0;
   int num_storage_locs;
@@ -731,11 +655,6 @@ value_from_register (type, regnum, frame)
   CHECK_TYPEDEF (type);
   len = TYPE_LENGTH (type);
 
-  /* Pointers on D10V are really only 16 bits, 
-     but we lie to gdb elsewhere... */
-  if (GDB_TARGET_IS_D10V && TYPE_CODE (type) == TYPE_CODE_PTR)
-    len = 2;
-
   VALUE_REGNO (v) = regnum;
 
   num_storage_locs = (len > REGISTER_VIRTUAL_SIZE (regnum) ?
@@ -867,7 +786,7 @@ value_from_register (type, regnum, frame)
           for some good purpose.  */
        {
          VALUE_LVAL (v) = lval_reg_frame_relative;
-         VALUE_FRAME (v) = FRAME_FP (frame);
+         VALUE_FRAME (v) = get_frame_base (frame);
          VALUE_FRAME_REGNUM (v) = regnum;
        }
       else if (mem_stor)
@@ -881,7 +800,8 @@ value_from_register (type, regnum, 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;
 
@@ -914,18 +834,18 @@ value_from_register (type, regnum, frame)
   VALUE_LVAL (v) = lval;
   VALUE_ADDRESS (v) = addr;
 
-  /* Convert raw data to virtual format if necessary.  */
+  /* Convert the raw register to the corresponding data value's memory
+     format, if necessary.  */
 
-  if (REGISTER_CONVERTIBLE (regnum))
+  if (CONVERT_REGISTER_P (regnum))
     {
-      REGISTER_CONVERT_TO_VIRTUAL (regnum, type,
-                                  raw_buffer, VALUE_CONTENTS_RAW (v));
+      REGISTER_TO_VALUE (regnum, type, raw_buffer, VALUE_CONTENTS_RAW (v));
     }
   else
     {
       /* Raw and virtual formats are the same for this register.  */
 
-      if (TARGET_BYTE_ORDER == BIG_ENDIAN && len < REGISTER_RAW_SIZE (regnum))
+      if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && len < REGISTER_RAW_SIZE (regnum))
        {
          /* Big-endian, and we want less than full size.  */
          VALUE_OFFSET (v) = REGISTER_RAW_SIZE (regnum) - len;
@@ -934,24 +854,6 @@ value_from_register (type, regnum, frame)
       memcpy (VALUE_CONTENTS_RAW (v), raw_buffer + VALUE_OFFSET (v), len);
     }
 
-  if (GDB_TARGET_IS_D10V
-      && TYPE_CODE (type) == TYPE_CODE_PTR)
-    {
-      unsigned long num;
-      unsigned short snum;
-
-      snum = (unsigned short)
-       extract_unsigned_integer (VALUE_CONTENTS_RAW (v), 2);
-
-      if (TYPE_TARGET_TYPE (type)        /* pointer to function */
-         && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC))
-       num = D10V_MAKE_IADDR (snum);
-      else                               /* pointer to data */
-       num = D10V_MAKE_DADDR (snum);
-
-      store_address (VALUE_CONTENTS_RAW (v), 4, num);
-    }
-
   return v;
 }
 \f
@@ -960,14 +862,12 @@ value_from_register (type, regnum, frame)
    return a (pointer to a) struct value containing the properly typed
    address.  */
 
-value_ptr
-locate_var_value (var, frame)
-     register struct symbol *var;
-     struct frame_info *frame;
+struct value *
+locate_var_value (register struct symbol *var, struct frame_info *frame)
 {
   CORE_ADDR addr = 0;
   struct type *type = SYMBOL_TYPE (var);
-  value_ptr lazy_value;
+  struct value *lazy_value;
 
   /* Evaluate it first; if the result is a memory address, we're fine.
      Lazy evaluation pays off here. */
@@ -979,7 +879,7 @@ locate_var_value (var, frame)
   if (VALUE_LAZY (lazy_value)
       || TYPE_CODE (type) == TYPE_CODE_FUNC)
     {
-      value_ptr val;
+      struct value *val;
 
       addr = VALUE_ADDRESS (lazy_value);
       val = value_from_pointer (lookup_pointer_type (type), addr);
@@ -991,9 +891,21 @@ locate_var_value (var, frame)
   switch (VALUE_LVAL (lazy_value))
     {
     case lval_register:
+       gdb_assert (REGISTER_NAME (VALUE_REGNO (lazy_value)) != NULL
+                   && *REGISTER_NAME (VALUE_REGNO (lazy_value)) != '\0');
+      error("Address requested for identifier "
+           "\"%s\" which is in register $%s",
+            SYMBOL_SOURCE_NAME (var), 
+           REGISTER_NAME (VALUE_REGNO (lazy_value)));
+      break;
+
     case lval_reg_frame_relative:
-      error ("Address requested for identifier \"%s\" which is in a register.",
-            SYMBOL_SOURCE_NAME (var));
+       gdb_assert (REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)) != NULL
+                   && *REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)) != '\0');
+      error("Address requested for identifier "
+           "\"%s\" which is in frame register $%s",
+            SYMBOL_SOURCE_NAME (var), 
+           REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)));
       break;
 
     default:
This page took 0.031337 seconds and 4 git commands to generate.