问题
I am trying to debug my program using NSZombie. The debugger did return me the address of the instance with the issue, however I am not sure where to obtain the pid which is required to run the command 'shell malloc_history
Can anyone advise me on what is the correct pid to use in this case? I tried 3298 and 3298:707 and they both didnt work. Appreciate any help here.
Zhen Hoe
2011-05-19 16:57:05.779 CarParkDemon[3298:707] in table view cellforRow Method3
2011-05-19 16:57:05.781 CarParkDemon[3298:707] *** -[CFString retain]: message sent to deallocated instance 0x5d82930
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
(gdb) shell malloc_history 3298:707 0x5d82930
malloc_history cannot examine process 3298 because the process does not exist.
回答1:
malloc_history works only in simulator. Your logs say that you are doing it on device.
来源:https://stackoverflow.com/questions/6066699/objective-c-where-to-find-process-id-in-gdb