You want to set up a stop-hook.

See “help target stop-hook”, specifically “help target stop-hook add”.

target stop-hook add -o “register read pc”
will read the pc each time the target stops.

From: lldb-dev <lldb-dev-boun...@lists.llvm.org> On Behalf Of Vangelis 
Tsiatsianas via lldb-dev
Sent: Friday, June 28, 2019 6:16 AM
To: via lldb-dev <lldb-dev@lists.llvm.org>
Cc: Vangelis Tsiatsianas <vangeli...@icloud.com>
Subject: [EXT] [lldb-dev] Enabling single-step mode and acting on each executed 
instruction

Hello,

I would like to set the target in single-step mode and perform an action right 
after each instruction is executed. Notably, it is crucial to do so 
transparently, i.e. without interfering with user breakpoints, watchpoints, 
stepping etc..

Could you provide me with some guidance on how to accomplish it? 🙂

I have found the target.process.thread.trace-thread option and the relevant 
classes (ThreadPlanTracer and ThreadPlanAssemblyTracer), which although seem to 
not work and also crash the debugger when enabled.

Thank you very much, in advance.


― Vangelis

_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

Reply via email to