[PATCH] D80168: For --relativenames, handle dwarf absolute include directories similarly to compilation directories.

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 13:45:48 PDT 2020


labath added a comment.

In D80168#2060851 <https://reviews.llvm.org/D80168#2060851>, @saugustine wrote:

> In D80168#2060753 <https://reviews.llvm.org/D80168#2060753>, @aprantl wrote:
>
> > Why is it necessary to check in the binary? Could we just assemble the input with llvm-mc on the fly?
>
>
> Because when you assemble with llvm-mc in the usual test suite, it sets the compilation directory, include directory, and input file like so:
>
> comp_dir: location where llvm-mc is run.
>  include_dir: absolute path to relativenames.s in the source tree
>  filename: "relativenames.s"
>
> So, after the comments above that we *don't* want the remove the include dir, even if it is an absolute path, the difference between the output with relative names and without is nothing: We still get the absolute path.


You don't actually have to use the `.loc`/`.file`/etc. directives to create the line table. You can go lower level and spell out the debug_lines content directly (`.byte` et al.). That way, you should be able to create any line table you want. There are a bunch of existing tests for llvm-dwarfdump line table functionality that do this so you can get some inspiration from those.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80168





More information about the llvm-commits mailing list