Re: How can I break into debugger?
Re: How can I break into debugger?
- Subject: Re: How can I break into debugger?
- From: Jim Ingham <email@hidden>
- Date: Fri, 9 Sep 2005 14:47:49 -0700
On Sep 9, 2005, at 12:26 PM, Yves Poissant wrote:
What is the function call or instruction that I should use to break
into the debugger from inside the code execution (like on an Intel
CPU, the assembly instruction "int 3")?
Is there some sort of assert function available in OSX? Where the
passed instruction result is tested and breaks into the debugger if
it fails?
The easiest way to do this is:
pthread_kill (pthread_self (), SIGINT);
That will raise a sigint, which will break into the debugger.
That's how the Carbon functions Debugger and DebugStr are
implemented. You can use this to build an assert function pretty
simply.
You can also use the standard trap instruction, but then you have to
do some work in the debugger if you want to continue on past the
trap. gdb will just eat the SIGINT for you by default.
Also is there any available memory management library that will
guard from spills and leaks and would generate such a break when
something odd happens with a memory bloc?
$ man libgmalloc
Jim
Yves Poissant
_______________________________________________
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
_______________________________________________
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