Changeset View
Changeset View
Standalone View
Standalone View
plugins/gdb/gdb.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 51 | { | |||
---|---|---|---|---|---|
56 | } else { | 56 | } else { | ||
57 | // FIXME: verify its' a local path. | 57 | // FIXME: verify its' a local path. | ||
58 | m_debuggerExecutable = gdbUrl.url(QUrl::PreferLocalFile | QUrl::StripTrailingSlash); | 58 | m_debuggerExecutable = gdbUrl.url(QUrl::PreferLocalFile | QUrl::StripTrailingSlash); | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | QStringList arguments = extraArguments; | 61 | QStringList arguments = extraArguments; | ||
62 | arguments << QStringLiteral("--interpreter=mi2") << QStringLiteral("-quiet"); | 62 | arguments << QStringLiteral("--interpreter=mi2") << QStringLiteral("-quiet"); | ||
63 | 63 | | |||
64 | QString fullCommand; | ||||
65 | | ||||
64 | QUrl shell = config.readEntry(Config::DebuggerShellEntry, QUrl()); | 66 | QUrl shell = config.readEntry(Config::DebuggerShellEntry, QUrl()); | ||
65 | if(!shell.isEmpty()) { | 67 | if(!shell.isEmpty()) { | ||
66 | qCDebug(DEBUGGERGDB) << "have shell" << shell; | 68 | qCDebug(DEBUGGERGDB) << "have shell" << shell; | ||
67 | QString shell_without_args = shell.toLocalFile().split(QLatin1Char(' ')).first(); | 69 | QString shell_without_args = shell.toLocalFile().split(QLatin1Char(' ')).first(); | ||
68 | 70 | | |||
69 | QFileInfo info(shell_without_args); | 71 | QFileInfo info(shell_without_args); | ||
70 | /*if( info.isRelative() ) | 72 | /*if( info.isRelative() ) | ||
71 | { | 73 | { | ||
72 | shell_without_args = build_dir + "/" + shell_without_args; | 74 | shell_without_args = build_dir + "/" + shell_without_args; | ||
73 | info.setFile( shell_without_args ); | 75 | info.setFile( shell_without_args ); | ||
74 | }*/ | 76 | }*/ | ||
75 | if(!info.exists()) { | 77 | if(!info.exists()) { | ||
76 | KMessageBox::information( | 78 | KMessageBox::information( | ||
77 | qApp->activeWindow(), | 79 | qApp->activeWindow(), | ||
78 | i18n("Could not locate the debugging shell '%1'.", shell_without_args ), | 80 | i18n("Could not locate the debugging shell '%1'.", shell_without_args ), | ||
79 | i18n("Debugging Shell Not Found") ); | 81 | i18n("Debugging Shell Not Found") ); | ||
80 | return false; | 82 | return false; | ||
81 | } | 83 | } | ||
82 | 84 | | |||
83 | arguments.insert(0, m_debuggerExecutable); | 85 | arguments.insert(0, m_debuggerExecutable); | ||
84 | arguments.insert(0, shell.toLocalFile()); | 86 | arguments.insert(0, shell.toLocalFile()); | ||
85 | m_process->setShellCommand(KShell::joinArgs(arguments)); | 87 | m_process->setShellCommand(KShell::joinArgs(arguments)); | ||
86 | } else { | 88 | } else { | ||
87 | m_process->setProgram(m_debuggerExecutable, arguments); | 89 | m_process->setProgram(m_debuggerExecutable, arguments); | ||
90 | fullCommand = m_debuggerExecutable + QLatin1Char(' '); | ||||
88 | } | 91 | } | ||
92 | fullCommand += arguments.join(QLatin1Char(' ')); | ||||
89 | 93 | | |||
90 | m_process->start(); | 94 | m_process->start(); | ||
91 | 95 | | |||
92 | qCDebug(DEBUGGERGDB) << "Starting GDB with command" << shell.toLocalFile() + QLatin1Char(' ') + m_debuggerExecutable | 96 | qCDebug(DEBUGGERGDB) << "Starting GDB with command" << fullCommand; | ||
93 | + QLatin1Char(' ') + arguments.join(QLatin1Char(' ')); | | |||
94 | qCDebug(DEBUGGERGDB) << "GDB process pid:" << m_process->pid(); | 97 | qCDebug(DEBUGGERGDB) << "GDB process pid:" << m_process->pid(); | ||
95 | emit userCommandOutput(shell.toLocalFile() + QLatin1Char(' ') + m_debuggerExecutable | 98 | emit userCommandOutput(fullCommand + QLatin1Char('\n')); | ||
96 | + QLatin1Char(' ') + arguments.join(QLatin1Char(' ')) + QLatin1Char('\n')); | | |||
97 | return true; | 99 | return true; | ||
98 | } | 100 | } |