DwarfDebug::emitDebugInfo() always appends four zero bytes to the tail of the debug info section: emitDIE(Die); // FIXME - extra padding for gdb bug. Asm->OutStreamer.AddComment("4 extra padding bytes for GDB"); Asm->EmitInt8(0); Asm->EmitInt8(0); Asm->EmitInt8(0); Asm->EmitInt8(0); Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("info_end", TheCU->getID())); Does anybody know what the bug is in GDB that this works around? The workaround was added as part of r103439[1], which added support for multiple compilation units in one module. Does the bug ever affect modules with only a single compilation unit? -Ken [1] http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20100510/101040.html
On Apr 13, 2011, at 8:42 AM, Ken Dyck wrote:> DwarfDebug::emitDebugInfo() always appends four zero bytes to the tail > of the debug info section: > > emitDIE(Die); > // FIXME - extra padding for gdb bug. > Asm->OutStreamer.AddComment("4 extra padding bytes for GDB"); > Asm->EmitInt8(0); > Asm->EmitInt8(0); > Asm->EmitInt8(0); > Asm->EmitInt8(0); > Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("info_end", TheCU->getID())); > > Does anybody know what the bug is in GDB that this works around? The > workaround was added as part of r103439[1], which added support for > multiple compilation units in one module. Does the bug ever affect > modules with only a single compilation unit? >It was not added by r103439. In fact, it was added by r32035. http://llvm.org/viewvc/llvm-project?view=rev&revision=32035 Unfortunately the log message and comments do not provide any hints, and I do not have access to the author anymore. - Devang> -Ken > > [1] http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20100510/101040.html-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110413/cf5ec64e/attachment.html>
>> Does anybody know what the bug is in GDB that this works around? The >> workaround was added as part of r103439[1], which added support for >> multiple compilation units in one module. Does the bug ever affect >> modules with only a single compilation unit? >> > > It was not added by r103439. In fact, it was added by r32035. > > http://llvm.org/viewvc/llvm-project?view=rev&revision=32035 > > Unfortunately the log message and comments do not provide any hints, and I do not have access to the author anymore.Sounds like we should rip it out and see if there is any regression on the gdb testsuite. -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110413/35cce780/attachment.html>