[PATCH] D81144: [MC] Generate .debug_line in the 64-bit DWARF format [2/7]
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 4 08:12:10 PDT 2020
ikudrin marked 2 inline comments as done.
ikudrin added inline comments.
================
Comment at: llvm/lib/MC/MCDwarf.cpp:487
+ emitAbsValue(*MCOS,
+ MakeStartMinusEndExpr(context, *LineStartSym, *LineEndSym,
+ UnitLengthBytes),
----------------
jhenderson wrote:
> Aside: I think this function may be misnamed - shouldn't it be `MakeEndMinusStartExpr`?
Looks like you are right. Would you like to prepare the patch?
================
Comment at: llvm/test/MC/ELF/gen-dwarf64.s:20
+# DUMP5-NEXT: file_names[ 0]:
+# DUMP5-NEXT: name: .debug_line_str[0x00000000[[FILEOFF:[[:xdigit:]]{8}]]] = "[[FILE:.+]]"
+# DUMP5-NEXT: dir_index: 0
----------------
jhenderson wrote:
> FileCheck has relatively recently been extended to improve numeric variable capturing. You can change this line to something like:
>
> `name: .debug_line_str[0x00000000[[#FILEOFF:]]] = "[[FILE:.+]]"`
>
> and the usage to: `0x[[#FILEOFF]]`.
>
> Beware that there are some issues relating to leading zeros that I can't quite remember the details of.
I believe the feature would be great if there was a need for an expression, but here we can just compare exact strings.
With numeric substitutions, the first match would be something like `0x[[#%x,FILEOFF:]]`, and the usage would look like `0x{{0*}}[[#FILEOFF]]`. To my taste, the current variant is much simpler. Moreover, the current variant shows the exact number of hex digits we expect in the dump, which is, AFAIK, impossible with numeric substitutions.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81144/new/
https://reviews.llvm.org/D81144
More information about the llvm-commits
mailing list