Permanently configuring LLDB (in Xcode 4.3.2) not to stop on signals
In case anyone else ever has this question, I finally solved it by adding a breakpoint in NSApplicationMain()
(for plain C programs, main()
would of course work as well).
I set the breakpoint action to process handle SIGUSR2 -n true -p true -s false
, and enabled the "Automatically continue after evaluating" option.
If anyone has a more elegant solution, I'd be happy to hear.
Related videos on Youtube
puzzle
Updated on June 02, 2022Comments
-
puzzle almost 2 years
I'm trying to get LLDB (running in Xcode 4.3.2 with an OS X application) to not stop on certain signals. If I enter
process handle SIGUSR2 -n true -p true -s false
on the debugging console it works fine and LLDB no longer stops on SIGUSR2.
However, if I put
command process handle SIGUSR2 -n true -p true -s false
into ~/.lldbinit it seems to be ignored. Other commands in this file (e.g. alias) work fine.
How can I make LLDB never stop on certain signals?
-
blueberryfields about 12 yearsI don't think that what you want to do is doable, without an explicit The process is a run-time concept. Maybe there's a useful setting under "settings list" that you can set?
-
puzzle about 12 yearsThanks, that explains why adding the command to ~/.lldbinit did not work :)
-
-
user500 over 10 yearsJust in case... Don't forget to change symbol to
UIApplicationMain
for iOS. -
n0minal over 10 yearsItworks for me. but after my application freezes. Would this be the true behavior?
-
puzzle over 10 yearsTelling lldb to ignore certain signals should not cause an application to freeze. Where does your application freeze and how?
-
brunobowden over 9 yearsFor Swift use "UIApplicationMain"
-
Laurent Zubiaur about 9 yearsYou might also just ignore the signal with
signal(SIGPIPE, SIG_IGN)
-
itMaxence about 6 yearsWether you ignore or not the signal will not prevent xcode to stop :( (and btw you should better use sigaction() to ignore a signal)
-
itMaxence about 6 years@puzzle could you explain or let a link about the
process handle [signal] -n true -p true -s false
line? Just for the sake of understanding what I'm copy/pasting :) -
puzzle about 6 years@itMaxence If you enter
help process handle
in your lldb console, you'll get an explanation of all the possible arguments. -
shallowThought over 2 yearsIn Xcode 13, having a commandline tool as target, setting this breakpoint in ìnt main(...) ...`, I get: "error: invalid target, create a target using the 'target create' command". any hints any one?