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

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 18:10:59 PDT 2023


shchenz added a comment.

> do other assemblers reproduce this information?

I agree with you that some assembler, like GAS on Linux will generate zero-length ranges in the line table if no instructions between two `.loc`. I guess this can also be improved in these producers like what we did here in compiler? 
And on AIX where this patch is motivated, the system assembler does not have pseudo like `.loc`, it can only get debug line info in the `.dwline` section, see case `llvm/test/DebugInfo/XCOFF/empty.ll`. So on AIX, I think the debug lines should be always generated by compiler in the assembly file.

> Does anyone care if we preserve it or drop it?

Hmm, at least DBX cares about the zero-length ranges since it assumes the addresses in the debug line entries are always incremental. And I also tested on GDB, seems no behavior change with/without this patch. Since this patch does some small optimization in the debug line section, so I think we should use this patch for all debuggers?

Thanks for review @dblaikie . Hope I am understanding your concerns right : )


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147506/new/

https://reviews.llvm.org/D147506



More information about the llvm-commits mailing list