Why doesn't NSMakePoint work from XCode/gdb?
Why doesn't NSMakePoint work from XCode/gdb?
- Subject: Why doesn't NSMakePoint work from XCode/gdb?
- From: Martin Wierschin <email@hidden>
- Date: Tue, 25 Jan 2011 12:51:30 -0800
When I have a gdb prompt in XCode, I'd like to do:
(gdb) p NSMakePoint(4,9) No symbol "NSMakePoint" in current context.
Not convenient, but it makes some sense to me, as NSMakePoint is defined to always inline. Okay, so I made my own dumb wrapper function for the sole purpose of calling it from gdb:
// in .h extern NSPoint NTMakePoint( float x, float y );
// in .m NSPoint NTMakePoint( float x, float y ) { NSPoint ret; ret.x = x; ret.y = y; return ret; }
But it still doesn't work in gdb.. I get weird results:
(gdb) p NTMakePoint(4,9) $1 = { x = 0, y = 2.25 }
(gdb) p NTMakePoint(4.0f,9.0f) $2 = { x = 0, y = 2.25 }
What's going on here?
If it matters, I'm using XCode 3.2.5, but this has always been an annoyance. Oh, and while I'm at it, I'd like to ask why I need to cast return values for objc messages, eg:
(gdb) p [someArray objectAtIndex:0] Unable to call function "objc_msgSend" at 0x928c7ec0: no return type information available.
Why can't gdb use runtime introspection on the message receiver to determine the return type for the selector?
~Martin
|
_______________________________________________
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