Re: Embed Debug Break in Console App
Re: Embed Debug Break in Console App
- Subject: Re: Embed Debug Break in Console App
- From: Shantonu Sen <email@hidden>
- Date: Wed, 11 Oct 2006 12:33:31 -0700
And by Carbon, you mean "-framework CoreServices"
Shantonu
On Oct 11, 2006, at 12:13 PM, Brian Bergstrand wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Oct 11, 2006, at 1:31 PM, Chris Edgington wrote:
Sorry if this is documented somewhere - I've searched and cannot
find it. How can I embed a debug break in an OSX console .c app
that I'm debugging with gdb? I see in the "debugging magic"
technote something about setting the USERBREAK environment variable
and using SysBreak() or Debugger(). I tried including MacTypes.h -
but I still get a link error for SysBreak() or Debugger(). So - my
question is simple - how can I add a debug break in my console app?
Thanks,
-Chris
You are getting a link error, because those are Carbon routines and
you are probably not linking against the Carbon framework.
This macro should do what you want w/o the need for Carbon:
#ifdef __ppc__
#define trap() asm volatile("trap")
#elif __i386__
#define trap() asm volatile("int $3")
#else
#error unknown arch
#endif
HTH.
Brian Bergstrand
<http://www.bergstrand.org/brian/> PGP Key ID: 0xB6C7B6A2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
iD8DBQFFLUJGedHYW7bHtqIRArJkAJ4wDgeZqU2dZe52kR6ky/i5oIjeSwCgvDcB
A+RCHYOzxXhqtJHJdq1oxug=
=MGxQ
-----END PGP SIGNATURE-----
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@opendarwin.org
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden