[revised PATCH RFC] DWARF2 CFA not equal frame_base issue

Andrew Cagney ac131313@redhat.com
Mon Nov 25 15:00:00 GMT 2002


> Hi,
> as I told in a previous post
> 
> http://sources.redhat.com/ml/gdb-patches/2002-09/msg00574.html
> 
> the DWARF2 CFA value is not equal to the DW_AT_frame_base value on s390. I
> have attached a revised patch that adresses this issue. I don't know if the
> patch hurts on other platforms, though. If it does could we make this patch
> somehow platform specific?
> 
> (See attached file: cfa-frame-base.patch)

Can you instead exploit this:

     case LOC_BASEREG:
     case LOC_BASEREG_ARG:
     case LOC_THREAD_LOCAL_STATIC:
       {
         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;
       }

by setting the loc type to LOC_BASEREG[_ARG] instead of LOC_REF_ARG?

--- gdb-5.2.cvs20020818/gdb/dwarf2read.c        2002-08-01 
17:15:31.000000000 +0
200
+++ gdb-5.2.cvs20020818.bak/gdb/dwarf2read.c    2002-09-27 
10:13:51.000000000 +0
200
@@ -4819,7 +4819,12 @@
                   if (isderef)
                     {
                       if (basereg != frame_base_reg)
-                       complain (&dwarf2_complex_location_expr);
+                       {
+                         complain (&dwarf2_complex_location_expr);
+                         SYMBOL_BASEREG (sym) = -1;
+                       }
+                     else
+                       SYMBOL_BASEREG (sym) = DWARF2_REG_TO_REGNUM 
(basereg);
                       SYMBOL_CLASS (sym) = LOC_REF_ARG;
                     }
                   else

Andrew




More information about the Gdb-patches mailing list