Using the gdb info malloc command in xcode (iphone dev)

I play with gdb in xcode debugging iphone application.

Presumably I should use the following command:

info malloc <0xaddress>

see http://www.friday.com/bbum/2010/01/10/using-malloc-to-debug-memory-misuse-in-cocoa/  and the strange GDB error cannot be tracked

I have env vars MallocStackLoggingNoCompact = 1 and NSZombieEnabled = YES set (via an executable in xcode).

However, I get the following:

2010-10-03 21:29:01.366 memleaktest[10881:307] *** -[one release]: message sent to deallocated instance 0x1646b0
(gdb) info malloc 0x1646b0
Undefined info command: "malloc 0x1646b0".  Try "help info".

What am I missing to run this command? (xcode 3.2.4 and iphone SDK 4.1)

+3
source share
3 answers

It turns out that you can only info malloc during debugging in the simulator, and not on the device.

+3
  • Xcode Run → Enable Guard Malloc.
  • MallocStackLoggingNoCompact YES ( )

, , :

malloc: stack logs being written into /tmp/stack-logs.xxxx.MyApp.xxxxxx.index

:

(gdb) info malloc 0x1646b0
+1

Try the same tough problem, is any workable method found? Hard this failure occurs only in the device, and not in the simulator.

0
source

Source: https://habr.com/ru/post/1767794/


All Articles