Thread overview
[Issue 2604] New: DW_TAG_module and GDB
Jan 22, 2009
d-bugmail
Jan 23, 2009
d-bugmail
Jan 24, 2009
d-bugmail
Jan 24, 2009
d-bugmail
Aug 07, 2009
Walter Bright
Sep 03, 2009
Walter Bright
January 22, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2604

           Summary: DW_TAG_module and GDB
           Product: D
           Version: 1.029
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: mihail.zenkov@gmail.com


I try fix GDB to support DMD 1.029 and greater. DMD set flag "has children" to DW_TAG_module and in this case GDB can't find DW_TAG_subprogram, as result we don't have psymbols. If i change flag to "no children" GDB load psymbols without problems. Is it bug DMD or GDB? Why DMD set this flag?


-- 

January 23, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2604





------- Comment #1 from jason.james.house@gmail.com  2009-01-22 20:04 -------
(In reply to comment #0)
> I try fix GDB to support DMD 1.029 and greater. DMD set flag "has children" to DW_TAG_module and in this case GDB can't find DW_TAG_subprogram, as result we don't have psymbols. If i change flag to "no children" GDB load psymbols without problems. Is it bug DMD or GDB? Why DMD set this flag?

For those of us waiting for this bug to get fixed, is there any relatively easy thing we can do to get gdb to work?


-- 

January 24, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2604





------- Comment #2 from mihail.zenkov@gmail.com  2009-01-23 19:07 -------
>For those of us waiting for this bug to get fixed, is there any relatively easy thing we can do to get gdb to work?

1. Use GDC or DMD-1.028. Currently DMD specific DWARF extensions not supported. http://www.digitalmars.com/d/1.0/abi.html

2. Try patch binary before debug it.

For example we have binary crash_test.
With next command we can see if DW_TAG_module have "has children" flag:
objdump -W crash_test 2>/dev/null | grep DW_TAG_module

 <1><138>: Abbrev Number: 2 (DW_TAG_module)
   2      DW_TAG_module    [has children]

Try patch it:
sed "s/\x1e\x01\x03\x08/\x1e\x00\x03\x08/" -i crash_test

And see again what we have:
objdump -W crash_test 2>/dev/null | grep DW_TAG_module

 <1><138>: Abbrev Number: 2 (DW_TAG_module)
   2      DW_TAG_module    [no children]


-- 

January 24, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2604





------- Comment #3 from jason.james.house@gmail.com  2009-01-23 19:33 -------
I had hoped this would be a workaround for http://d.puremagic.com/issues/show_bug.cgi?id=2575 but alas, it does not :(

For others trying the sed command, I think you need to use greedy replacement. (add a g between the last / and ").  Without that, it did not fix all occurances of has children for me.


-- 

August 07, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2604


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com




--- Comment #4 from Walter Bright <bugzilla@digitalmars.com>  2009-08-07 16:26:51 PDT ---
I plan on simply removing the DW_TAG_module tag, as it seems to cause problems in GDB.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 03, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2604


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #5 from Walter Bright <bugzilla@digitalmars.com>  2009-09-03 13:24:42 PDT ---
Fixed dmd 1.047 and 2.032

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------