2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 15:08:31 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-08-29 16:36:42 +02:00
|
|
|
#include <debugger/debuggerengine.h>
|
2010-06-30 14:39:41 +02:00
|
|
|
|
2015-01-10 01:07:01 +01:00
|
|
|
#include <debugger/breakhandler.h>
|
2015-07-21 12:52:18 +02:00
|
|
|
#include <debugger/registerhandler.h>
|
2013-08-29 16:36:42 +02:00
|
|
|
#include <debugger/watchhandler.h>
|
|
|
|
|
#include <debugger/watchutils.h>
|
2016-07-29 15:55:15 +02:00
|
|
|
#include <debugger/debuggeritem.h>
|
2014-07-10 18:10:56 +02:00
|
|
|
#include <debugger/debuggertooltipmanager.h>
|
2009-02-20 12:33:16 +01:00
|
|
|
|
2012-12-29 01:31:08 +01:00
|
|
|
#include <coreplugin/id.h>
|
|
|
|
|
|
2013-11-04 09:47:34 +01:00
|
|
|
#include <projectexplorer/devicesupport/idevice.h>
|
2015-06-08 12:10:11 +02:00
|
|
|
#include <utils/qtcprocess.h>
|
2013-11-04 09:47:34 +01:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QProcess>
|
|
|
|
|
#include <QTextCodec>
|
|
|
|
|
#include <QTime>
|
|
|
|
|
#include <QTimer>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2016-12-13 09:46:51 +01:00
|
|
|
#include <functional>
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2013-09-09 16:42:32 +02:00
|
|
|
class GdbProcess;
|
2012-03-30 17:36:44 +02:00
|
|
|
class DebugInfoTask;
|
|
|
|
|
class DebugInfoTaskHandler;
|
2015-02-05 15:47:07 +01:00
|
|
|
class DebuggerResponse;
|
2008-12-02 12:01:29 +01:00
|
|
|
class GdbMi;
|
2013-11-05 18:47:03 +01:00
|
|
|
class MemoryAgentCookie;
|
2015-01-10 01:07:01 +01:00
|
|
|
class BreakpointParameters;
|
|
|
|
|
class BreakpointResponse;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-04-12 12:01:40 +02:00
|
|
|
class DisassemblerAgentCookie;
|
2010-11-24 15:55:09 +01:00
|
|
|
class DisassemblerLines;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-12-12 15:33:16 +01:00
|
|
|
class GdbEngine : public DebuggerEngine
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2015-05-27 13:59:56 +02:00
|
|
|
explicit GdbEngine(const DebuggerRunParameters &runParameters);
|
2016-06-13 15:27:17 +02:00
|
|
|
~GdbEngine() override;
|
2009-09-11 12:30:53 +02:00
|
|
|
|
2009-10-15 12:32:49 +02:00
|
|
|
private: ////////// General Interface //////////
|
2015-09-10 11:01:09 +02:00
|
|
|
DebuggerEngine *cppEngine() override { return this; }
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-06-13 10:15:56 +02:00
|
|
|
virtual void handleGdbStartFailed();
|
2015-09-15 12:01:05 +02:00
|
|
|
void notifyInferiorSetupFailed() override;
|
2016-05-27 13:57:21 +02:00
|
|
|
void prepareForRestart() override;
|
2010-07-08 18:10:50 +02:00
|
|
|
|
2015-09-15 12:01:05 +02:00
|
|
|
bool hasCapability(unsigned) const override;
|
|
|
|
|
void detachDebugger() override;
|
|
|
|
|
void shutdownInferior() override;
|
|
|
|
|
void abortDebugger() override;
|
|
|
|
|
void resetInferior() override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-09-15 12:01:05 +02:00
|
|
|
bool acceptsDebuggerCommands() const override;
|
|
|
|
|
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages) override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-10-15 12:32:49 +02:00
|
|
|
private: ////////// General State //////////
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-10-15 12:32:49 +02:00
|
|
|
DebuggerStartMode startMode() const;
|
2015-09-15 12:01:05 +02:00
|
|
|
void reloadLocals();
|
2009-08-12 10:51:25 +02:00
|
|
|
|
2009-10-30 16:42:33 +01:00
|
|
|
bool m_registerNamesListed;
|
2009-08-14 13:04:05 +02:00
|
|
|
|
2012-06-13 10:15:56 +02:00
|
|
|
protected: ////////// Gdb Process Management //////////
|
2009-01-27 15:53:50 +01:00
|
|
|
|
2012-06-05 19:55:32 +02:00
|
|
|
void startGdb(const QStringList &args = QStringList());
|
2015-02-05 15:47:07 +01:00
|
|
|
void handleInferiorShutdown(const DebuggerResponse &response);
|
|
|
|
|
void handleGdbExit(const DebuggerResponse &response);
|
2016-04-07 12:34:19 +03:00
|
|
|
void setLinuxOsAbi();
|
2009-10-20 11:02:16 +02:00
|
|
|
|
2011-12-05 08:53:51 +02:00
|
|
|
void loadInitScript();
|
2015-07-15 10:38:15 +03:00
|
|
|
void setEnvironmentVariables();
|
2010-07-08 18:10:50 +02:00
|
|
|
|
2010-07-08 12:41:26 +02:00
|
|
|
// Something went wrong with the adapter *before* adapterStarted() was emitted.
|
|
|
|
|
// Make sure to clean up everything before emitting this signal.
|
2010-03-03 18:08:18 +01:00
|
|
|
void handleAdapterStartFailed(const QString &msg,
|
2012-12-29 01:31:08 +01:00
|
|
|
Core::Id settingsIdHint = Core::Id());
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-07-08 12:41:26 +02:00
|
|
|
// This triggers the initial breakpoint synchronization and causes
|
2010-07-08 18:10:50 +02:00
|
|
|
// finishInferiorSetup() being called once done.
|
2009-10-19 19:04:01 +02:00
|
|
|
void handleInferiorPrepared();
|
2010-07-08 18:10:50 +02:00
|
|
|
// This notifies the base of a successful inferior setup.
|
|
|
|
|
void finishInferiorSetup();
|
2009-10-19 19:04:01 +02:00
|
|
|
|
2015-02-05 15:47:07 +01:00
|
|
|
void handleDebugInfoLocation(const DebuggerResponse &response);
|
2012-05-10 16:22:06 +02:00
|
|
|
|
2010-07-08 12:41:26 +02:00
|
|
|
// The adapter is still running just fine, but it failed to acquire a debuggee.
|
2010-07-09 17:07:59 +02:00
|
|
|
void notifyInferiorSetupFailed(const QString &msg);
|
|
|
|
|
|
|
|
|
|
void notifyAdapterShutdownOk();
|
|
|
|
|
void notifyAdapterShutdownFailed();
|
2009-10-15 12:32:49 +02:00
|
|
|
|
2010-07-08 12:41:26 +02:00
|
|
|
// Something went wrong with the adapter *after* adapterStarted() was emitted.
|
|
|
|
|
// Make sure to clean up everything before emitting this signal.
|
2009-10-15 12:32:49 +02:00
|
|
|
void handleAdapterCrashed(const QString &msg);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2016-06-26 22:25:34 +03:00
|
|
|
private:
|
2015-02-12 13:50:54 +01:00
|
|
|
friend class GdbPlainEngine;
|
2016-04-19 22:49:23 +02:00
|
|
|
friend class GdbCoreEngine;
|
2013-11-04 09:47:34 +01:00
|
|
|
void handleInterruptDeviceInferior(const QString &error);
|
2015-03-05 11:11:32 +01:00
|
|
|
void handleGdbFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
2010-07-08 12:41:26 +02:00
|
|
|
void handleGdbError(QProcess::ProcessError error);
|
|
|
|
|
void readGdbStandardOutput();
|
|
|
|
|
void readGdbStandardError();
|
2016-06-07 17:04:53 +02:00
|
|
|
void readDebuggeeOutput(const QByteArray &ba);
|
2010-07-08 12:41:26 +02:00
|
|
|
|
2016-06-13 11:22:28 +02:00
|
|
|
QTextCodec *m_gdbOutputCodec;
|
|
|
|
|
QTextCodec::ConverterState m_gdbOutputCodecState;
|
|
|
|
|
QTextCodec *m_inferiorOutputCodec;
|
|
|
|
|
QTextCodec::ConverterState m_inferiorOutputCodecState;
|
2009-10-15 12:32:49 +02:00
|
|
|
|
|
|
|
|
QByteArray m_inbuffer;
|
2009-10-27 12:05:03 +01:00
|
|
|
bool m_busy;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-05-19 12:00:01 +02:00
|
|
|
// Name of the convenience variable containing the last
|
|
|
|
|
// known function return value.
|
2016-06-07 17:04:53 +02:00
|
|
|
QString m_resultVarName;
|
2010-05-19 12:00:01 +02:00
|
|
|
|
2016-12-13 13:37:05 +01:00
|
|
|
protected: ////////// Gdb Command Management //////////
|
2009-05-04 18:30:22 +02:00
|
|
|
|
2015-11-03 12:01:57 +01:00
|
|
|
void runCommand(const DebuggerCommand &command) override;
|
2015-09-11 11:28:55 +02:00
|
|
|
|
2012-06-13 10:15:56 +02:00
|
|
|
private:
|
2016-04-19 22:49:23 +02:00
|
|
|
void commandTimeout();
|
2008-12-02 12:01:29 +01:00
|
|
|
void setTokenBarrier();
|
|
|
|
|
|
2011-06-06 18:17:51 +02:00
|
|
|
// Sets up an "unexpected result" for the following commeand.
|
2016-06-07 17:04:53 +02:00
|
|
|
void scheduleTestResponse(int testCase, const QString &response);
|
2011-06-06 18:17:51 +02:00
|
|
|
|
2015-02-06 10:30:25 +01:00
|
|
|
QHash<int, DebuggerCommand> m_commandForToken;
|
2015-09-11 11:28:55 +02:00
|
|
|
QHash<int, int> m_flagsForToken;
|
2009-12-11 16:59:34 +01:00
|
|
|
int commandTimeoutTime() const;
|
2010-11-16 12:42:57 +01:00
|
|
|
QTimer m_commandTimer;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
QString m_pendingConsoleStreamOutput;
|
|
|
|
|
QString m_pendingLogStreamOutput;
|
2009-10-09 16:35:52 +02:00
|
|
|
|
2010-03-03 18:08:18 +01:00
|
|
|
// This contains the first token number for the current round
|
2009-10-15 12:32:49 +02:00
|
|
|
// of evaluation. Responses with older tokens are considers
|
|
|
|
|
// out of date and discarded.
|
|
|
|
|
int m_oldestAcceptableToken;
|
2011-12-13 15:40:31 +01:00
|
|
|
int m_nonDiscardableCount;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-03-03 18:08:18 +01:00
|
|
|
int m_pendingBreakpointRequests; // Watch updating commands in flight
|
2009-09-21 11:09:38 +02:00
|
|
|
|
2009-10-15 12:32:49 +02:00
|
|
|
typedef void (GdbEngine::*CommandsDoneCallback)();
|
2010-03-03 18:08:18 +01:00
|
|
|
// This function is called after all previous responses have been received.
|
2009-10-15 12:32:49 +02:00
|
|
|
CommandsDoneCallback m_commandsDoneCallback;
|
2009-09-21 11:09:38 +02:00
|
|
|
|
2015-07-07 15:13:10 +02:00
|
|
|
bool m_rerunPending;
|
2009-10-15 12:32:49 +02:00
|
|
|
|
|
|
|
|
private: ////////// Gdb Output, State & Capability Handling //////////
|
2012-06-13 10:15:56 +02:00
|
|
|
protected:
|
2016-06-27 22:56:03 +03:00
|
|
|
Q_INVOKABLE void handleResponse(const QString &buff);
|
2016-06-07 17:04:53 +02:00
|
|
|
void handleAsyncOutput(const QString &asyncClass, const GdbMi &result);
|
2009-10-09 10:20:42 +02:00
|
|
|
void handleStopResponse(const GdbMi &data);
|
2015-02-05 15:47:07 +01:00
|
|
|
void handleResultRecord(DebuggerResponse *response);
|
2009-10-09 10:59:56 +02:00
|
|
|
void handleStop1(const GdbMi &data);
|
2012-04-17 10:00:40 +02:00
|
|
|
void handleStop2(const GdbMi &data);
|
2016-04-19 22:49:23 +02:00
|
|
|
void handleStop3();
|
2010-08-11 09:46:39 +02:00
|
|
|
void resetCommandQueue();
|
2009-10-15 12:32:49 +02:00
|
|
|
|
2015-09-10 11:01:09 +02:00
|
|
|
bool isSynchronous() const override { return true; }
|
2009-10-15 12:32:49 +02:00
|
|
|
|
|
|
|
|
// Gdb initialization sequence
|
2015-02-05 15:47:07 +01:00
|
|
|
void handleShowVersion(const DebuggerResponse &response);
|
|
|
|
|
void handleListFeatures(const DebuggerResponse &response);
|
|
|
|
|
void handlePythonSetup(const DebuggerResponse &response);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-09-17 09:47:36 +02:00
|
|
|
int m_gdbVersion; // 7.6.1 is 70601
|
|
|
|
|
int m_pythonVersion; // 2.7.2 is 20702
|
2012-02-10 07:42:44 +01:00
|
|
|
bool m_isQnxGdb;
|
2009-09-14 11:02:36 +02:00
|
|
|
|
2009-10-15 12:32:49 +02:00
|
|
|
private: ////////// Inferior Management //////////
|
2009-05-14 15:03:30 +02:00
|
|
|
|
2009-10-22 22:54:30 +02:00
|
|
|
// This should be always the last call in a function.
|
2015-09-10 11:01:09 +02:00
|
|
|
bool stateAcceptsBreakpointChanges() const override;
|
|
|
|
|
bool acceptsBreakpoint(Breakpoint bp) const override;
|
|
|
|
|
void insertBreakpoint(Breakpoint bp) override;
|
|
|
|
|
void removeBreakpoint(Breakpoint bp) override;
|
|
|
|
|
void changeBreakpoint(Breakpoint bp) override;
|
|
|
|
|
|
|
|
|
|
void executeStep() override;
|
|
|
|
|
void executeStepOut() override;
|
|
|
|
|
void executeNext() override;
|
|
|
|
|
void executeStepI() override;
|
|
|
|
|
void executeNextI() override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-06-13 10:15:56 +02:00
|
|
|
protected:
|
2009-10-15 12:32:49 +02:00
|
|
|
void continueInferiorInternal();
|
2015-09-10 11:01:09 +02:00
|
|
|
void continueInferior() override;
|
|
|
|
|
void interruptInferior() override;
|
2012-06-13 10:15:56 +02:00
|
|
|
virtual void interruptInferior2() {}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-09-10 11:01:09 +02:00
|
|
|
void executeRunToLine(const ContextData &data) override;
|
|
|
|
|
void executeRunToFunction(const QString &functionName) override;
|
|
|
|
|
void executeJumpToLine(const ContextData &data) override;
|
|
|
|
|
void executeReturn() override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-02-05 15:47:07 +01:00
|
|
|
void handleExecuteContinue(const DebuggerResponse &response);
|
|
|
|
|
void handleExecuteStep(const DebuggerResponse &response);
|
|
|
|
|
void handleExecuteNext(const DebuggerResponse &response);
|
|
|
|
|
void handleExecuteReturn(const DebuggerResponse &response);
|
|
|
|
|
void handleExecuteJumpToLine(const DebuggerResponse &response);
|
|
|
|
|
void handleExecuteRunToLine(const DebuggerResponse &response);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-11-27 16:10:14 +01:00
|
|
|
QString msgPtraceError(DebuggerStartMode sm);
|
2009-11-09 22:11:56 +01:00
|
|
|
|
2009-10-15 12:32:49 +02:00
|
|
|
private: ////////// View & Data Stuff //////////
|
|
|
|
|
|
2015-09-10 11:01:09 +02:00
|
|
|
void selectThread(ThreadId threadId) override;
|
|
|
|
|
void activateFrame(int index) override;
|
2016-12-13 09:46:51 +01:00
|
|
|
void handleAutoContinueInferior();
|
2009-10-15 12:32:49 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
//
|
|
|
|
|
// Breakpoint specific stuff
|
|
|
|
|
//
|
2011-06-24 19:02:12 +02:00
|
|
|
void handleBreakModifications(const GdbMi &bkpts);
|
2015-02-06 01:26:47 +01:00
|
|
|
void handleBreakIgnore(const DebuggerResponse &response, Breakpoint bp);
|
|
|
|
|
void handleBreakDisable(const DebuggerResponse &response, Breakpoint bp);
|
|
|
|
|
void handleBreakEnable(const DebuggerResponse &response, Breakpoint bp);
|
|
|
|
|
void handleBreakInsert1(const DebuggerResponse &response, Breakpoint bp);
|
|
|
|
|
void handleBreakInsert2(const DebuggerResponse &response, Breakpoint bp);
|
|
|
|
|
void handleBreakCondition(const DebuggerResponse &response, Breakpoint bp);
|
|
|
|
|
void handleBreakThreadSpec(const DebuggerResponse &response, Breakpoint bp);
|
|
|
|
|
void handleBreakLineNumber(const DebuggerResponse &response, Breakpoint bp);
|
2015-10-14 13:26:22 +02:00
|
|
|
void handleInsertInterpreterBreakpoint(const DebuggerResponse &response, Breakpoint bp);
|
|
|
|
|
void handleInterpreterBreakpointModified(const GdbMi &data);
|
2015-02-06 01:26:47 +01:00
|
|
|
void handleWatchInsert(const DebuggerResponse &response, Breakpoint bp);
|
|
|
|
|
void handleCatchInsert(const DebuggerResponse &response, Breakpoint bp);
|
2015-01-10 01:07:01 +01:00
|
|
|
void handleBkpt(const GdbMi &bkpt, Breakpoint bp);
|
2011-06-15 14:02:26 +02:00
|
|
|
void updateResponse(BreakpointResponse &response, const GdbMi &bkpt);
|
2016-06-07 17:04:53 +02:00
|
|
|
QString breakpointLocation(const BreakpointParameters &data); // For gdb/MI.
|
|
|
|
|
QString breakpointLocation2(const BreakpointParameters &data); // For gdb/CLI fallback.
|
2009-10-22 22:54:30 +02:00
|
|
|
QString breakLocation(const QString &file) const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Modules specific stuff
|
|
|
|
|
//
|
2013-11-27 16:10:14 +01:00
|
|
|
protected:
|
2015-09-10 11:01:09 +02:00
|
|
|
void loadSymbols(const QString &moduleName) override;
|
2016-04-19 22:49:23 +02:00
|
|
|
void loadAllSymbols() override;
|
2015-09-10 11:01:09 +02:00
|
|
|
void loadSymbolsForStack() override;
|
|
|
|
|
void requestModuleSymbols(const QString &moduleName) override;
|
|
|
|
|
void requestModuleSections(const QString &moduleName) override;
|
|
|
|
|
void reloadModules() override;
|
|
|
|
|
void examineModules() override;
|
2013-11-27 16:10:14 +01:00
|
|
|
|
2009-10-28 22:08:58 +01:00
|
|
|
void reloadModulesInternal();
|
2015-02-05 15:47:07 +01:00
|
|
|
void handleModulesList(const DebuggerResponse &response);
|
2015-02-06 01:26:47 +01:00
|
|
|
void handleShowModuleSections(const DebuggerResponse &response, const QString &moduleName);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-02-02 17:25:14 +01:00
|
|
|
//
|
|
|
|
|
// Snapshot specific stuff
|
|
|
|
|
//
|
2015-09-10 11:01:09 +02:00
|
|
|
virtual void createSnapshot() override;
|
2015-02-06 01:26:47 +01:00
|
|
|
void handleMakeSnapshot(const DebuggerResponse &response, const QString &coreFile);
|
2010-02-02 17:25:14 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
//
|
|
|
|
|
// Register specific stuff
|
2009-09-24 11:45:08 +02:00
|
|
|
//
|
2016-04-19 22:49:23 +02:00
|
|
|
void reloadRegisters() override;
|
2016-06-07 17:04:53 +02:00
|
|
|
void setRegisterValue(const QString &name, const QString &value) override;
|
2015-02-05 15:47:07 +01:00
|
|
|
void handleRegisterListNames(const DebuggerResponse &response);
|
2015-07-21 12:52:18 +02:00
|
|
|
void handleRegisterListing(const DebuggerResponse &response);
|
2015-02-05 15:47:07 +01:00
|
|
|
void handleRegisterListValues(const DebuggerResponse &response);
|
|
|
|
|
void handleMaintPrintRegisters(const DebuggerResponse &response);
|
2015-07-21 12:52:18 +02:00
|
|
|
QHash<int, Register> m_registers; // Map GDB register numbers to indices
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-10-15 12:32:49 +02:00
|
|
|
//
|
|
|
|
|
// Disassembler specific stuff
|
|
|
|
|
//
|
2011-02-10 13:43:02 +01:00
|
|
|
// Chain of fallbacks: PointMixed -> PointPlain -> RangeMixed -> RangePlain.
|
2015-09-10 11:01:09 +02:00
|
|
|
void fetchDisassembler(DisassemblerAgent *agent) override;
|
2011-02-10 13:43:02 +01:00
|
|
|
void fetchDisassemblerByCliPointMixed(const DisassemblerAgentCookie &ac);
|
|
|
|
|
void fetchDisassemblerByCliRangeMixed(const DisassemblerAgentCookie &ac);
|
|
|
|
|
void fetchDisassemblerByCliRangePlain(const DisassemblerAgentCookie &ac);
|
2016-06-07 17:04:53 +02:00
|
|
|
bool handleCliDisassemblerResult(const QString &response, DisassemblerAgent *agent);
|
2011-02-10 13:43:02 +01:00
|
|
|
|
2009-02-17 14:08:49 +01:00
|
|
|
//
|
|
|
|
|
// Source file specific stuff
|
2009-09-24 11:45:08 +02:00
|
|
|
//
|
2015-09-10 11:01:09 +02:00
|
|
|
void reloadSourceFiles() override;
|
2009-10-28 22:08:58 +01:00
|
|
|
void reloadSourceFilesInternal();
|
2015-02-05 15:47:07 +01:00
|
|
|
void handleQuerySources(const DebuggerResponse &response);
|
2009-10-15 12:32:49 +02:00
|
|
|
|
|
|
|
|
QString fullName(const QString &fileName);
|
2009-10-28 11:59:57 +01:00
|
|
|
QString cleanupFullName(const QString &fileName);
|
2009-10-15 12:32:49 +02:00
|
|
|
|
|
|
|
|
// awful hack to keep track of used files
|
|
|
|
|
QMap<QString, QString> m_shortToFullName;
|
|
|
|
|
QMap<QString, QString> m_fullToShortName;
|
2012-03-23 17:53:30 +01:00
|
|
|
QMultiMap<QString, QString> m_baseNameToFullName;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-10-22 22:54:30 +02:00
|
|
|
bool m_sourcesListUpdating;
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
//
|
|
|
|
|
// Stack specific stuff
|
2009-09-24 11:45:08 +02:00
|
|
|
//
|
2012-06-13 10:15:56 +02:00
|
|
|
protected:
|
2015-09-10 11:01:09 +02:00
|
|
|
void updateAll() override;
|
2015-02-06 01:26:47 +01:00
|
|
|
void handleStackListFrames(const DebuggerResponse &response, bool isFull);
|
2015-02-05 15:47:07 +01:00
|
|
|
void handleStackSelectThread(const DebuggerResponse &response);
|
|
|
|
|
void handleThreadListIds(const DebuggerResponse &response);
|
|
|
|
|
void handleThreadInfo(const DebuggerResponse &response);
|
|
|
|
|
void handleThreadNames(const DebuggerResponse &response);
|
2015-02-11 16:05:55 +01:00
|
|
|
DebuggerCommand stackCommand(int depth);
|
2016-04-19 22:49:23 +02:00
|
|
|
void reloadStack();
|
2016-10-11 14:58:55 +02:00
|
|
|
void reloadFullStack() override;
|
|
|
|
|
void loadAdditionalQmlStack() override;
|
2009-10-15 12:32:49 +02:00
|
|
|
int currentFrame() const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
//
|
2009-10-15 12:32:49 +02:00
|
|
|
// Watch specific stuff
|
2009-09-24 11:45:08 +02:00
|
|
|
//
|
2015-03-19 12:42:53 +01:00
|
|
|
virtual void assignValueInDebugger(WatchItem *item,
|
2015-09-10 11:01:09 +02:00
|
|
|
const QString &expr, const QVariant &value) override;
|
2009-10-15 12:32:49 +02:00
|
|
|
|
2016-07-14 10:00:15 +02:00
|
|
|
void fetchMemory(MemoryAgent *agent, quint64 addr, quint64 length) override;
|
2013-11-05 18:47:03 +01:00
|
|
|
void fetchMemoryHelper(const MemoryAgentCookie &cookie);
|
2015-02-05 15:47:07 +01:00
|
|
|
void handleChangeMemory(const DebuggerResponse &response);
|
2016-07-14 10:00:15 +02:00
|
|
|
void changeMemory(MemoryAgent *agent, quint64 addr, const QByteArray &data) override;
|
2015-02-06 01:26:47 +01:00
|
|
|
void handleFetchMemory(const DebuggerResponse &response, MemoryAgentCookie ac);
|
2009-10-15 12:32:49 +02:00
|
|
|
|
2012-05-18 02:28:41 +02:00
|
|
|
void showToolTip();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-02-05 15:47:07 +01:00
|
|
|
void handleVarAssign(const DebuggerResponse &response);
|
2012-03-28 09:37:02 +02:00
|
|
|
void handleThreadGroupCreated(const GdbMi &result);
|
|
|
|
|
void handleThreadGroupExited(const GdbMi &result);
|
|
|
|
|
|
2016-04-19 22:49:23 +02:00
|
|
|
void createFullBacktrace();
|
2010-03-29 18:44:02 +02:00
|
|
|
|
2015-09-10 11:01:09 +02:00
|
|
|
void doUpdateLocals(const UpdateParameters ¶meters) override;
|
2015-10-08 16:19:57 +02:00
|
|
|
void handleFetchVariables(const DebuggerResponse &response);
|
2010-01-29 22:49:55 +01:00
|
|
|
|
2009-10-15 12:32:49 +02:00
|
|
|
void setLocals(const QList<GdbMi> &locals);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
//
|
|
|
|
|
// Dumper Management
|
|
|
|
|
//
|
2015-09-10 11:01:09 +02:00
|
|
|
void reloadDebuggingHelpers() override;
|
2009-09-22 10:50:44 +02:00
|
|
|
|
2010-12-16 12:05:48 +01:00
|
|
|
//
|
2010-06-16 11:08:54 +02:00
|
|
|
// Convenience Functions
|
|
|
|
|
//
|
2009-10-07 17:37:15 +02:00
|
|
|
QString errorMessage(QProcess::ProcessError error);
|
2010-07-09 17:07:59 +02:00
|
|
|
void showExecutionError(const QString &message);
|
2016-07-29 15:55:15 +02:00
|
|
|
QString failedToStartMessage();
|
2010-01-14 15:25:53 +01:00
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
static QString tooltipIName(const QString &exp);
|
2011-02-11 15:00:13 +01:00
|
|
|
|
2010-12-17 13:07:17 +01:00
|
|
|
// For short-circuiting stack and thread list evaluation.
|
|
|
|
|
bool m_stackNeeded;
|
|
|
|
|
|
2015-07-17 13:30:51 +02:00
|
|
|
// For suppressing processing *stopped and *running responses
|
|
|
|
|
// while updating locals.
|
|
|
|
|
bool m_inUpdateLocals;
|
|
|
|
|
|
2010-06-30 14:39:41 +02:00
|
|
|
// HACK:
|
2016-06-07 17:04:53 +02:00
|
|
|
QString m_currentThread;
|
2011-01-21 16:42:57 +01:00
|
|
|
QString m_lastWinException;
|
2012-03-30 17:36:44 +02:00
|
|
|
QString m_lastMissingDebugInfo;
|
2012-08-29 11:42:28 +02:00
|
|
|
bool m_terminalTrap;
|
2012-03-09 15:04:59 +01:00
|
|
|
bool usesExecInterrupt() const;
|
2016-04-19 14:01:44 +02:00
|
|
|
bool usesTargetAsync() const;
|
2012-03-09 15:04:59 +01:00
|
|
|
|
2016-12-13 09:46:51 +01:00
|
|
|
DebuggerCommandSequence m_onStop;
|
|
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
QHash<int, QString> m_scheduledTestResponses;
|
2011-06-06 18:17:51 +02:00
|
|
|
QSet<int> m_testCases;
|
2012-03-30 17:36:44 +02:00
|
|
|
|
|
|
|
|
// Debug information
|
|
|
|
|
friend class DebugInfoTaskHandler;
|
|
|
|
|
void requestDebugInformation(const DebugInfoTask &task);
|
|
|
|
|
DebugInfoTaskHandler *m_debugInfoTaskHandler;
|
2012-04-17 10:00:40 +02:00
|
|
|
|
2013-03-21 17:32:34 +01:00
|
|
|
bool m_systemDumpersLoaded;
|
2012-05-18 02:28:41 +02:00
|
|
|
|
2012-06-13 10:15:56 +02:00
|
|
|
static QString msgGdbStopFailed(const QString &why);
|
|
|
|
|
static QString msgInferiorStopFailed(const QString &why);
|
|
|
|
|
static QString msgAttachedToStoppedInferior();
|
|
|
|
|
static QString msgInferiorSetupOk();
|
|
|
|
|
static QString msgInferiorRunOk();
|
|
|
|
|
static QString msgConnectRemoteServerFailed(const QString &why);
|
|
|
|
|
|
2015-09-10 11:01:09 +02:00
|
|
|
void debugLastCommand() override;
|
2015-02-11 17:51:15 +01:00
|
|
|
DebuggerCommand m_lastDebuggableCommand;
|
2014-01-04 01:34:51 +01:00
|
|
|
|
2012-06-13 10:15:56 +02:00
|
|
|
protected:
|
|
|
|
|
void interruptLocalInferior(qint64 pid);
|
2013-09-09 16:42:32 +02:00
|
|
|
|
2015-06-08 12:10:11 +02:00
|
|
|
protected:
|
|
|
|
|
Utils::QtcProcess m_gdbProc;
|
|
|
|
|
QString m_errorString;
|
2013-11-04 09:47:34 +01:00
|
|
|
ProjectExplorer::DeviceProcessSignalOperation::Ptr m_signalOperation;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|