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 symtab/11717] common/.bss variables from shared libraries not displayed correctly


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

eager at eagercon dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |eager at eagercon dot com

--- Comment #3 from eager at eagercon dot com 2012-01-31 18:04:56 UTC ---
As the test case shows, this problem is not limited to unintialized variables
in .bss -- it also occurs with initialized variables in .data.  

The basic problem is that the DW_AT_location for the variable in the shared
library is incorrect, since it does not match how the variable is accessed.  It
says that var is addressed directly, while in fact it is accessed indirectly
through the GOT.

GCC generates
    DW_OP_addr  var
which points to the unused copy of var in the shared library.  The correct
DWARF should be
    DW_OP_addr  var@GOT
    DW_OP_deref

I'm unclear what the patch is doing exactly, but to the extent it is having gdb
ignore the generated debug info, as suggested by this comment
+          /* Never use DW_AT_location, rely on the minimal symbols.  */
then this seems to be headed in the wrong direction.  The best fix for
incorrect debug data is to generate the correct info.  Or this fix should be
clearly identified as a workaround for incorrect data, with some way of
defeating the workaround when correct data is present.

Unfortunately, gdb does not currently support "complex" DWARF expressions which
include an indirect reference.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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