How to tell LLDB debugger not to handle SIGBUS?

12,297

You can control how lldb intercepts/passes signals with the "process handle" command. For your case, you'd want to do

(lldb) pro hand -p true -s false SIGBUS
NAME        PASS   STOP   NOTIFY
==========  =====  =====  ======
SIGBUS      true   false  true 

now the signals will be passed to your process without lldb getting in the way. The "NOTIFY" field indicates whether lldb should print that the signal was received - the default is that it will be printed in the debugger console but that doesn't seem to be happening right now. But the signal is correctly passed along, which is the important bit.

Share:
12,297

Related videos on Youtube

Ergwun
Author by

Ergwun

Professional software developer. Programming enthusiast.

Updated on October 20, 2022

Comments

  • Ergwun
    Ergwun over 1 year

    I'm embedding MonoTouch in an Xcode project, and want to stop LLDB debugger from handling SIGBUS signals, since they are used by the mono runtime. How can I do that?

  • ed22
    ed22 almost 9 years
    Is there any way to set this in XCode?
  • uliwitness
    uliwitness over 8 years
    Add a breakpoint e.g. on main() and then in its breakpoint action add an LLDB command with this line in it, then check the "continue after breakpoint" checkbox.
  • user239546
    user239546 over 8 years
    To do this automatically in Xcode, add the command to ~/.lldbinit-Xcode. If you want this to apply even when using lldb from the command line, add the same to ~/.lldbinit
  • Jacob Wallström
    Jacob Wallström over 4 years
    It doesn't work to add it to ~/.lldbinit because it gives the error error: No current target; cannot handle signals until you have a valid target and process.
  • Artyom Gevorgyan
    Artyom Gevorgyan over 3 years
    I have a similar problem when debugging swiftc executable with lldb. On hitting some breakpoints, even though I have applied the suggested change to how lldb handles SIGCHLD (not SIGBUS), it keeps dying. What can I do? Maybe I should file a bug?
  • Artyom Gevorgyan
    Artyom Gevorgyan over 3 years
    Process X stopped and restarted: thread 1 received signal: SIGCHLD This is what I keep getting instead of a stop at breakpoint.
  • Ben Voigt
    Ben Voigt almost 3 years
    @ArtyomGevorgyan: Your program died. The debugger received SIGCHLD. Setting the debugger to break when your program receives SIGCHLD doesn't help because your program didn't receive SIGCHLD.