[Lldb-commits] [PATCH] D15437: Read macro info from .debug_macro section and use it for expression evaluation.

Siva Chandra via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 11 16:12:06 PST 2015

sivachandra added a comment.

The spec says that, for a given compile unit, the macro entries in the debug info will be in the order in which the compiler processes them. Hence, at line 5 in your example, all these are relevant:

  #define FOO puts <<< from foo.h
  #undef FOO <<< from foo.h
  #define FOO print <<< from main.c

I have actually verified that it works as expected; FOO resolves to printf and not puts at line 5.

You have tickled one aspect that I have ignored though. What if one is stopped in an inlined function/method defined in an included file? I think taking care of this is a fairly straightforward change over what I now have. I will need to bring back the line index in DebugMacroEntry and use it. Will send an update soon.


More information about the lldb-commits mailing list