[PATCH] Ensure debug info for two calls to the same function from the same location are not merged

Frédéric Riss friss at apple.com
Wed Dec 3 15:34:25 PST 2014


> On Dec 3, 2014, at 2:33 PM, Eric Christopher <echristo at gmail.com> wrote:
> 
> 
> 
> 
> (Although if the debuggers could understand it, I think having debug info
> for macros would be pretty cool.)
> 
> Yep, could be rather handy. I think the full generality of that feature would probably look something like "multiple source locations" (maybe some kind of source location stack) - which could probably also be used to provide multiple levels of debug info - eg: allowing source location information for asm, LLVM IR, C(++) source, macro expansions, and maybe like a protobuf file or something - so you could step up & down through the abstractions.
> 
> There's some support for macro locations in basic dwarf, source line of where the macros are defined, etc. It's not great and figuring out how to do better source line mapping might be fun though.

There is pretty extensive support for describing the macros themselves (and their scoping), but not for describing where they got expanded. With this information, the debugger is able to understand macros in user-provided expressions. GCC+GDB supports that pretty well and it is really nice when you work on a macro-heavy codebase.

We could use special attributes on variables, lexical_scopes,  inlined_subroutines,… to indicate they originate from a macro expansion. It would be cool to have to have those showing up as fake frames in a backtrace (but certainly a lot of work for a small gain).

Fred
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141203/5e6bf0ba/attachment.html>


More information about the llvm-commits mailing list