[lldb-dev] Figure our what global and static variables are accessed by what functions (at runtime)
Hi, I think that I can use the watchpoint command to set watchpoints on all global and static variables. Then run the lldb and parse the screen output to see what global and static variables are read/write-accessed by what functions. Is this a good strategy? Is there any other better ways to figure this kind of information out? -- Regards, Peng ___ lldb-dev mailing list lldb-dev@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
Re: [lldb-dev] Figure our what global and static variables are accessed by what functions (at runtime)
> Normally, a CPU only allows a very small (as in, ~4) watchpoints. So I > think this strategy is bound to fail. Thanks. I see there only 4 hardware watchpoints are supported on my machine. Is there a way to set software watchpoints? > If you really need dynamic information about this sort of thing (and not > just the static "does the function reference this variable" kind), then > I'd suggest trying to combine the static information (obtained either > through analysis of the debug info, by looking at the relocations in the > object files, or from the source code) Static information is also helpful here. Do you have specific information on what tools can help to provide such information? Thanks. > with some dynamic instrumentation > framework (the kinds used for coverage analysis) that can tell you > whether a particular line of code (instruction) got executed. Do you have specific tools to recommend? Thanks. -- Regards, Peng ___ lldb-dev mailing list lldb-dev@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
[lldb-dev] C library for investigate the stack and function arguments in a readable format.
Hi, As running in a debugger is very slow, I compile my C source code to LLVM .ll code and manually insert some commands in the .ll file to inspect things that I am interested in. But the intrinsics offered by the LLVM langref is rather limited. https://llvm.org/docs/LangRef.html I am not sure how to conveniently show the stack and function call arguments in a human-readable format. Is there a library that can compile and link to my .ll file so that the final executable will print the debugging info as needed and fast? (I'd guess there should be code from lldb that may be extracted and linked against my program for debugging.) Thanks. -- Regards, Peng ___ lldb-dev mailing list lldb-dev@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev