[PATCH] D86539: [Debuginfo][llvm-dwarfutil] llvm-dwarfutil dsymutil-like tool for ELF.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 03:50:48 PDT 2022


avl added inline comments.


================
Comment at: llvm/docs/CommandGuide/llvm-dwarfutil.rst:31-38
+            Removes pieces of debug information related to the discarded sections.
+            When the linker does garbage collection the abandoned debug info is left
+            behind. That abandoned debug info references address ranges using
+            tombstone value. Thus, when this option is specified, the tool removes
+            debug info which marked with the tombstone value. That cures
+            "overlapping address ranges" errors reported by :program:`llvm-dwarfdump`.
+
----------------
jhenderson wrote:
> avl wrote:
> > jhenderson wrote:
> > > jhenderson wrote:
> > > > I don't think you need the deleted sentence. Also, if it is enabled by default, how is it disabled, and why does the option actually need to exist?
> > > There's no need for such massive indentation. A couple of spaces is sufficient. Same applies throughout.
> > It might be disabled in this way:
> > 
> > ```
> > --do-garbage-collection=0
> > 
> > ```
> > 
> > So the option assumed to be used to disable the behavior or to enable it explicitly.
> This is one of those cl::opt oddities. It's basically undocumented too, so I don't think we should aim to support this approach if switching to tablegen style instead. I would instead add `--no-...` style options to explicitly disable things (there are some good examples of this.
If we have direct options then we might have following pattern(i will use cl::opt style):

in general make file:

```
OPTIONS=--do-garbage-collection=0

```
in custom make file:

```
dwarfutil $OPTIONS --do-garbage-collection=1

```
i.e. it is possible to override general option by a custom one. 

For the --no-style options we cannot do this:

```
OPTIONS=--no-garbage-collection
dwarfutil $OPTIONS ??????

```

Having possibility to override general set of options looks like a good thing?




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86539



More information about the llvm-commits mailing list