Re: Where to look for the replacement for a deprecated API?
Re: Where to look for the replacement for a deprecated API?
- Subject: Re: Where to look for the replacement for a deprecated API?
- From: email@hidden
- Date: Mon, 09 Dec 2013 19:08:21 -0800
If you use raise, and you are running under the debugger, your program will stop in the main thread (that gets all the signals sent to the process in general) and you'll have to go hunting for the thread that actually raised the signal.
Better to use:
pthread_kill (pthread_self(), SIGINT)
then it will deliver the thread to the one that raised the exception, and the debugger will more usefully blame the stop on that thread.
Jim
On Dec 9, 2013, at 5:50 PM, Beinan Li <email@hidden> wrote:
> Thanks Jean-Daniel.
>
> If I opt to use the signal version, will I run into threading problems?
>
>
>
>
> On Mon, Dec 9, 2013 at 6:14 PM, Jean-Daniel Dupas <email@hidden> wrote:
>
> Le 9 déc. 2013 à 22:48, Beinan Li <email@hidden> a écrit :
>
> > On Mac OS X Mountain Lion, I start getting "deprecated API" warnings:
> >
> > warning: 'Debugger' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
> > 1 warning generated.
> >
> > Then the warning leads me to a dead-end clue that the symbol is defined in
> > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/MacTypes.h
> >
> > and marked by
> >
> > __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
> >
> > It never tells me where to look for its replacement.
>
> On Intel arch, you can do something like that
>
> #define Debugger() asm volatile ("int3;")
>
> Else as suggested by Jens, you can also use signal.
>
> #define Debugger() raise(SIGINT)
>
>
> -- Jean-Daniel
>
>
>
>
>
> _______________________________________________
> 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