uint32_t reserved2; // must be zero
} BabelAESelInfo;
+ Log *log = lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_HOST);
char file_path[PATH_MAX];
file_spec.GetPath(file_path, PATH_MAX);
CFCString file_cfstr (file_path, kCFStringEncodingUTF8);
file_cfstr.get(),
kCFURLPOSIXPathStyle,
false));
+
+ if (log)
+ log->Printf("Sending source file: \"%s\" and line: %d to external editor.\n", file_path, line_no);
OSStatus error;
BabelAESelInfo file_and_line_info =
if (error != noErr)
{
+ if (log)
+ log->Printf("Error creating AEDesc: %d.\n", error);
return false;
}
if (external_editor != NULL)
{
bool calculate_fsref = true;
+ if (log)
+ log->Printf("Looking for external editor \"%s\".\n", external_editor);
+
if (app_name.empty() || strcmp (app_name.c_str(), external_editor) != 0)
{
calculate_fsref = true;
if (error == noErr)
app_name.assign (external_editor);
else
+ {
+ if (log)
+ log->Printf("Could not find External Editor application, error: %d.\n", error);
return false;
+ }
}
if (error != noErr)
{
+ if (log)
+ log->Printf("LSOpenURLsWithRole failed, error: %d.\n", error);
+
return false;
}
which_process.processName = ap_name;
error = ::GetProcessInformation (&psn, &which_process);
- bool using_xcode = strncmp((char *) ap_name+1, "Xcode", 5) == 0;
+ bool using_xcode;
+ if (error != noErr)
+ {
+ if (log)
+ log->Printf("GetProcessInformation failed, error: %d.\n", error);
+ using_xcode = false;
+ }
+ else
+ using_xcode = strncmp((char *) ap_name+1, "Xcode", (int) ap_name[0]) == 0;
// Xcode doesn't obey the line number in the Open Apple Event. So I have to send
// it an AppleScript to focus on the right line.
if (osa_component == NULL)
{
+ if (log)
+ log->Printf("Could not get default AppleScript component.\n");
return false;
}
::free (as_str);
if (error != noErr)
+ {
+ if (log)
+ log->Printf("Failed to create AEDesc for Xcode AppleEvent: %d.\n", error);
return false;
+ }
OSAID ret_OSAID;
error = ::OSACompileExecute (osa_component,
::AEDisposeDesc (&as_desc);
if (error != noErr)
+ {
+ if (log)
+ log->Printf("Sending AppleEvent to Xcode failed, error: %d.\n", error);
return false;
+ }
}
return true;
else if (strcasestr(arg, "temp") == arg) flag_bits |= LIBLLDB_LOG_TEMPORARY;
else if (strcasestr(arg, "comm") == arg) flag_bits |= LIBLLDB_LOG_COMMUNICATION;
else if (strcasestr(arg, "conn") == arg) flag_bits |= LIBLLDB_LOG_CONNECTION;
+ else if (strcasestr(arg, "host") == arg) flag_bits |= LIBLLDB_LOG_HOST;
else
{
feedback_strm->Printf("error: unrecognized log category '%s'\n", arg);