Re: Seeking advice on debugging "real time" programs.
Re: Seeking advice on debugging "real time" programs.
- Subject: Re: Seeking advice on debugging "real time" programs.
- From: David Dunham <email@hidden>
- Date: Tue, 4 Apr 2006 08:07:18 -0700
On 3 Apr 2006, at 17:49, John Draper wrote:
You can find leaks by setting the MallocStackLogging environment
variable, but this does take time (and memory).
Ok, and If I do that through X-Code, can I just remove that
statement later? In My case, I would
go into the Executables --> myApp and click "Get Info" icon, pick
Arguments tab and enter in
MallocStackLogging 1 as illustrated in http://developer.apple.com/
technotes/tn2004/tn2124.html#SECINTRO
Figure 1.
Yes, of course you can remove it later. Though it's easiest to simply
uncheck it in that dialog, so you can turn it on again as needed. (In
my normal work, I leave it on so I can check for leaks as fancy takes
me, since the performance penalty isn't noticeable.)
Sure, set MallocStackLogging and then use leaks from the command
line. (You'd set a breakpoint at a spot when you expect memory to
be cleaned up -- in my case at the end of main().)
So - how do I do this? First I launch my program under X-Code,
and stop at my desired breakpoint?
Then, would I use the "leaks" shell command at that point? which
would display data not unlike some
of the sample I included below?
Right, something lke "leaks MyApp >leaks.txt"
Some of the guidelines also recommended I break on -[NSException
raise] and malloc_printf. Is it good
to put breakpoints at both, or one at a time? They didn't say in
the App Notes.
The former assumes you're Cocoa... I don't think either one is
relevant to leak-finding.
How do I generate this output (Below)... I had done this more then
a year ago,
but like a fool, I did not document what I did to generate this
output.
Process 3499: 8 leaks for 160 total leaked bytes.
Leak: 0x00569160 size=32 string 'James'
Leak: 0x00569140 size=32 instance of 'NSCFString' - 'James'
0xa01905f4 0x000107ad 0x00569160 0x00000011
0x00000020 0x00000020 0x0059b680 0x00000000
This looks like "leaks" but without a stack trace, so perhaps with a
release build.
Is this the "leaks" shell command? Where do I get the "pid", is
that
from the "ps -ax" command? "man leaks" also mentions I can use
the application name? Is that the same name as file with the .app
extension? or my executable target name?
It does partial matching, so I typically use the first several
characters rather than looking up process ID with "ps" or "top."
David Dunham
Voice/Fax: 206 783 7404 http://www.pensee.com/dunham/
Imagination is more important than knowledge. -- Albert Einstein
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden