[PATCH] D95518: [Debug-Info][XCOFF] support dwarf for XCOFF for assembly output

Jason Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 06:57:50 PST 2021


jasonliu added inline comments.


================
Comment at: llvm/lib/MC/MCAsmStreamer.cpp:2351
+  if (!LastLabel) {
+    // Emit the sequence for the LineDelta (from 1) and a zero address delta.
+    MCDwarfLineAddr::Emit(this, MCDwarfLineTableParams(), LineDelta, 0);
----------------
nit: AddComment for here too?


================
Comment at: llvm/lib/MC/MCAsmStreamer.cpp:2344
+    // Set to CU beginning.
+    emitIntValue(dwarf::DW_LNS_extended_op, 1);
+    emitULEB128IntValue(PointerSize + 1);
----------------
shchenz wrote:
> jasonliu wrote:
> > The assembly generated is hard for human to consume. It will be very difficult to debug if anything goes wrong between those lines. It would be great if we could use addComment to let people know what each of this byte means (It could be in a follow on patch if this is too much for this one). 
> > Some of the existing dwarf code does not really have those comments because they were meant for object file generation only. But now, it might make sense to have those comments available.
> > Arguably, one could use some other tools to dump the assembled object file and figure out what each entry means. But those are extra steps and it requires time to map the dump output from object file to the original asm output. 
> Please check the assembly generated now matching your expectation? Since the prologue of debug line is not newly generated by this patch, so I left it without comment to avoid many current cases fail.
Thanks. It's much better for reading now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95518



More information about the llvm-commits mailing list