Re: Trying to use MallocDebug
Re: Trying to use MallocDebug
- Subject: Re: Trying to use MallocDebug
- From: Mark Lentczner <email@hidden>
- Date: Wed, 31 Mar 2004 08:15:08 -0800
On Mar 31, 2004, at 12:11 AM, Rich Warren wrote:
I'm trying to use MallocDebug on a c++ command line tool. The program
needs to read from stdin, so I thought I'd start it in a terminal
window and just attach MallocDebug. Unfortunately, I apparently must
have libMallocDebug linked in.
I do exactly this all the time. In Xcode simply choose Debug > Launch
using Performance Tool > MallocDebug! MallocDebug will start with
everything set to run (even the command line args from your executable
set up in Xcode are there!). Just hit the Launch button in
MallocDebug. Now (here's the only tricky part), for a command line
tool, switch back to Xcode and choose Debug > Show Run Log to get your
stdin/stdout/stderr console.
Done, no fuss, no muss, and no linker warnings!
- Mark
Okay, if you WANT the linker warnings, or if you HAVE to lanuch your
command line tool by hand, then you could do this (which is what I did
prior to Xcode):
1) Add libMallocDebug.a to the project: Project > Add Files..., then
navigate to and choose /usr/lib/libMallocDebug.a. You can move this
into the External Frameworks and Libraries group if you wish, or
anywhere else you'd like.
2) Be sure the newly added lib is enabled for your target: Drag the
libMallocDebug.a file from the Groups & Files list onto your target (in
the same list).
Now, when you link, you will see duplicate warnings - just ignore them.
I haven't found anyway to get rid of them.
Mark Lentczner
email@hidden
http://www.wheatfarm.org/
_______________________________________________
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.