diff --git a/debuggers/common/mi/micommand.h b/debuggers/common/mi/micommand.h index 9ada2bde62..c387c8c0b9 100644 --- a/debuggers/common/mi/micommand.h +++ b/debuggers/common/mi/micommand.h @@ -1,377 +1,379 @@ /*************************************************************************** begin : Sun Aug 8 1999 copyright : (C) 1999 by John Birch email : jbb@kdevelop.org copyright : (C) 2016 by Aetf email : aetf@unlimitedcodeworks.xyz ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef _MICOMMAND_H_ #define _MICOMMAND_H_ #include "mi/mi.h" #include #include #include #include namespace KDevMI { class MIDebugSession; namespace MI { class VarItem; class ValueCallback; enum CommandFlag { /// The command handler also wishes to receive an error responses, overriding the default error handler CmdHandlesError = 1 << 0, /// The command is expected to cause the inferior to run. Controllers that display the /// program's state should refrain from sending commands while a command with this flag /// is currently pending; however, note that a command with this flag needn't be guaranteed /// to lead to a running state. CmdMaybeStartsRunning = 1 << 1, /// The command is a temporary-run type command, meaning that it typically causes the program /// to run, but only for a short time before it stops again (e.g. Step and StepInto-type /// commands). When the program is running due to this type of command, a CmdImmediately /// command will wait before forcing an interrupt of the debugger, and the program is _not_ /// automatically restarted if an interrupt was forced. /// /// TODO: this special handling has not actually been implemented yet CmdTemporaryRun = 1 << 2, /// This command should be executed immediately, even if the program is currently running /// (e.g. breakpoint setting and modification); however, if the program is interrupted, /// it should be resumed after this command has run. CmdImmediately = 1 << 3, /// This is a command that should interrupt a running program, without resuming. CmdInterrupt = 1 << 4, }; Q_DECLARE_FLAGS(CommandFlags, CommandFlag) //base class for handlers class MICommandHandler { public: virtual ~MICommandHandler() {} virtual void handle(const ResultRecord&) = 0; virtual bool handlesError() { return false; } /** * If the handler object should be deleted after the handle() call. */ virtual bool autoDelete() { return true; } }; class FunctionCommandHandler : public MICommandHandler { public: typedef std::function Function; explicit FunctionCommandHandler(const Function& callback, CommandFlags flags = {}); void handle(const ResultRecord&) override; bool handlesError() override; private: CommandFlags _flags; Function _callback; }; /** * @author John Birch */ class MICommand { protected: explicit MICommand(CommandType type, const QString& arguments = QString(), CommandFlags flags = {}); friend class KDevMI::MIDebugSession; public: virtual ~MICommand(); CommandType type() const; virtual QString miCommand() const; CommandFlags flags() const {return flags_;} /** * Returns the MI token with which the command is sent, allowing the parser to match up * the result message with the command. */ uint32_t token() const {return token_;} /** * Set the MI token. This is done by \ref MICommandQueue. */ void setToken(uint32_t token) {token_ = token;} /** * Returns the thread that needs to be currently selected when this command is executed, * or -1 if there is no requirement. */ int thread() const; /** * Set the thread required to be currently selected when the command is executed. */ void setThread(int thread); /** * Returns the frame that needs to be currently selected when this command is executed, * or -1 if there is no requirement. */ int frame() const; /** * Set the frame required to be currently selected when the command is executed. */ void setFrame(int frame); /** * Sets the handler for results. * * The command object assumes ownership of @p handler. */ void setHandler(MICommandHandler* handler); void setHandler(const FunctionCommandHandler::Function &callback); template void setHandler(Handler* handler_this, void (Handler::* handler_method)(const ResultRecord&)); /* The command that should be sent to debugger. This method is virtual so the command can compute this dynamically, possibly using results of the previous commands. If the empty string is returned, nothing is sent. */ virtual QString cmdToSend(); /* Returns the initial string that was specified in ctor invocation. The actual command will be determined by cmdToSend above and the return value of this method is only used in various diagnostic messages emitted before actually sending the command. */ QString initialString() const; /* Returns true if this is command entered by the user and so should be always shown in the gdb output window. */ virtual bool isUserCommand() const; // If there's a handler for this command, invokes it and returns true. // Otherwise, returns false. bool invokeHandler(const ResultRecord& r); // Returns 'true' if 'invokeHandler' should be invoked even // on MI errors. bool handlesError() const; // Called by debuggercontroller for each new output string // debugger emits for this command. In MI mode, this includes // all "stream" messages, but does not include MI responses. void newOutput(const QString&); const QStringList& allStreamOutput() const; QString command() const; void setStateReloading(bool f); bool stateReloading() const; /// Called when the command has been enqueued in the debug session /// and the command is wait for being submitted to GDB. void markAsEnqueued(); /// Called when the command has been submitted to GDB and the command /// waits for completion by GDB. void markAsSubmitted(); /// Called when the command has been completed and the response has arrived. void markAsCompleted(); /// returns the amount of time (in ms) passed between submission and completion. qint64 gdbProcessingTime() const; /// returns the amount of time (in ms) passed between enqueuing and submission. qint64 queueTime() const; /// returns the amount of time (in ms) passed between enqueuing and completion. qint64 totalProcessingTime() const; protected: CommandType type_; CommandFlags flags_; uint32_t token_ = 0; QString command_; MICommandHandler *commandHandler_; QStringList lines; bool stateReloading_; int m_thread; int m_frame; // remember the timestamps (in ms since start of the epoch) when this command // - was added to the command queue (enqueued) // - was submitted to GDB // - was completed; response from GDB arrived qint64 m_enqueueTimestamp; qint64 m_submitTimestamp; qint64 m_completeTimestamp; }; class UserCommand : public MICommand { public: UserCommand(CommandType type, const QString& s); bool isUserCommand() const override; }; /** This is a class for raw CLI commands. Instead of invoking user provided hook with MI response, it invokes the a hook with lists of strings. */ class CliCommand : public MICommand { public: template CliCommand(CommandType type, const QString& command, Handler* handler_this, void (Handler::* handler_method)(const QStringList&), CommandFlags flags = {}); }; /** Command that does nothing and can be just used to invoke a user provided handler when all preceding commands are executed. */ class SentinelCommand : public MICommand { public: typedef std::function Function; template SentinelCommand(Handler* handler_this, void (Handler::* handler_method)(), CommandFlags flags = {}) : MICommand(NonMI, QString(), flags) { QPointer guarded_this(handler_this); handler = [guarded_this, handler_method]() { if (guarded_this) { (guarded_this.data()->*handler_method)(); } }; } explicit SentinelCommand(const Function& handler, CommandFlags flags = {}) : MICommand(NonMI, QString(), flags) , handler(handler) { } using MICommand::invokeHandler; void invokeHandler() { handler(); } QString cmdToSend() override { return QLatin1String(""); } private: Function handler; }; class ExpressionValueCommand : public QObject, public MICommand { + Q_OBJECT + public: typedef void (QObject::*handler_method_t)(const QString&); template ExpressionValueCommand( const QString& expression, Handler* handler_this, void (Handler::* handler_method)(const QString&)) : MICommand(DataEvaluateExpression, expression), handler_this(handler_this), handler_method(static_cast(handler_method)) { setHandler(this, &ExpressionValueCommand::handleResponse); } void handleResponse(const ResultRecord& r) { (handler_this.data()->*handler_method)(r[QStringLiteral("value")].literal()); } private: QPointer handler_this; handler_method_t handler_method; }; template FunctionCommandHandler::Function guarded_callback(Handler *handler_this, void (Handler::* handler_method)(const ResultRecord&)) { QPointer guarded_this(handler_this); return [guarded_this, handler_method](const ResultRecord& r) { if (guarded_this) { (guarded_this.data()->*handler_method)(r); } }; } template void MICommand::setHandler(Handler* handler_this, void (Handler::* handler_method)(const ResultRecord&)) { QPointer guarded_this(handler_this); setHandler(new FunctionCommandHandler([guarded_this, handler_method](const ResultRecord& r) { if (guarded_this) { (guarded_this.data()->*handler_method)(r); } }, flags())); } template CliCommand::CliCommand( CommandType type, const QString& command, Handler* handler_this, void (Handler::* handler_method)(const QStringList&), CommandFlags flags) : MICommand(type, command) { QPointer guarded_this(handler_this); setHandler(new FunctionCommandHandler([this, guarded_this, handler_method](const ResultRecord&) { if (guarded_this) { (guarded_this.data()->*handler_method)(this->allStreamOutput()); } }, flags)); } } // end of namespace MI } // end of namespace KDevMI Q_DECLARE_OPERATORS_FOR_FLAGS(KDevMI::MI::CommandFlags) #endif diff --git a/debuggers/common/miframestackmodel.h b/debuggers/common/miframestackmodel.h index eabe36de57..520d29f30f 100644 --- a/debuggers/common/miframestackmodel.h +++ b/debuggers/common/miframestackmodel.h @@ -1,51 +1,54 @@ /* * Implementation of thread and frame model that are common to debuggers using MI. * * Copyright 2009 Vladimir Prus * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KDEVELOP_MI_FRAMESTACKMODEL_H #define KDEVELOP_MI_FRAMESTACKMODEL_H #include namespace KDevMI { namespace MI { struct ResultRecord; } class MIDebugSession; + class MIFrameStackModel : public KDevelop::FrameStackModel { + Q_OBJECT + public: explicit MIFrameStackModel( MIDebugSession* session); MIDebugSession* session(); protected: // FrameStackModel overrides void fetchThreads() override; void fetchFrames(int threadNumber, int from, int to) override; private: void handleThreadInfo(const MI::ResultRecord& r); }; } // end of namespace KDevMI #endif diff --git a/debuggers/common/mivariable.h b/debuggers/common/mivariable.h index 063357b0c2..8af24096dc 100644 --- a/debuggers/common/mivariable.h +++ b/debuggers/common/mivariable.h @@ -1,87 +1,90 @@ /* * MI based debugger specific Variable * * Copyright 2009 Vladimir Prus * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MIVARIABLE_H #define MIVARIABLE_H #include "mi/mi.h" #include #include class CreateVarobjHandler; class FetchMoreChildrenHandler; class SetFormatHandler; namespace KDevMI { class MIDebugSession; class MIVariable : public KDevelop::Variable { + Q_OBJECT + + public: MIVariable(MIDebugSession *session, KDevelop::TreeModel* model, KDevelop::TreeItem* parent, const QString& expression, const QString& display = QLatin1String("")); ~MIVariable(); /* FIXME: should eventually remove, so that existence of varobjs is fully encapsulalated inside GdbVariable. */ const QString& varobj() const; void handleUpdate(const MI::Value& var); /* Called when debugger dies. Clears the association between varobj names and Variable instances. */ void markAsDead(); bool canSetFormat() const override { return true; } protected: // Variable overrides void attachMaybe(QObject *callback, const char *callbackMethod) override; void fetchMoreChildren() override; void formatChanged() override; protected: // Internal friend class ::CreateVarobjHandler; friend class ::FetchMoreChildrenHandler; friend class ::SetFormatHandler; /** * Construct a MIVariable child directly from a MI value */ MIVariable *createChild(const MI::Value &child); QString enquotedExpression() const; virtual QString formatValue(const QString &rawValue) const; bool sessionIsAlive() const; void setVarobj(const QString& v); QString varobj_; QPointer debugSession; // How many children should be fetched in one // increment. static const int fetchStep = 5; }; } // end of KDevMI #endif diff --git a/debuggers/common/mivariablecontroller.h b/debuggers/common/mivariablecontroller.h index 640c455d86..65129318ea 100644 --- a/debuggers/common/mivariablecontroller.h +++ b/debuggers/common/mivariablecontroller.h @@ -1,78 +1,78 @@ /* * Variable controller implementation common to MI based debugger * * Copyright 2007 Hamish Rodda * Copyright 2008 Vladimir Prus * Copyright 2009 Niko Sams * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MIVARIABLECONTROLLER_H #define MIVARIABLECONTROLLER_H #include "dbgglobal.h" #include namespace KDevMI { namespace MI { struct AsyncRecord; struct ResultRecord; struct Value; } class MIDebugSession; class MIVariableController : public KDevelop::IVariableController { Q_OBJECT public: explicit MIVariableController( MIDebugSession* parent); KDevelop::Variable* createVariable(KDevelop::TreeModel* model, KDevelop::TreeItem* parent, const QString& expression, - const QString& display = QLatin1String(QLatin1String(""))) override; + const QString& display = {}) override; KTextEditor::Range expressionRangeUnderCursor(KTextEditor::Document* doc, const KTextEditor::Cursor& cursor) override; void addWatch(KDevelop::Variable* variable) override; void addWatchpoint(KDevelop::Variable* variable) override; void update() override; protected: void updateLocals(); private slots: void programStopped(const MI::AsyncRecord &r); void stateChanged(KDevelop::IDebugSession::DebuggerState); private: MIDebugSession* debugSession() const; void handleVarUpdate(const MI::ResultRecord& r); void addWatch(const MI::ResultRecord& r); void addWatchpoint(const MI::ResultRecord& r); void handleEvent(KDevelop::IDebugSession::event_t event) override; }; } // end of namespace KDevMI #endif // MIVARIABLECONTROLLER_H diff --git a/debuggers/common/registers/registercontroller_arm.h b/debuggers/common/registers/registercontroller_arm.h index 4caaed9d35..0a5c2efa5b 100644 --- a/debuggers/common/registers/registercontroller_arm.h +++ b/debuggers/common/registers/registercontroller_arm.h @@ -1,71 +1,73 @@ /* * Class to fetch/change/send registers to the debugger for arm architecture. * Copyright 2013 Vlas Puhov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ #ifndef REGISTERCONTROLLER_ARM_H #define REGISTERCONTROLLER_ARM_H #include "registercontroller.h" namespace KDevMI { class MIDebugSession; class RegisterController_Arm : public IRegisterController { + Q_OBJECT + public: explicit RegisterController_Arm(MIDebugSession* debugSession = nullptr, QObject* parent = nullptr); QVector namesOfRegisterGroups() const override; public slots: void updateRegisters(const GroupsName& group = GroupsName()) override; protected: RegistersGroup registersFromGroup(const GroupsName& group) const override; QStringList registerNamesForGroup(const GroupsName& group) const override; void updateValuesForRegisters(RegistersGroup* registers) const override; void setRegisterValueForGroup(const GroupsName& group, const Register& reg) override; enum ArmRegisterGroups {General, Flags, VFP_single, VFP_double, VFP_quad, LAST_REGISTER}; GroupsName enumToGroupName(ArmRegisterGroups group) const; //None of functions below checks value for validity, if value is invalid updateRegistres() will restore the previous state. void setVFPS_Register(const Register& reg); void setVFPD_Register(const Register& reg); void setVFPQ_Register(const Register& reg); static QVector m_registerNames; private: void initRegisterNames(); static FlagRegister m_cpsr; bool m_registerNamesInitialized; }; } // end of namespace KDevMI #endif // REGISTERCONTROLLER_ARM_H diff --git a/debuggers/common/registers/registercontroller_x86.h b/debuggers/common/registers/registercontroller_x86.h index a2fa74fcb1..71cfad2e2c 100644 --- a/debuggers/common/registers/registercontroller_x86.h +++ b/debuggers/common/registers/registercontroller_x86.h @@ -1,92 +1,96 @@ /* * Class to fetch/change/send registers to the debugger for x86, x86_64 architectures. * Copyright 2013 Vlas Puhov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * */ #ifndef REGISTERCONTROLLER_X86_H #define REGISTERCONTROLLER_X86_H #include "registercontroller.h" namespace KDevMI { class MIDebugSession; class RegisterControllerGeneral_x86 : public IRegisterController { + Q_OBJECT + public: QVector namesOfRegisterGroups() const override; public slots: void updateRegisters(const GroupsName& group = GroupsName()) override; protected: explicit RegisterControllerGeneral_x86(MIDebugSession* debugSession = nullptr, QObject* parent = nullptr); RegistersGroup registersFromGroup(const GroupsName& group) const override; QStringList registerNamesForGroup(const GroupsName& group) const override; void updateValuesForRegisters(RegistersGroup* registers) const override; void setRegisterValueForGroup(const GroupsName& group, const Register& reg) override; enum X86RegisterGroups {General, Flags, FPU, XMM, Segment, LAST_REGISTER}; GroupsName enumToGroupName(X86RegisterGroups group) const; //None of functions below checks value for validity, if value is invalid updateRegistres() will restore the previous state. void setFPURegister(const Register& reg); void setXMMRegister(const Register& reg); void setSegmentRegister(const Register& reg); void setEFfagRegister(const Register& reg); private: void initRegisterNames();; protected: static QVector m_registerNames; static FlagRegister m_eflags; ///Indicates if register names were initialized. bool m_registerNamesInitialized; }; class RegisterController_x86 : public RegisterControllerGeneral_x86 { + Q_OBJECT public: explicit RegisterController_x86(MIDebugSession* debugSession = nullptr, QObject* parent = nullptr); private: void initRegisterNames(); }; class RegisterController_x86_64 : public RegisterControllerGeneral_x86 { + Q_OBJECT public: explicit RegisterController_x86_64(MIDebugSession* debugSession = nullptr, QObject* parent = nullptr); private: void initRegisterNames(); }; } // end of namespace KDevMI #endif // REGISTERCONTROLLER_X86_H diff --git a/debuggers/common/widgets/disassemblewidget.h b/debuggers/common/widgets/disassemblewidget.h index 96d0aeb205..e8d32efa20 100644 --- a/debuggers/common/widgets/disassemblewidget.h +++ b/debuggers/common/widgets/disassemblewidget.h @@ -1,172 +1,174 @@ /* * GDB Debugger Support * * Copyright 1999 John Birch * Copyright 2007 Hamish Rodda * Copyright 2013 Vlas Puhov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _DISASSEMBLEWIDGET_H_ #define _DISASSEMBLEWIDGET_H_ #include "mi/mi.h" #include #include #include #include "ui_selectaddressdialog.h" /***************************************************************************/ /***************************************************************************/ /***************************************************************************/ class QSplitter; namespace KDevelop { class IDebugSession; } namespace KDevMI { class RegistersManager; class SelectAddressDialog : public QDialog { Q_OBJECT public: explicit SelectAddressDialog(QWidget *parent = nullptr); QString address() const; void setAddress(const QString& address); bool hasValidAddress() const; void updateOkState(); private Q_SLOTS: void validateInput(); void itemSelected(); private: Ui::SelectAddressDialog m_ui; }; class DisassembleWidget; enum DisassemblyFlavor { DisassemblyFlavorUnknown = -1, DisassemblyFlavorATT = 0, DisassemblyFlavorIntel, }; class DisassembleWindow : public QTreeWidget { + Q_OBJECT + public: DisassembleWindow(QWidget *parent, DisassembleWidget* widget); void setDisassemblyFlavor(DisassemblyFlavor flavor); protected: void contextMenuEvent(QContextMenuEvent *e) override; private: QAction* m_selectAddrAction; QAction* m_jumpToLocation; QAction* m_runUntilCursor; QAction* m_disassemblyFlavorAtt; QAction* m_disassemblyFlavorIntel; QActionGroup* m_disassemblyFlavorActionGroup; }; class MIDebuggerPlugin; class DisassembleWidget : public QWidget { Q_OBJECT public: enum Columns { Icon, Address, Function, Instruction, ColumnCount }; explicit DisassembleWidget( MIDebuggerPlugin* plugin, QWidget *parent=nullptr ); ~DisassembleWidget() override; Q_SIGNALS: void requestRaise(); public Q_SLOTS: void slotActivate(bool activate); void slotDeactivate(); void slotShowStepInSource(const QUrl &fileName, int lineNum, const QString &address); void slotChangeAddress(); ///Disassembles code at @p address and updates registers void update(const QString &address); void jumpToCursor(); void runToCursor(); void setDisassemblyFlavor(QAction* action); private Q_SLOTS: void currentSessionChanged(KDevelop::IDebugSession* session); protected: void showEvent(QShowEvent*) override; void hideEvent(QHideEvent*) override; void enableControls(bool enabled); private: bool displayCurrent(); void updateDisassemblyFlavor(); /// Disassembles memory region from..to /// if from is empty current execution position is used /// if to is empty, 256 bytes range is taken void disassembleMemoryRegion(const QString& from=QString(), const QString& to=QString() ); /// callbacks for GDBCommands void disassembleMemoryHandler(const MI::ResultRecord& r); void updateExecutionAddressHandler(const MI::ResultRecord& r); void setDisassemblyFlavorHandler(const MI::ResultRecord& r); void showDisassemblyFlavorHandler(const MI::ResultRecord& r); //for str to uint conversion. bool ok; bool active_; unsigned long lower_; unsigned long upper_; unsigned long address_; RegistersManager* m_registersManager ; DisassembleWindow * m_disassembleWindow; SelectAddressDialog* m_dlg; KConfigGroup m_config; QSplitter *m_splitter; }; } // end of namespace KDevMI #endif diff --git a/debuggers/lldb/debuggerplugin.h b/debuggers/lldb/debuggerplugin.h index 952bdd9480..253dee55d1 100644 --- a/debuggers/lldb/debuggerplugin.h +++ b/debuggers/lldb/debuggerplugin.h @@ -1,74 +1,76 @@ /* * LLDB Debugger Support * Copyright 2016 Aetf * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef LLDB_DEBUGGERPLUGIN_H #define LLDB_DEBUGGERPLUGIN_H #include "midebuggerplugin.h" #include "debugsession.h" #include "widgets/debuggerconsoleview.h" #include "widgets/disassemblewidget.h" namespace KDevMI { namespace LLDB { class LldbLauncher; class NonInterruptDebuggerConsoleView : public DebuggerConsoleView { + Q_OBJECT + public: explicit NonInterruptDebuggerConsoleView(MIDebuggerPlugin *plugin, QWidget *parent = nullptr) : DebuggerConsoleView(plugin, parent) { setShowInterrupt(false); setReplacePrompt(QStringLiteral("(lldb)")); } }; class LldbDebuggerPlugin : public MIDebuggerPlugin { Q_OBJECT public: friend class KDevMI::LLDB::DebugSession; explicit LldbDebuggerPlugin(QObject *parent, const QVariantList & = QVariantList()); ~LldbDebuggerPlugin() override; void unload() override; DebugSession *createSession() override; void unloadToolviews() override; void setupToolviews() override; private: void setupExecutePlugin(KDevelop::IPlugin* plugin, bool load); DebuggerToolFactory *m_consoleFactory; DebuggerToolFactory *m_disassembleFactory; QHash m_launchers; }; } // end of namespace LLDB } // end of namespace KDevMI #endif // LLDB_DEBUGGERPLUGIN_H