[Lldb-commits] [PATCH] D119963: [LLDB] Dump valid ranges of variables

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 16 14:08:48 PST 2022

jingham added a comment.

In D119963#3327472 <https://reviews.llvm.org/D119963#3327472>, @zequanwu wrote:

> In D119963#3327139 <https://reviews.llvm.org/D119963#3327139>, @jingham wrote:
>> It's really useful to be able to see these variable ranges, so the feature seems good to me, but I think the valid range output should be governed by another flag, like --show-variable-ranges.  In optimized code, there can be a whole lot of ranges for each variable, so this could get really noisy and make the whole output hard to look at, so it would be good to have a way to turn it off.
> Using a flag to control it seems good to me.
>> Unfortunately `-v` doesn't work for that since the non `-v` version isn't so useful.
> I don't quite understand what you mean here. I suppose we want a flag `--show-variable-ranges` to have effect only when `-v` is given in `image lookup -v -a ...`. Is this what you mean?

I was addressing another unasked question: It seemed odd to say "add another flag to reduce the amount of output for something that is only printed when the user asks for verbose output".  So I was trying to explain why that made sense.  The reason being that when we made the "image lookup" command, the non-verbose version wasn't actually terribly useful, but the verbose version was.  So pretty much everybody uses the `-v` flag when the command is used.  The other option would be to do the horrible thing some tools do and have multiple -v's meaning more and more verbose.  You could do it that way too (the option parser can count the number of -v's it has seen).  But I think it's a lot better to have an option to dial up the specific extra info you want in this case.

But you are right, we don't print the variable information at all without -v, so while it's odd to have --show-variable-ranges only take effect when -v is supplied, I think that's the reasonable way to do it.

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list