[Issue 3987] [gdb] Invalid DWARF output for function pointers
https://issues.dlang.org/show_bug.cgi?id=3987 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added Version|1.055 |D1 --
[Issue 3987] [gdb] Invalid DWARF output for function pointers
http://d.puremagic.com/issues/show_bug.cgi?id=3987 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added CC||bugzi...@digitalmars.com --- Comment #14 from Walter Bright bugzi...@digitalmars.com 2010-04-27 07:01:51 PDT --- I think I figured out what was going wrong with the function type caching, and came up with a corrected fix. Changeset 451. Please give it a try. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3987] [gdb] Invalid DWARF output for function pointers
http://d.puremagic.com/issues/show_bug.cgi?id=3987 --- Comment #15 from Robert Clipsham rob...@octarineparrot.com 2010-04-27 19:43:59 BST --- Using r452 all my mini tests are working, I haven't tried QtD or other real apps, the test cases I got from them seem to work though :) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3987] [gdb] Invalid DWARF output for function pointers
http://d.puremagic.com/issues/show_bug.cgi?id=3987 --- Comment #16 from Walter Bright bugzi...@digitalmars.com 2010-04-27 12:37:33 PDT --- Robert, I should add that I'm very indebted to you for figuring out what was going wrong with the dwarf output. Thank you! -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3987] [gdb] Invalid DWARF output for function pointers
http://d.puremagic.com/issues/show_bug.cgi?id=3987 Robert Clipsham rob...@octarineparrot.com changed: What|Removed |Added Attachment #593 is|0 |1 obsolete|| --- Comment #10 from Robert Clipsham rob...@octarineparrot.com 2010-04-01 13:18:16 BST --- Created an attachment (id=594) Fix for #3987 This patch fixes the debug info. Tested with several test programs, including QtD, a couple of cases from Bernard Helyer, and my own test cases (which include the use of Phobos and DRuntime). The patch is against dmd 2.042, but it shouldn't be too hard to adapt it to the latest svn and dmd 1.x. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3987] [gdb] Invalid DWARF output for function pointers
http://d.puremagic.com/issues/show_bug.cgi?id=3987 nfx...@gmail.com changed: What|Removed |Added CC||nfx...@gmail.com --- Comment #11 from nfx...@gmail.com 2010-04-01 05:58:56 PDT --- Hey Walter, could you have a look at bug 3214 too? It's trivial to fix. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3987] [gdb] Invalid DWARF output for function pointers
http://d.puremagic.com/issues/show_bug.cgi?id=3987 Eldar Insafutdinov e.insafutdi...@gmail.com changed: What|Removed |Added CC||e.insafutdi...@gmail.com --- Comment #12 from Eldar Insafutdinov e.insafutdi...@gmail.com 2010-04-01 14:13:48 PDT --- I confirm that the patch fixes problems with QtD. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3987] [gdb] Invalid DWARF output for function pointers
http://d.puremagic.com/issues/show_bug.cgi?id=3987 Robert Clipsham rob...@octarineparrot.com changed: What|Removed |Added Keywords||patch --- Comment #8 from Robert Clipsham rob...@octarineparrot.com 2010-03-30 22:31:36 BST --- Ignoring the above patch, and removing lines 1447 and 1469 (both DW_AT_type) of backend/dwarf.c, fixes this and most of the function pointer related debugging issues, and unlike the attached patch creates the correct debug info (the patch creates debug info that works but isn't the correct way to do it). The only situations it doesn't not fix involve: // T and U can be any type T function(U function(/*Any args here*/)) funcptr; Where dmd created invalid information for .debug_range, and when attempting to read the debug info both readelf and objdump degfault, gdb continues to DIE. If I cannot fix this issue then this fix should be applied for now, as the situation is still far better than it is currently (debug info for phobos and druntime works, and most apps I've encountered don't use the above). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3987] [gdb] Invalid DWARF output for function pointers
http://d.puremagic.com/issues/show_bug.cgi?id=3987 --- Comment #5 from Robert Clipsham rob...@octarineparrot.com 2010-03-29 15:29:47 PDT --- Created an attachment (id=593) Patch for bug 3987 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3987] [gdb] Invalid DWARF output for function pointers
http://d.puremagic.com/issues/show_bug.cgi?id=3987 Robert Clipsham rob...@octarineparrot.com changed: What|Removed |Added Keywords||patch --- Comment #6 from Robert Clipsham rob...@octarineparrot.com 2010-03-29 15:30:18 PDT --- I've attached a patch that seems to fix this issue. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3987] [gdb] Invalid DWARF output for function pointers
http://d.puremagic.com/issues/show_bug.cgi?id=3987 Robert Clipsham rob...@octarineparrot.com changed: What|Removed |Added Keywords|patch | --- Comment #7 from Robert Clipsham rob...@octarineparrot.com 2010-03-30 02:03:55 BST --- The patch I created works for a selection of cases, and fixes the bug mentioned in the bug report, however there are a lot of extremely related issues which it doesn't fix. I've written a preliminary patch which does fix the other issues, unfortunately it causes the debug info output to be incorrect, so it needs more work. The current patch removes the DW_AT_type from the pointer, but to function properly it should remove the DW_AT_type from the function. This is rather difficult to do, as the function does not know its parent type, so cannot know if it is a function pointer and therefore needs to leave out the DW_AT_type. The current patch I'm working on adds another argument to dwarf_typidx() to specify it, it seems a bit hacky though. If anyone has a better idea of how to check if the function's parent type is a pointer, please let me know :) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3987] [gdb] Invalid DWARF output for function pointers
http://d.puremagic.com/issues/show_bug.cgi?id=3987 --- Comment #1 from Robert Clipsham rob...@octarineparrot.com 2010-03-27 12:01:39 PDT --- Compile with: $ dmd -c -gc test.d $ gcc test.o -o test -m32 (Note: I had a dmd.conf in the same directory to make sure druntime/phobos weren't included, I don't know if this is needed) void function() foobar; extern(C)void _Dmodule_ref(){} extern(C)int main(int argc, char** argv) { return 0; } //void foo(){} //void main(){} Uncommenting either of the 2 functions at the bottom will trigger the bug, but without them it does not happen. I have attached 3 files, which are the outputs of the following 3 commands: $ objdump --dwarf test dwarf2 $ objdump --dwarf test dwarf # With void main(){} $ diff -u dwarf2 dwarf Hopefully this should help figure out what's happening. Without reading into the DWARF spec I cannot figure out what's wrong, but there's not a huge amount of difference between them, so it shouldn't take too much effort for someone who knows the spec to figure out what's wrong. The above was tested with dmd 2.042. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3987] [gdb] Invalid DWARF output for function pointers
http://d.puremagic.com/issues/show_bug.cgi?id=3987 --- Comment #2 from Robert Clipsham rob...@octarineparrot.com 2010-03-27 12:12:48 PDT --- For some unknown reason (probably PEBKAC), the attachments were added to the wrong ticket... See: # objdump --dwarf test dwarf http://d.puremagic.com/issues/attachment.cgi?id=590 # objdump --dwarf test dwarf2 http://d.puremagic.com/issues/attachment.cgi?id=591 # diff -u dwarf2 dwarf http://d.puremagic.com/issues/attachment.cgi?id=592 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---