Skip to content

lldb: Breakpoint on exceptions (equivalent of gdb's catch throw)

An answer to this question on Stack Overflow.

Question

I am trying to use lldb for c++ debugging and I want to halt if an exception is thrown, like gdb's catch throw, and I cannot find an equivalent in the lldb documentation.

Answer

You can enter

breakpoint set -E c++

into LLDB to do this.

But if you want to configure LLDB to always do this, open ~/.lldbinit and put the same line into that file.