[PATCH] D81144: [MC] Generate .debug_line in the 64-bit DWARF format [2/7]
Thomas Preud'homme via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 5 04:22:46 PDT 2020
thopre added inline comments.
================
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:
> ikudrin wrote:
> > 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.
> Wanting to check the exact number of digits sounds reasonable to me. Possibly deserves an extension to the FileCheck expression parser at some point too. @thopre - thoughts on that? It seems related to our previous discussion about leading zeros too.
Something like [[# %#.8x, FILEOFF:]] (to follow printf format) then? Looks easy enough of a feature to add.
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