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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 04:09:02 PDT 2022


jhenderson 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`.
+
----------------
avl wrote:
> 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?
> 
> 
I think you misunderstand: you can have both the positive and negative option, with a last one wins approach. There are many examples of this, e.g. in LLD. See https://github.com/llvm/llvm-project/blob/f1d8e46258c6a08ca1a375dc9670dd5581d6cf65/llvm/lib/Option/ArgList.cpp#L73 and references to that.


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