Re: Problem with carbon app and debugger
Re: Problem with carbon app and debugger
- Subject: Re: Problem with carbon app and debugger
- From: Jean-Daniel Dupas <email@hidden>
- Date: Tue, 9 Dec 2008 14:22:00 +0100
Le 9 déc. 08 à 14:10, Eric Gorouben a écrit :
Hi,
after tracing, it looks like a fopen failed.
The path is relative, unix format (simply "folder/myFile.dat",
"folder" containing "myFile.dat" as expected and being in the same
directory as the app)
fopen works when I'm in the debugger, and sends back a null pointer
when I open the app directly.
I suppose that in the debugger, the base address is the bundle
address, and when executing directly, it's the binary executable
address.
I solved the problem by providing absolute paths.
Is this behavior normal?
Thanks
Yes, you should not make any assumption on the current working
directory, and so, you should never use relative path.
The Xcode debugger use the working directory set in your executable
settings (by default, build dir), and IIRC, an application launched by
LaunchServices has '/' as working directory.
You should use CFBundle API to resolve the path at runtime.
_______________________________________________
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