This is the mail archive of the gdb-prs@sourceware.org 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]

[Bug shlibs/11790] New: DW_OP_addr is not relocated


Some optimized out variables with constant DWARF-specified values are
incorrectly not relocated by GDB.

echo -e 'static int i;static int *const ip = &i;void g (void *a, void *b) {}
void f (void) { g (&i, ip); }'|gcc -O2 -o a.so -shared -fPIC -Wall -g -x c
-;echo -e 'extern void f (void); int main () { f(); return 0; }'|gcc -o a ./a.so
-Wall -g -x c -;gdb -nx -ex start -ex 'adv g' -ex 'p &i' -ex 'p ip' ./a

(-O2 above)
$1 = (int *) 0x7ffff7ffc7f8
$2 = (int * const) 0x2007f8

while with (-O0):
$1 = (int *) 0x7ffff7ffc830
$2 = (int * const) 0x7ffff7ffc830

They should be the same.

    < c>   DW_AT_producer    : (indirect string, offset: 0x11): GNU C 4.5.1
20100705 (prerelease)       
 <1><7a>: Abbrev Number: 6 (DW_TAG_variable)
    <7b>   DW_AT_name        : i        
    <83>   DW_AT_location    : 9 byte block: 3 f8 7 20 0 0 0 0 0       
(DW_OP_addr: 2007f8)
 <1><94>: Abbrev Number: 6 (DW_TAG_variable)
    <95>   DW_AT_name        : ip       
    <9e>   DW_AT_location    : 10 byte block: 3 f8 7 20 0 0 0 0 0 9f   
(DW_OP_addr: 2007f8; DW_OP_stack_value)

Downstream bugreport:
https://bugzilla.redhat.com/show_bug.cgi?id=546017

-- 
           Summary: DW_OP_addr is not relocated
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: shlibs
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: jan dot kratochvil at redhat dot com
                CC: gdb-prs at sourceware dot org
GCC target triplet: x86_64-unknown-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=11790

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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