Re: Breaking into debugger with key press while running GUI app
Re: Breaking into debugger with key press while running GUI app
- Subject: Re: Breaking into debugger with key press while running GUI app
- From: Chris Espinosa <email@hidden>
- Date: Fri, 31 Mar 2006 08:51:25 -0800
On Mar 31, 2006, at 7:10 AM, Sean McBride wrote:
On 2006-03-30 20:14, Chris Espinosa said:
Xcode's debugger has the 'pause' button in its toolbar, which is
great.
Is there a way to do the same thing with a keypress? Like in the
old
days pressing the programmer's switch to break into Macsbug.
It would be handy in situations like debugging someone else's
code and
needing to break into the debugger without moving your app into the
background.
On Mac OS X it's not quite as straightforward as a hardware NMI. You
don't want to interrupt the whole machine, you just want to send a
signal to a particular process;
Correct. I am familiar with setting up boot-args to get an NMI, but
that's not what I want here.
how do you tell it which process?
How does Xcode tell which process to apply the pause button to? :) I
suppose one might be debugging more than one app at a time with Xcode,
but generally not.
The pause button is on the toolbar of the debugger window, and the
debugger window is associated with a single process launch. The Pause
menu item is tied to the one Pause button on the one Debugger window.
(I suppose you could write some global doohickey that sends a SIGINT
to the frontmost process.
Can one use AppleScript to tell Xcode to "pause" the app its
debugging?
Then I could write a global doohickey that runs that script.
If there isn't a Pause applescript command (and I bet there isn't),
you can always use UI Scripting to press the Pause button. But that
would mean bringing Xcode to the front, and probably wouldn't happen
during your StillDown() loop as described below.
But in general you should just either
Command-Option-P (pause) when Xcode is frontmost, or build a "Debug"
menu item into your app that calls Debugger() when you want it to.
I'm debugging some old code that I don't know that does StillDown()
loops and I want to catch where those loops are, so I'm looking for a
way to break into the debugger while my mouse is down so I can find
the
StillDown loop. I guess I could debug remotely, but I was hoping I
could somehow rig an F key to do it...
I don't know how much event processing you app is going to do during
a StillDown loop. It certainly won't process high-level Apple
events, so AppleScript is out. Something wired into the Fkey
mechanism, that'll be processed at some IOKit level and not passed to
your app, seems like the best bet. Remember, all it has to do is kill
(yourPID, SIGNIT); see signals.h
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden