[lldb-dev] DEBUG_PRINTF() macro
Jim Ingham via lldb-dev
lldb-dev at lists.llvm.org
Wed Mar 13 16:48:08 PDT 2019
Seems like there are two kinds of DEBUG_PRINTF.
One is in SymbolFileDWARF, DWARFASTParserClang.cpp etc, where that is inserting code into lldb. Those uses seem to me like they should be going to the dwarf log channel when verbose is on. Many of these places also acquire the dwarf log, so they could do this right. I have no objections to switching these over (I'll leave it to Greg and others who debug DWARF a lot to decide whether they can be removed altogether.)
The other flavor of DEBUG_PRINTF isn't used in lldb code, it is inserted into code that we are compiling and inserting into the target. There's a bunch of this in the ObjCLanguageRuntime, for instance. When we run the function we've inserted it prints info about the information it is gathering. Generally, the output is triggered by some log setting, which then sets an argument we pass to the function we're executing.
This is a really handy way to debug the work that functions we insert into the target are doing. We should not remove any of those uses. Presumably that wasn't what you were referring to, but just making sure they didn't get cut down in the same charge.
Jim
> On Mar 13, 2019, at 9:39 AM, Zachary Turner via lldb-dev <lldb-dev at lists.llvm.org> wrote:
>
> Apparently we have a macro called DEBUG_PRINTF() which, if you compile LLDB with a special pre-processor setting enabled, will cause certain messages to be printed to stdout while running LLDB.
>
> Does anyone use this? This seems like a kind of hacky alternative to tracepoints and/or pretty printers, and in some cases is causing otherwise dead code to be compiled into the binary, so there's some benefit to removing it.
>
> Is anyone opposed to removing all of this?
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
More information about the lldb-dev
mailing list