View Memory Of - Not Working Right?

In Xcode 7.2. Trying to use "View Memory Of" and it seems to be not working quite right. Is this feature broken?


If I "View Memory Of _bytes" of an NSData object, it tries to tell me that the memory location is "0x0". But if I get that same memory pointer by making a new expression using the accessor method (remember, same result, same memory location), I get the legitimate memory dump.


For example


View Memory Of - *_bytes or *(0x7fc7a103e000)

https://www.evernote.com/l/ACDBGun0yxFOWKI423c3e3QgVUks5vOlC3EB/image.png

Results in a view of memory 0x0. Completely useless and wrong.


So I create a custom expression for the same variable and then View Memory Of *theResult.bytes, or *(0x7fc7a103e000)

https://www.evernote.com/l/ACBm6RPZRmJD_6nYadVRdUBSlemEVWYyys4B/image.png

and that shows me exactly what the former "View Memory of" should have shown me, the memory at the location specified.


So thinking, well, maybe it is because it says (void*) and someone thought that showing "void" would be "accurate" to show 0x0 (which is after all "void" of any useful information). Lets try and make a custom type and debugger-type-cast it to something not void?

So I tell Xcode to view as a "Custom Type..." (debugger typecasting of sorts)

https://www.evernote.com/l/ACCC9Gwhgh1Lb41JvKqR-Cxbh2I6iL3UwtsB/image.png

and in the "Custom Type" it offers:

(void*)theResult->_bytes

https://www.evernote.com/l/ACAlyVYDjY5Gw4WUertgpRvDAdy5OU9ph3EB/image.png


and I think "ok, lets start with a known quantity, something that Xcode likes... and I press "Done"...


But wait! Xcode call's its own offering an error!

https://www.evernote.com/l/ACB6m0pylXlB6LUEev4rTXa04nPjsgVNjBIB/image.png


XCode produced an invalid expression... Hmm...

Am I looking at this incorrectly or is the "View Memory Of" all botched up in Xcode? It seems sort of basic And in fact, the more I try "View Memory Of", the more I notice it does not work or produce any useful results in most cases... Sometimes it points to inexplicable garbage, other times 0x0.

Replies

(there is suppose to be a PNG below, it shows when I edit but not when I browse, sorry...)

That is, alas, a limitation of the current forums (r. 22028729). I don’t think anyone is going to be able to make head or tails of your post without seeing the images, so here’s what I recommend you do:

  1. put the images on an image hosting service

  2. edit your post to include URLs for those images

The URLs will require moderator approval, but that’s not a problem for screen shots (although it will delay things a little).

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

DTS will close for the winter holidays at the end of business on Wed, 23 Dec 2015 and re-open on Mon, 4 Jan 2016.

I thought it was my Safari malfunctioning. Links, good call, doing. (Mike?)