Changeset View
Changeset View
Standalone View
Standalone View
debuggers/lldb/debugsession.cpp
Show First 20 Lines • Show All 292 Lines • ▼ Show 20 Line(s) | 264 | addCommand(new SentinelCommand([this, remoteDebugging, configLldbScript]() { | |||
---|---|---|---|---|---|
293 | } | 293 | } | ||
294 | 294 | | |||
295 | addCommand(MI::ExecRun, QString(), new ExecRunHandler(this), | 295 | addCommand(MI::ExecRun, QString(), new ExecRunHandler(this), | ||
296 | CmdMaybeStartsRunning | CmdHandlesError); | 296 | CmdMaybeStartsRunning | CmdHandlesError); | ||
297 | }, CmdMaybeStartsRunning)); | 297 | }, CmdMaybeStartsRunning)); | ||
298 | return true; | 298 | return true; | ||
299 | } | 299 | } | ||
300 | 300 | | |||
301 | bool DebugSession::loadCoreFile(ILaunchConfiguration *, | ||||
302 | const QString &debugee, const QString &corefile) | ||||
303 | { | ||||
304 | addCommand(MI::FileExecAndSymbols, debugee, | ||||
305 | this, &DebugSession::handleFileExecAndSymbols, | ||||
306 | CmdHandlesError); | ||||
307 | raiseEvent(connected_to_program); | ||||
308 | | ||||
309 | addCommand(new CliCommand(NonMI, "target create -c " + Utils::quote(corefile), | ||||
310 | this, &DebugSession::handleCoreFile, | ||||
311 | CmdHandlesError)); | ||||
312 | return true; | ||||
313 | } | ||||
314 | | ||||
301 | void DebugSession::interruptDebugger() | 315 | void DebugSession::interruptDebugger() | ||
302 | { | 316 | { | ||
303 | if (debuggerStateIsOn(s_dbgNotStarted|s_shuttingDown)) | 317 | if (debuggerStateIsOn(s_dbgNotStarted|s_shuttingDown)) | ||
304 | return; | 318 | return; | ||
305 | 319 | | |||
306 | addCommand(ExecInterrupt, QString(), CmdInterrupt); | 320 | addCommand(ExecInterrupt, QString(), CmdInterrupt); | ||
307 | return; | 321 | return; | ||
308 | } | 322 | } | ||
Show All 26 Lines | 348 | if (r.reason == "error") { | |||
335 | KMessageBox::error(qApp->activeWindow(), | 349 | KMessageBox::error(qApp->activeWindow(), | ||
336 | i18n("<b>Error connecting to remote target:</b><br />")+ | 350 | i18n("<b>Error connecting to remote target:</b><br />")+ | ||
337 | r["msg"].literal(), | 351 | r["msg"].literal(), | ||
338 | i18n("Startup error")); | 352 | i18n("Startup error")); | ||
339 | stopDebugger(); | 353 | stopDebugger(); | ||
340 | } | 354 | } | ||
341 | } | 355 | } | ||
342 | 356 | | |||
357 | void DebugSession::handleCoreFile(const QStringList &s) | ||||
358 | { | ||||
359 | qCDebug(DEBUGGERLLDB) << s; | ||||
360 | for (const auto &line : s) { | ||||
361 | if (line.startsWith("error:")) { | ||||
362 | KMessageBox::error( | ||||
363 | qApp->activeWindow(), | ||||
364 | i18n("<b>Failed to load core file</b>" | ||||
365 | "<p>Debugger reported the following error:" | ||||
366 | "<p><tt>%1", | ||||
367 | s.join('\n')), | ||||
368 | i18n("Startup error")); | ||||
369 | stopDebugger(); | ||||
370 | return; | ||||
371 | } | ||||
372 | } | ||||
373 | // There's no "thread-group-started" notification from lldb-mi, so pretend we have received one. | ||||
374 | // see MIDebugSession::processNotification(const MI::AsyncRecord & async) | ||||
375 | setDebuggerStateOff(s_appNotStarted | s_programExited); | ||||
376 | | ||||
377 | setDebuggerStateOn(s_programExited | s_core); | ||||
378 | } | ||||
379 | | ||||
343 | void DebugSession::updateAllVariables() | 380 | void DebugSession::updateAllVariables() | ||
344 | { | 381 | { | ||
345 | // FIXME: this is only a workaround for lldb-mi doesn't provide -var-update changelist | 382 | // FIXME: this is only a workaround for lldb-mi doesn't provide -var-update changelist | ||
346 | // for variables that have a python synthetic provider. Remove this after this is fixed | 383 | // for variables that have a python synthetic provider. Remove this after this is fixed | ||
347 | // in the upstream. | 384 | // in the upstream. | ||
348 | 385 | | |||
349 | // re-fetch all toplevel variables, as -var-update doesn't work with data formatter | 386 | // re-fetch all toplevel variables, as -var-update doesn't work with data formatter | ||
350 | // we have to pick out top level variables first, as refetching will delete child | 387 | // we have to pick out top level variables first, as refetching will delete child | ||
Show All 24 Lines |