• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Am I Being Debugged?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re[2]: Am I Being Debugged?
      • From: Peter Mulholland <email@hidden>
References: 
 >Am I Being Debugged? (From: "Michael Crawford" <email@hidden>)
 >Re: Am I Being Debugged? (From: Chris Espinosa <email@hidden>)

  • Prev by Date: backtrace() alternative?
  • Next by Date: Re: backtrace() alternative?
  • Previous by thread: Re: Am I Being Debugged?
  • Next by thread: Re[2]: Am I Being Debugged?
  • Index(es):
    • Date
    • Thread