public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug shlibs/11790] New: DW_OP_addr is not relocated
@ 2010-07-05 14:19 jan dot kratochvil at redhat dot com
  2010-07-07 18:52 ` [Bug shlibs/11790] " tromey at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2010-07-05 14:19 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug shlibs/11790] DW_OP_addr is not relocated
  2010-07-05 14:19 [Bug shlibs/11790] New: DW_OP_addr is not relocated jan dot kratochvil at redhat dot com
@ 2010-07-07 18:52 ` tromey at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: tromey at redhat dot com @ 2010-07-07 18:52 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From tromey at redhat dot com  2010-07-07 18:52 -------
I checked in the fix.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|7.1                         |7.2


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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-07 18:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-05 14:19 [Bug shlibs/11790] New: DW_OP_addr is not relocated jan dot kratochvil at redhat dot com
2010-07-07 18:52 ` [Bug shlibs/11790] " tromey at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).