Thread overview | ||||||
---|---|---|---|---|---|---|
|
May 20, 2010 [Issue 4212] New: DWARF: void arrays cause gdb errors | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=4212 Summary: DWARF: void arrays cause gdb errors Product: D Version: 1.057 Platform: Other OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: nfxjfg@gmail.com --- Comment #0 from nfxjfg@gmail.com 2010-05-20 12:04:46 PDT --- (This bug report is for dmd 1.061) This code: extern (C) void abort(); struct X { union { void[] a; void[a.sizeof] b; } } void foo(X b) { abort(); } void main() { foo(X.init); } Makes gdb output "Dwarf Error: Cannot find DIE at 0x0 referenced from DIE at 0x68 [in module /tmp/test/dr]" when the abort() jumps back into the debugger, and you request a stacktrace with "bt". I suspect something is wrong with static void[] arrays. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 20, 2010 [Issue 4212] DWARF: void arrays cause gdb errors | ||||
---|---|---|---|---|
| ||||
Posted in reply to nfxjfg@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=4212 Robert Clipsham <robert@octarineparrot.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |robert@octarineparrot.com --- Comment #1 from Robert Clipsham <robert@octarineparrot.com> 2010-05-20 20:21:57 BST --- Test case is for D1, with D2 it fails with an error that has no line number information. Reduced test case for D2: ---- void[8] foo = void; void main(){} ---- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 20, 2010 [Issue 4212] DWARF: void arrays cause gdb errors | ||||
---|---|---|---|---|
| ||||
Posted in reply to nfxjfg@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=4212 Robert Clipsham <robert@octarineparrot.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch --- Comment #2 from Robert Clipsham <robert@octarineparrot.com> 2010-05-20 20:45:35 BST --- The patch below fixes both test cases: Index: backend/dwarf.c =================================================================== --- backend/dwarf.c (revisión: 494) +++ backend/dwarf.c (copia de trabajo) @@ -1558,6 +1558,13 @@ DW_AT_type, DW_FORM_ref4, 0, 0, }; + static unsigned char abbrevTypeArrayVoid[] = + { + DW_TAG_array_type, + 1, // child (the subrange type) + DW_AT_sibling, DW_FORM_ref4, + 0, 0, + }; static unsigned char abbrevTypeSubrange[] = { DW_TAG_subrange_type, @@ -1573,7 +1580,6 @@ DW_AT_type, DW_FORM_ref4, 0, 0, }; - unsigned code1 = dwarf_abbrev_code(abbrevTypeArray, sizeof(abbrevTypeArray)); unsigned code2 = (t->Tflags & TFsizeunknown) ? dwarf_abbrev_code(abbrevTypeSubrange2, sizeof(abbrevTypeSubrange2)) : dwarf_abbrev_code(abbrevTypeSubrange, sizeof(abbrevTypeSubrange)); @@ -1581,12 +1587,15 @@ unsigned idxsibling = 0; unsigned siblingoffset; nextidx = dwarf_typidx(t->Tnext); + unsigned code1 = nextidx ? dwarf_abbrev_code(abbrevTypeArray, sizeof(abbrevTypeArray)) + : dwarf_abbrev_code(abbrevTypeArrayVoid, sizeof(abbrevTypeArrayVoid)); idx = infobuf->size(); infobuf->writeuLEB128(code1); // DW_TAG_array_type siblingoffset = infobuf->size(); infobuf->write32(idxsibling); // DW_AT_sibling - infobuf->write32(nextidx); // DW_AT_type + if (nextidx) + infobuf->write32(nextidx); // DW_AT_type infobuf->writeuLEB128(code2); // DW_TAG_subrange_type infobuf->write32(idxbase); // DW_AT_type -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 21, 2010 [Issue 4212] DWARF: void arrays cause gdb errors | ||||
---|---|---|---|---|
| ||||
Posted in reply to nfxjfg@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=4212 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |FIXED --- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2010-05-20 22:07:14 PDT --- changeset 495 (dwarf.c changes) -- 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