From ac7fc18b0973783319381299aa30a5bb23a1db68 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 12 Aug 2007 23:49:38 +0000 Subject: [PATCH] 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 --- src/servers/debug/DebugServer.cpp | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/servers/debug/DebugServer.cpp b/src/servers/debug/DebugServer.cpp index 8ff1b10db4..75ced93131 100644 --- a/src/servers/debug/DebugServer.cpp +++ b/src/servers/debug/DebugServer.cpp @@ -441,7 +441,7 @@ TeamDebugHandler::_EnterDebugger() // prepare the argument vector char teamString[32]; - snprintf(teamString, sizeof(teamString), "%ld", fTeam); + snprintf(teamString, sizeof(teamString), "--pid=%ld", fTeam); const char *terminal = (debugInConsoled ? kConsoledPath : kTerminalPath); @@ -459,8 +459,9 @@ TeamDebugHandler::_EnterDebugger() } argv[argc++] = kGDBPath; - argv[argc++] = fExecutablePath; argv[argc++] = teamString; + if (strlen(fExecutablePath) > 0) + argv[argc++] = fExecutablePath; argv[argc] = NULL; // start the terminal @@ -553,10 +554,9 @@ TeamDebugHandler::_HandleMessage(DebugMessage *message) // ask the user whether to debug or kill the team if (_IsGUIServer()) { // App server, input server, or registrar. We always debug those. - kill = !(strlen(fExecutablePath) > 0); + kill = false; } else if (USE_GUI && _AreGUIServersAlive() && _InitGUI() == B_OK) { - // normal app - + // normal app -- tell the user _NotifyAppServer(fTeam); char buffer[1024]; @@ -564,18 +564,10 @@ TeamDebugHandler::_HandleMessage(DebugMessage *message) "has encountered an error which prevents it from continuing. Haiku " "will terminate the application and clean up.", fTeamInfo.args); - if (strlen(fExecutablePath) > 0) { - // we have a usable path, so we can debug the team - BAlert *alert = new BAlert(NULL, buffer, "Debug", "OK", NULL, - B_WIDTH_AS_USUAL, B_WARNING_ALERT); - 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(); - } + BAlert *alert = new BAlert(NULL, buffer, "Debug", "OK", NULL, + B_WIDTH_AS_USUAL, B_WARNING_ALERT); + int32 result = alert->Go(); + kill = (result == 1); } return kill;