[PATCH] D147506: [DebugLine] save one debug line entry for empty prologue

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 02:09:05 PDT 2023

shchenz added a comment.

> Yeah, I'm good with it being used for all tools/debuggers - but I think the solution should be more general, especially if your debugger has real trouble with these zero length entries - fixing each case of zero length entries as they're found seems not good, and we should have a general solution so it's not possible to create these zero length entries.

Agreed. First time when I got this "DBX assumes the addresses in the debug line entries are always incremental", I was thinking the same thing, there may be other cases where clang generates two debug line entries with same address especially when optimization is enabled. At that time I was thinking `MCDwarfLineTable::emitOne()` should be able to optimize the debug lines if there are two adjacent lines with same address. Seems this is not the case?

> but for our own internal uses (when using LLVM's integrated assembler in... an integrated manner) we should skip zero length entries - or, maybe, even at a higher level - like we should ensure we don't emit zero length .loc directives even if we're emitting assembly - but again, I'd hope that would be a general solution, not finding the spots (like prologue emission) where we happen to be creating zero length entries today - that the solution should be more general/robust/lower level)

I think for the motivated case on AIX, we need this to be in the higher level, i.e. in the place where we generate the `.loc` directives. AIX for now uses non integrated-assembler mode by default, so fixing this inside integrated assembler will not make our issue gone. I will try to do by this way.

Thanks for your good suggestion. @dblaikie

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list