0

I have instrumented a target program with LLVM pass. The instrumented code fragment is some function implemented in a library. I have the source code of this library. Now I want to debug the program and see what the instrumented function does step by step. What should I do?

user1388672
  • 147
  • 1
  • 1
  • 9
  • Are you asking [how to singlestep assembly](https://stackoverflow.com/q/40445099) in gdb or some other debugger? – arnt May 26 '22 at 15:03
  • Yes, arnt. I want to singlestep the source code in gdb or in an IDE such as CLion. Particulary, I want to singlestep the source code of the instrumented part. How can I achieve this? – user1388672 May 27 '22 at 00:30
  • There's nothing peculiar about it. You can just generate IR in the same way as for regular source code and make the debug info point to the right file and line. In the debugger, this will look rather line an inlined function call: Some instructions from file a line 123, then some from file b line 42, then some more instructions from a line 123. – arnt May 27 '22 at 07:00
  • Thanks, arnt. I make it. Just add debug info when compiling instrumented code in library. Then nothing is special. – user1388672 May 29 '22 at 09:07

0 Answers0