Thread overview | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
May 03, 2010 [Issue 4154] New: Incorrect DWARF section names on Mac | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=4154 Summary: Incorrect DWARF section names on Mac Product: D Version: future Platform: Other OS/Version: Mac OS X Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: doob@me.com Blocks: 4044 --- Comment #0 from Jacob Carlborg <doob@me.com> 2010-05-03 08:58:33 PDT --- Created an attachment (id=622) Fixes the incorrect DWARF section names According to the Mach-O file format reference: http://developer.apple.com/Mac/library/documentation/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html section names should be all lowercase and prefixed with two underscores "__". DMD output the DWARF section names with a dot "." as the prefix instead of the two underscores. Both GCC and Clang output the DWARF section names prefixed with two underscores. I've attached a patch which fixes this. But with this patch (I think) one or several offsets somehow become incorrect. This is the output of dwarfdump --verify: The offset into the .debug_abbrev section (0xffffffff) is not valid. Maybe it's because the section names are now one character longer or there is something other that isn't working. The patch is against DMD revision 466. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 13, 2011 [Issue 4154] Incorrect DWARF section names on Mac | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | http://d.puremagic.com/issues/show_bug.cgi?id=4154 Sean Kelly <sean@invisibleduck.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sean@invisibleduck.org --- Comment #1 from Sean Kelly <sean@invisibleduck.org> 2011-01-13 08:12:30 PST --- The ABI says that the double-underscore prefix is a convention only and that any prefix will work, but I saw in the Valgrind source yesterday that it searches explicitly for a double-underscore prefix, and I suspect other apps are the same. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 13, 2011 [Issue 4154] Incorrect DWARF section names on Mac | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | http://d.puremagic.com/issues/show_bug.cgi?id=4154 --- Comment #2 from Jacob Carlborg <doob@me.com> 2011-01-13 09:47:21 PST --- Exactly, as the documentation says it's just a convention. But all other tools/applications assume you follow the convention, that it starts with two underscores, gdb for example. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 28, 2011 [Issue 4154] Incorrect DWARF section names on Mac | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | http://d.puremagic.com/issues/show_bug.cgi?id=4154 Brad Roberts <braddr@puremagic.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |braddr@puremagic.com --- Comment #3 from Brad Roberts <braddr@puremagic.com> 2011-03-28 00:37:37 PDT --- Today Walter merged a big batch of dwarf related fixes. I'm curious if these changes + those that were just submitted fix the other issues mentioned here. Could I get one of you two to update the patch here (if needed) and check to make sure it still works correctly? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 28, 2011 [Issue 4154] Incorrect DWARF section names on Mac | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | http://d.puremagic.com/issues/show_bug.cgi?id=4154 --- Comment #4 from Jacob Carlborg <doob@me.com> 2011-03-28 00:54:49 PDT --- (In reply to comment #3) > Today Walter merged a big batch of dwarf related fixes. I'm curious if these changes + those that were just submitted fix the other issues mentioned here. Could I get one of you two to update the patch here (if needed) and check to make sure it still works correctly? I will not be able to try the patch until tuesday evening. I don't think it ever worked correctly, read my original message. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 03, 2011 [Issue 4154] Incorrect DWARF section names on Mac | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | http://d.puremagic.com/issues/show_bug.cgi?id=4154 Robert Clipsham <robert@octarineparrot.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |robert@octarineparrot.com --- Comment #5 from Robert Clipsham <robert@octarineparrot.com> 2011-06-03 23:25:12 BST --- I have a modified version of this patch that almost works (one byte needs changing with a hex editor for debug info to work). I should have a patch/pull request together later tonight. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 04, 2011 [Issue 4154] Incorrect DWARF section names on Mac | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | http://d.puremagic.com/issues/show_bug.cgi?id=4154 --- Comment #6 from Robert Clipsham <robert@octarineparrot.com> 2011-06-04 00:56:44 BST --- I've run out of time to work on this for now, my initial commit is at https://github.com/mrmonday/dmd/commit/c7fed0fbe5319de507fd0afb4c574bdb4e54699f . The debug info can easily be fixed up in a hex editor, I'm struggling to find where dmd is outputting the incorrect info though. In the __debug_info section the abbrev_offset field is being set to the incorrect value. The workaround is to change it to zero in a hex editor, this is not the correct solution though, the correct offset needs to be inserted. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 04, 2011 [Issue 4154] Incorrect DWARF section names on Mac | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | http://d.puremagic.com/issues/show_bug.cgi?id=4154 --- Comment #7 from Robert Clipsham <robert@octarineparrot.com> 2011-06-04 01:18:01 BST --- Actually, removing the offset seems to be the correct solution - it's what both gcc and clang do on OS X (despite it being contrary to what the DWARF spec states). I'll put together a pull request now. Another odd side effect seems to be that no debug info ends up in the resulting binary (only the object files), but again, this seems to be consistent with gcc and clang's output when using -g. I recall reading somewhere that Mach-O uses a separate file for debug information, it could be related to this. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 04, 2011 [Issue 4154] Incorrect DWARF section names on Mac | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | http://d.puremagic.com/issues/show_bug.cgi?id=4154 --- Comment #8 from Robert Clipsham <robert@octarineparrot.com> 2011-06-04 02:07:18 BST --- https://github.com/D-Programming-Language/dmd/pull/83 - Everything works as it should, the file just needs running through dsymutil. Unfortunately dsymutil exploded violently when I tried to get it working, so I didn't add it into dmd's builder. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 04, 2011 [Issue 4154] Incorrect DWARF section names on Mac | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | http://d.puremagic.com/issues/show_bug.cgi?id=4154 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@digitalmars.com --- Comment #9 from Walter Bright <bugzilla@digitalmars.com> 2011-06-04 10:37:40 PDT --- (In reply to comment #8) > https://github.com/D-Programming-Language/dmd/pull/83 - Everything works as it should, the file just needs running through dsymutil. I don't understand - why should dsymutil be needed at all? It isn't needed for gcc. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation