Re: gdb won't break at malloc_printf() though I followed MallocDebug directions
Re: gdb won't break at malloc_printf() though I followed MallocDebug directions
- Subject: Re: gdb won't break at malloc_printf() though I followed MallocDebug directions
- From: Keith Ray <email@hidden>
- Date: Wed, 18 Aug 2004 09:39:58 -0700
Breaking on malloc_printf only works for me if I start gdb on the
command line running the application within gdb (not using the
MallocDebug application).
On Aug 17, 2004, at 11:42 PM, Alin Pilkington wrote:
Hi,
I can get 99% of the advertised functionality of MallocDebug to work
for me with one exception...hitting a breakpoint at malloc_printf()
when memory errors are annunciated. Here is my setup:
1) Using CodeWarrior to build a Mach-O, BSD C, MSL C++ Carbon
application...no problems with this step.
2) I can invoke my app from within MallocDebug without any problems and
MallocDebug does it's thing, finding leaks, overruns, double free's,
writes to freed memory, etc. Some of the messages go to the console as
stated in the documentation for MallocDebug.
So...since I am getting those console messages, I decided to invoke my
program from within gdb and I carefully read the documentation and do
the following steps (copied from the documentation)
% gdb myProgram.app
<gdb> set start-with-shell 0
<gdb> set env DYLD_INSERT_LIBRARIES /usr/lib/libMallocDebug.A.dylib
<gdb> set env DYLD_FORCE_FLAT_NAMESPACE 1
<gdb> run
^C
<gdb> b malloc_printf
<gdb> c
I do the ^C to stop the program after I think the dynamic library has
loaded and then set the breakpoint. The breakpoint goes in fine and
even gives me the memory address of the breakpoint...all seems cool.
When I continue after setting the breakpoint, I get all of the messages
from MallocDebug (this time in the terminal window instead of the
console) but I NEVER break!!!! I'm at a total loss and I have racked my
brain for answers. The fact that libMallocDebug.A.dylib is actually
loaded is obvious by the messages being printed to the terminal so
everything seem to work except the breakpoint.
FWIW, I'm using CodeWarrior 9.2, Xcode 1.5, OS X 10.3.5...
Anybody got any ideas?
Many thanks!!
Alin :)
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.
--
C. Keith Ray
<http://homepage.mac.com/keithray/blog/index.html>
<http://homepage.mac.com/keithray/xpminifaq.html>
<http://homepage.mac.com/keithray/resume2.html>
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.