• 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: Why doesn't NSMakePoint work from XCode/gdb?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why doesn't NSMakePoint work from XCode/gdb?


  • Subject: Re: Why doesn't NSMakePoint work from XCode/gdb?
  • From: Martin Wierschin <email@hidden>
  • Date: Tue, 25 Jan 2011 15:27:44 -0800

Replying to myself because I found the cause:

// 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.0f,9.0f)
$2 = {
  x = 0, 
  y = 2.25
}

If I switch from gcc 4.0 to gcc 4.2, it works just fine. So some kind of bug in 4.0. Unfortunately I'm stuck with the older version for now.

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?

Even with gcc 4.2 I can't call a method without a cast. Is this a valid feature request, or am I missing something?

~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

References: 
 >Why doesn't NSMakePoint work from XCode/gdb? (From: Martin Wierschin <email@hidden>)

  • Prev by Date: inline, optimize, and call stack visibility?
  • Next by Date: Re: inline, optimize, and call stack visibility?
  • Previous by thread: Why doesn't NSMakePoint work from XCode/gdb?
  • Next by thread: inline, optimize, and call stack visibility?
  • Index(es):
    • Date
    • Thread