diff options
Diffstat (limited to 'lldb/source/Plugins/Process')
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 58 | ||||
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h | 5 |
2 files changed, 60 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 215e885ed66..a0658ab4f5b 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -196,7 +196,8 @@ ProcessGDBRemote::ProcessGDBRemote(Target& target, Listener &listener) : m_waiting_for_attach (false), m_destroy_tried_resuming (false), m_dyld_plugin_name(), - m_kernel_load_addr (LLDB_INVALID_ADDRESS) + m_kernel_load_addr (LLDB_INVALID_ADDRESS), + m_command_sp () { m_async_broadcaster.SetEventName (eBroadcastBitAsyncThreadShouldExit, "async thread should exit"); m_async_broadcaster.SetEventName (eBroadcastBitAsyncContinue, "async thread continue"); @@ -3013,3 +3014,58 @@ ProcessGDBRemote::GetDynamicLoader () return m_dyld_ap.get(); } +#include "lldb/Interpreter/CommandObject.h" +#include "lldb/Interpreter/CommandObjectMultiword.h" + +class CommandObjectProcessGDBRemotePacket : public CommandObjectParsed +{ +private: + +public: + CommandObjectProcessGDBRemotePacket(CommandInterpreter &interpreter) : + CommandObjectParsed (interpreter, + "process plugin packet", + "Send a custom packet through the GDB remote protocol and print the answer.", + NULL) + { + } + + ~CommandObjectProcessGDBRemotePacket () + { + } + + bool + DoExecute (Args& command, CommandReturnObject &result) + { + printf ("CommandObjectProcessGDBRemotePacket::DoExecute() called!!!\n"); + return true; + } +}; + + +class CommandObjectMultiwordProcessGDBRemote : public CommandObjectMultiword +{ +public: + CommandObjectMultiwordProcessGDBRemote (CommandInterpreter &interpreter) : + CommandObjectMultiword (interpreter, + "process plugin", + "A set of commands for operating on a ProcessGDBRemote process.", + "process plugin <subcommand> [<subcommand-options>]") + { + LoadSubCommand ("packet", CommandObjectSP (new CommandObjectProcessGDBRemotePacket (interpreter))); + } + + ~CommandObjectMultiwordProcessGDBRemote () + { + } +}; + + + +CommandObject * +ProcessGDBRemote::GetPluginCommandObject() +{ + if (!m_command_sp) + m_command_sp.reset (new CommandObjectMultiwordProcessGDBRemote (GetTarget().GetDebugger().GetCommandInterpreter())); + return m_command_sp.get(); +} diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h index 82f840d69ff..5c642d44597 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -71,8 +71,8 @@ public: CanDebug (lldb_private::Target &target, bool plugin_specified_by_name); -// virtual uint32_t -// ListProcessesMatchingName (const char *name, lldb_private::StringList &matches, std::vector<lldb::pid_t> &pids); + virtual lldb_private::CommandObject * + GetPluginCommandObject(); //------------------------------------------------------------------ // Creating a new process, or attaching to an existing one @@ -331,6 +331,7 @@ protected: bool m_destroy_tried_resuming; std::string m_dyld_plugin_name; lldb::addr_t m_kernel_load_addr; + lldb::CommandObjectSP m_command_sp; bool StartAsyncThread (); |

