5

I keep a future-break objc_exception_throw in my .gdbinit (because I generally debug in AppCode, which doesn't yet have a GUI means of configuring breaks on objective-c exceptions).

Is there an equivalent for LLDB?

Cris
  • 1,939
  • 3
  • 23
  • 37
  • 1
    For anyone else interested in this for AppCode, note that the [114.179 EAP build](http://confluence.jetbrains.net/display/OBJC/AppCode+EAP) has built-in support for exception breakpoints. – Cris Feb 21 '12 at 23:01

2 Answers2

2

If you create a ".lldbinit" file in the directory from which you are debugging and then specify the file on the command line:

% cat ./.lldbinit
breakpoint set --name objc_exception_throw
% lldb /bin/ls
(lldb) breakpoint list --full
Current breakpoints:
1: name = 'objc_exception_throw', locations = 0 (pending)

This should help you to work around the issue for now.

The ".lldbinit" file ordering is:

  • check for app specific ~/.lldbinit-lldb file (where "lldb" is the name of the application that is running the LLDB.framework, you can add a ~/.lldbinit-Xcode for Xcode only command) if available
  • if no app specific file from step 1, then source "~/.lldbinit" if it exists
  • load the file and process the options from the "lldb" command line command
  • parse the local "./.lldbinit" file from the current working directory.
    • thanks. I haven't had any luck so far getting my ~/.lldbinit read when using lldb in AppCode. It's fine from the command line though, which is good enough for now. – Cris Feb 18 '12 at 02:10
    0

    You can't currently do that with lldb. Until lldb has set up a Target (which will happen when you specify a binary), you can't add a breakpoint. This is something that will need to be added in the future.