Changeset View
Changeset View
Standalone View
Standalone View
debuggers/common/midebugsession.cpp
Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Line(s) | 127 | { | |||
---|---|---|---|---|---|
160 | if (!m_sourceInitFile) | 160 | if (!m_sourceInitFile) | ||
161 | extraArguments << "--nx"; | 161 | extraArguments << "--nx"; | ||
162 | 162 | | |||
163 | auto config = cfg ? cfg->config() | 163 | auto config = cfg ? cfg->config() | ||
164 | // FIXME: this is only used when attachToProcess or examineCoreFile. | 164 | // FIXME: this is only used when attachToProcess or examineCoreFile. | ||
165 | // Change to use a global launch configuration when calling | 165 | // Change to use a global launch configuration when calling | ||
166 | : KConfigGroup(KSharedConfig::openConfig(), "GDB Config"); | 166 | : KConfigGroup(KSharedConfig::openConfig(), "GDB Config"); | ||
167 | 167 | | |||
168 | m_debugger->start(config, extraArguments); | 168 | if (!m_debugger->start(config, extraArguments)) { | ||
169 | return false; | ||||
170 | } | ||||
169 | 171 | | |||
170 | // FIXME: here, we should wait until the debugger is up and waiting for input. | 172 | // FIXME: here, we should wait until the debugger is up and waiting for input. | ||
171 | // Then, clear s_dbgNotStarted | 173 | // Then, clear s_dbgNotStarted | ||
172 | // It's better to do this right away so that the state bit is always correct. | 174 | // It's better to do this right away so that the state bit is always correct. | ||
173 | setDebuggerStateOff(s_dbgNotStarted); | 175 | setDebuggerStateOff(s_dbgNotStarted); | ||
174 | 176 | | |||
175 | // Initialise debugger. At this stage debugger is sitting wondering what to do, | 177 | // Initialise debugger. At this stage debugger is sitting wondering what to do, | ||
176 | // and to whom. | 178 | // and to whom. | ||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 186 | { | |||
268 | return true; | 270 | return true; | ||
269 | } | 271 | } | ||
270 | 272 | | |||
271 | // FIXME: use same configuration process as startDebugging | 273 | // FIXME: use same configuration process as startDebugging | ||
272 | bool MIDebugSession::attachToProcess(int pid) | 274 | bool MIDebugSession::attachToProcess(int pid) | ||
273 | { | 275 | { | ||
274 | qCDebug(DEBUGGERCOMMON) << "Attach to process" << pid; | 276 | qCDebug(DEBUGGERCOMMON) << "Attach to process" << pid; | ||
275 | 277 | | |||
278 | emit showMessage(i18n("Attaching to process %1", pid), 1000); | ||||
279 | | ||||
276 | if (debuggerStateIsOn(s_dbgNotStarted)) { | 280 | if (debuggerStateIsOn(s_dbgNotStarted)) { | ||
277 | // FIXME: use global launch configuration rather than nullptr | 281 | // FIXME: use global launch configuration rather than nullptr | ||
278 | if (!startDebugger(nullptr)) { | 282 | if (!startDebugger(nullptr)) { | ||
279 | return false; | 283 | return false; | ||
280 | } | 284 | } | ||
281 | } | 285 | } | ||
282 | 286 | | |||
283 | setDebuggerStateOn(s_attached); | 287 | setDebuggerStateOn(s_attached); | ||
Show All 32 Lines | 317 | KMessageBox::error( | |||
316 | r["msg"].literal(), | 320 | r["msg"].literal(), | ||
317 | i18n("Startup error")); | 321 | i18n("Startup error")); | ||
318 | stopDebugger(); | 322 | stopDebugger(); | ||
319 | } | 323 | } | ||
320 | } | 324 | } | ||
321 | 325 | | |||
322 | bool MIDebugSession::examineCoreFile(const QUrl &debugee, const QUrl &coreFile) | 326 | bool MIDebugSession::examineCoreFile(const QUrl &debugee, const QUrl &coreFile) | ||
323 | { | 327 | { | ||
328 | emit showMessage(i18n("Examining core file %1", coreFile.toLocalFile()), 1000); | ||||
329 | | ||||
324 | if (debuggerStateIsOn(s_dbgNotStarted)) { | 330 | if (debuggerStateIsOn(s_dbgNotStarted)) { | ||
325 | // FIXME: use global launch configuration rather than nullptr | 331 | // FIXME: use global launch configuration rather than nullptr | ||
326 | if (!startDebugger(nullptr)) { | 332 | if (!startDebugger(nullptr)) { | ||
327 | return false; | 333 | return false; | ||
328 | } | 334 | } | ||
329 | } | 335 | } | ||
330 | 336 | | |||
331 | // FIXME: support non-local URLs | 337 | // FIXME: support non-local URLs | ||
▲ Show 20 Lines • Show All 960 Lines • Show Last 20 Lines |