EXC_BAD_INSTRUCTION in LSOpenFromRefSpec (code snippet)
EXC_BAD_INSTRUCTION in LSOpenFromRefSpec (code snippet)
- Subject: EXC_BAD_INSTRUCTION in LSOpenFromRefSpec (code snippet)
- From: raju raju <email@hidden>
- Date: Sun, 22 Jul 2007 07:03:37 +0100 (BST)
Hi All,
I am getting problem with the following function call LSOpenFromRefSpec.This works fine for PowerPc but when the same code is run with gdb under Intel based mac (processor is i386) I get Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand.
0x9082c73b in _CFReadBytesFromFile ().
I tried the settings of -mpreferred-stack-boundary in Other C and C++ flags of the Xcode projects but the result remained same.Am I doing something silly?My imac version is 10.4.8.
Below is the code snippet for the FSRef part
FSRef appRef; OSStatus err = ::FSPathMakeRef((const UInt8*)argv0, &appRef, NULL);
if (err != noErr) {
TRACE(" FSPathMakeRef failed with error %d\n", err);
return;
}
LSLaunchFSRefSpec launchSpec = {0};
launchSpec.appRef = &appRef;
launchSpec.numDocs = 0;
launchSpec.itemRefs = NULL;
launchSpec.passThruParams = NULL;
launchSpec.launchFlags = kLSLaunchDefaults;
launchSpec.asyncRefCon = NULL;
err = ::LSOpenFromRefSpec(&launchSpec, NULL);
I get the EXC_BAD_INSTRUCTION in the above function.But this works properly in case of PowerPC.
Also with gdb the value of launchSpec is given by
p launchSpec
$4 = {
appRef = 0xbffff188,
numDocs = 0,
itemRefs = 0x0,
passThruParams = 0x0,
launchFlags = 1,
asyncRefCon = 0x0
Any help would be much appreciated.
Thanks
-A
---------------------------------
Once upon a time there was 1 GB storage in your inbox. Click here for happy ending.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden