Re: Am I Being Debugged?
Re: Am I Being Debugged?
- Subject: Re: Am I Being Debugged?
- From: "A.M." <email@hidden>
- Date: Mon, 8 Oct 2007 22:40:10 -0400
On Oct 8, 2007, at 22:05 , Chris Espinosa wrote:
On Oct 8, 2007, at 4:12 PM, Michael Crawford wrote:
The ZooLib cross-platform application framework
(http://www.zoolib.org/) has a nice feature in which one can leave
assertions enabled whether or not a debugger is present. If there is
no debugger, assertion failures display an alert. If there is a
debugger, then asserts drop into the debugger.
This works with TMON, MacsBug and the CodeWarrior debugger, but not
yet with GDB. Is there an API that allows an application to know
that
it's being run under GDB?
When an app is being debugged by gdb, its parent process is gdb,
and the standard getppid() call should let you discover that.
I assume that only covers the case where gdb spawns the process and
doesn't attach later. Even if gdb is the parent, how does one use the
parent pid to identify gdb?
Cheers,
M
P.S. for everyone else: iTunes and QuickTime include nifty ptrace
kernel hacks to intentionally crash gdb: http://www.steike.com/code/
debugging-itunes-with-gdb/
_______________________________________________
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