[Lldb-commits] [PATCH] D72597: [lldb][DWARF] Added support for new forms in DWARFv5 macro.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 14 04:30:01 PST 2020


labath added a comment.

In D72597#1819185 <https://reviews.llvm.org/D72597#1819185>, @SouraVX wrote:

> In D72597#1819164 <https://reviews.llvm.org/D72597#1819164>, @labath wrote:
>
> > I have a high-level question/comment. Are you planning to implement debug_macro reading in llvm-dwarfdump? Even if you aren't, I am expecting that you will be asked to do that as a part of testing for your debug_macro generation patch...
>
>
> Hi Pavel, I've mostly completed debug_macro generation[clang/llvm] and dumping it using llvm-dwarfdump. I'll soon file a review for that also. Maybe we can address this concern while reviewing that. Till that, I think it would be nice to have minimum support for macros.


I don't think this issue is particularly urgent -- a consumer is not very useful if you don't have a producer which can produce that data. And reusing the parser in llvm would allow us to largely drop the testing part of this discussion -- if the nitty-gritty encoding details are tested in llvm, then here we just need to make sure the integration works, and we already mostly have a test for that (TestMacros.py).



================
Comment at: lldb/test/Shell/Commands/dwarf5-macro.test:1
+# REQUIRES: x86
+# This test checks lldb macro expansion when macro section
----------------
SouraVX wrote:
> aprantl wrote:
> > shafik wrote:
> > > Is there a reason why we would only want to test this feature on x86?
> > Presumably because the input is X86 assembly. That said, would it be possible to test the feature without constructing a process, so we *can* test it everywhere?
> I tried, other ways also. Seems like this is bare minimum, We need to run the program to be able to expand macros. analogous behavior with GDB also.
> If you've some better way in mind to test this. or where to put this. Please share.
It wouldn't be unreasonable to add some command to query active macro definitions at a given point in the program (similar to gdb's `info macros` command). In lldb, the best place to plug this into might be the "image lookup" command -- right now "image lookup --verbose --file a.cpp --line 10" will give you the function containing that line as well as all variables which are active at that point. It seems natural to also list the active macros too. 

However, that would most likely require adding a new "macros" field to the SymbolContext class, which is a concept used throughout lldb, and so doing it may be fairly tricky and it may be better to create a separate command for this at first ("image dump macros"?)...


(also note that in the current form, this test will not only require x86, but also a linux (or at least elf) system)


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

https://reviews.llvm.org/D72597





More information about the lldb-commits mailing list