Provide a useful window title for the debug terminal.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13798 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -122,6 +122,7 @@ private:
|
|||||||
bool _IsRegistrar() const;
|
bool _IsRegistrar() const;
|
||||||
bool _IsGUIServer() const;
|
bool _IsGUIServer() const;
|
||||||
|
|
||||||
|
static const char *_LastPathComponent(const char *path);
|
||||||
static team_id _FindTeam(const char *name);
|
static team_id _FindTeam(const char *name);
|
||||||
static bool _AreGUIServersAlive();
|
static bool _AreGUIServersAlive();
|
||||||
|
|
||||||
@@ -452,10 +453,23 @@ TeamDebugHandler::_EnterDebugger()
|
|||||||
|
|
||||||
const char *terminal = (debugInConsoled ? kConsoledPath : kTerminalPath);
|
const char *terminal = (debugInConsoled ? kConsoledPath : kTerminalPath);
|
||||||
|
|
||||||
const char *argv[] = {
|
const char *argv[16];
|
||||||
terminal, kGDBPath, fExecutablePath, teamString, NULL
|
int argc = 0;
|
||||||
};
|
|
||||||
int argc = 4;
|
argv[argc++] = terminal;
|
||||||
|
|
||||||
|
if (!debugInConsoled) {
|
||||||
|
char windowTitle[64];
|
||||||
|
snprintf(windowTitle, sizeof(windowTitle), "Debug of Team %ld: %s",
|
||||||
|
fTeam, _LastPathComponent(fExecutablePath));
|
||||||
|
argv[argc++] = "-t";
|
||||||
|
argv[argc++] = windowTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
argv[argc++] = kGDBPath;
|
||||||
|
argv[argc++] = fExecutablePath;
|
||||||
|
argv[argc++] = teamString;
|
||||||
|
argv[argc] = NULL;
|
||||||
|
|
||||||
// start the terminal
|
// start the terminal
|
||||||
TRACE(("debug_server: TeamDebugHandler::_EnterDebugger(): starting "
|
TRACE(("debug_server: TeamDebugHandler::_EnterDebugger(): starting "
|
||||||
@@ -782,9 +796,7 @@ TeamDebugHandler::_HandlerThread()
|
|||||||
bool
|
bool
|
||||||
TeamDebugHandler::_ExecutableNameEquals(const char *name) const
|
TeamDebugHandler::_ExecutableNameEquals(const char *name) const
|
||||||
{
|
{
|
||||||
const char *lastSlash = strrchr(fExecutablePath, '/');
|
return (strcmp(_LastPathComponent(fExecutablePath), name) == 0);
|
||||||
const char *executableName = (lastSlash ? lastSlash + 1 : fExecutablePath);
|
|
||||||
return (strcmp(executableName, name) == 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// _IsAppServer
|
// _IsAppServer
|
||||||
@@ -816,6 +828,14 @@ TeamDebugHandler::_IsGUIServer() const
|
|||||||
return (_IsAppServer() || _IsInputServer() || _IsRegistrar());
|
return (_IsAppServer() || _IsInputServer() || _IsRegistrar());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// _LastPathComponent
|
||||||
|
const char *
|
||||||
|
TeamDebugHandler::_LastPathComponent(const char *path)
|
||||||
|
{
|
||||||
|
const char *lastSlash = strrchr(path, '/');
|
||||||
|
return (lastSlash ? lastSlash + 1 : path);
|
||||||
|
}
|
||||||
|
|
||||||
// _FindTeam
|
// _FindTeam
|
||||||
team_id
|
team_id
|
||||||
TeamDebugHandler::_FindTeam(const char *name)
|
TeamDebugHandler::_FindTeam(const char *name)
|
||||||
|
|||||||
Reference in New Issue
Block a user