[lldb-dev] Programmatically set breakpoint in C++ code

Greg Clayton gclayton at apple.com
Mon Mar 17 10:09:36 PDT 2014


Of course this only works for x86 32 and 64 bit targets so you will need to #ifdef it out for other architectures. 

On Mar 15, 2014, at 3:21 PM, Richard Mitton <richard at codersnotes.com> wrote:

>     __asm volatile ("int3");
> 
> Should work on any debugger, not just lldb.
> Also on Windows, you should generally use __debugbreak() instead of DebugBreak, as the latter is a kernel-level call, whereas you generally want a user-level breakpoint. The difference is that the user breakpoint gives a nicer callstack.
> 
> Richard Mitton
> 
> richard at codersnotes.com
> On 03/15/2014 05:59 AM, Deepankar Sharma wrote:
>> Is there a way that I can programmatically hit a breakpoint in my C++ code. I am looking for the lldb equivalent of the DebugBreak function on windows.
>> 
>> 
>> _______________________________________________
>> lldb-dev mailing list
>> 
>> lldb-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev




More information about the lldb-dev mailing list