开发者

Receiving object from memory address on iphone

开发者 https://www.devze.com 2022-12-08 23:12 出处:网络
I\'m using \'malloc_error _break\' to break on double free error. The stack trace does not lead me to a specific line or object (only to the assembly code).

I'm using 'malloc_error _break' to break on double free error.

The stack trace does not lead me to a specific line or object (only to the assembly code).

What I can see is the object address:

...malloc: *** error for object 0xfa1340: double free

How can I find which object 开发者_如何学JAVAthis address represents? (0xfa1340)

(I tried to find it in the "ObjectAlloc" tool - but could not).

thanks!


You want to turn n zombies. What that will do is cause objects that have been dealloc'ed not to be free, but instead they will be swizzled into zombie objects which are still around, that way you can see the message receive.

You can turn it by setting a the environment variable NSZombieEnabled to YES. For info checkout this technote.


Let me know if there's an easier way.

The way I do this is: Product->Profile. This will open up Instruments. I pick then Zombies. Then when the app crashes, I click over Statistics, to chose Objects List and then click on the little arrow just next to the hex address. It will show you the object it represents.

0

精彩评论

暂无评论...
验证码 换一张
取 消