This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [revised PATCH RFC] DWARF2 CFA not equal frame_base issue


I am not sure if I understand what you mean. LOC_BASEREG[_ARG] is different
from LOC_REF_ARG. LOC_REF_ARG describes another level of indirection. The
addr variable is computed in findvar.c for LOC_REF_ARG by

argref = value_as_address (regval);
argref += SYMBOL_VALUE (var);
ref = value_at (lookup_pointer_type (type), argref, NULL);
addr = value_as_address (ref);

but for LOC_BASEREG[_ARG] by

addr = value_as_address (regval);
addr += SYMBOL_VALUE (var);

Regards / Mit freundlichen Gruessen
Gerhard

Gerhard Tonn, Linux for eServer Development, +(49)-7031-16-4716, Lotus
Notes: ton@ibmde,
   Internet: ton@de.ibm.com


Andrew Cagney <ac131313@redhat.com> on 26.11.2002 00:00:16

To:    Gerhard Tonn/Germany/IBM@IBMDE
cc:    gdb-patches@sources.redhat.com
Subject:    Re: [revised PATCH RFC]  DWARF2 CFA not equal frame_base issue



> 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






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]