Always allow debugging a team, even if it wasn't possible to get its

executable path. It seems, gdb doesn't produce very helpful stack traces
then, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21915 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2007-08-12 23:49:38 +00:00
parent 5c806b5dbc
commit ac7fc18b09
+9 -17
View File
@@ -441,7 +441,7 @@ TeamDebugHandler::_EnterDebugger()
// prepare the argument vector // prepare the argument vector
char teamString[32]; char teamString[32];
snprintf(teamString, sizeof(teamString), "%ld", fTeam); snprintf(teamString, sizeof(teamString), "--pid=%ld", fTeam);
const char *terminal = (debugInConsoled ? kConsoledPath : kTerminalPath); const char *terminal = (debugInConsoled ? kConsoledPath : kTerminalPath);
@@ -459,8 +459,9 @@ TeamDebugHandler::_EnterDebugger()
} }
argv[argc++] = kGDBPath; argv[argc++] = kGDBPath;
argv[argc++] = fExecutablePath;
argv[argc++] = teamString; argv[argc++] = teamString;
if (strlen(fExecutablePath) > 0)
argv[argc++] = fExecutablePath;
argv[argc] = NULL; argv[argc] = NULL;
// start the terminal // start the terminal
@@ -553,10 +554,9 @@ TeamDebugHandler::_HandleMessage(DebugMessage *message)
// ask the user whether to debug or kill the team // ask the user whether to debug or kill the team
if (_IsGUIServer()) { if (_IsGUIServer()) {
// App server, input server, or registrar. We always debug those. // App server, input server, or registrar. We always debug those.
kill = !(strlen(fExecutablePath) > 0); kill = false;
} else if (USE_GUI && _AreGUIServersAlive() && _InitGUI() == B_OK) { } else if (USE_GUI && _AreGUIServersAlive() && _InitGUI() == B_OK) {
// normal app // normal app -- tell the user
_NotifyAppServer(fTeam); _NotifyAppServer(fTeam);
char buffer[1024]; char buffer[1024];
@@ -564,18 +564,10 @@ TeamDebugHandler::_HandleMessage(DebugMessage *message)
"has encountered an error which prevents it from continuing. Haiku " "has encountered an error which prevents it from continuing. Haiku "
"will terminate the application and clean up.", fTeamInfo.args); "will terminate the application and clean up.", fTeamInfo.args);
if (strlen(fExecutablePath) > 0) { BAlert *alert = new BAlert(NULL, buffer, "Debug", "OK", NULL,
// we have a usable path, so we can debug the team B_WIDTH_AS_USUAL, B_WARNING_ALERT);
BAlert *alert = new BAlert(NULL, buffer, "Debug", "OK", NULL, int32 result = alert->Go();
B_WIDTH_AS_USUAL, B_WARNING_ALERT); kill = (result == 1);
int32 result = alert->Go();
kill = (result == 1);
} else {
// no usable path
BAlert *alert = new BAlert(NULL, buffer, "OK", NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->Go();
}
} }
return kill; return kill;