diff options
| author | Ilia K <ki.stfu@gmail.com> | 2015-03-23 20:49:51 +0000 |
|---|---|---|
| committer | Ilia K <ki.stfu@gmail.com> | 2015-03-23 20:49:51 +0000 |
| commit | fd77f8cf80bb3eef670c0dbb8a74ed7f06dd62f8 (patch) | |
| tree | 5542367fac653527a2878aa685b3ab8e57764ae2 /lldb/tools/lldb-mi/MICmdCmdGdbSet.cpp | |
| parent | e771b59017ab2f22687013de35c611df324cc78f (diff) | |
| download | bcm5719-llvm-fd77f8cf80bb3eef670c0dbb8a74ed7f06dd62f8.tar.gz bcm5719-llvm-fd77f8cf80bb3eef670c0dbb8a74ed7f06dd62f8.zip | |
Add target-async option in -gdb-set command (MI)
llvm-svn: 233018
Diffstat (limited to 'lldb/tools/lldb-mi/MICmdCmdGdbSet.cpp')
| -rw-r--r-- | lldb/tools/lldb-mi/MICmdCmdGdbSet.cpp | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/lldb/tools/lldb-mi/MICmdCmdGdbSet.cpp b/lldb/tools/lldb-mi/MICmdCmdGdbSet.cpp index 169d60cb9e1..44cc9551133 100644 --- a/lldb/tools/lldb-mi/MICmdCmdGdbSet.cpp +++ b/lldb/tools/lldb-mi/MICmdCmdGdbSet.cpp @@ -20,7 +20,7 @@ // Instantiations: const CMICmdCmdGdbSet::MapGdbOptionNameToFnGdbOptionPtr_t CMICmdCmdGdbSet::ms_mapGdbOptionNameToFnGdbOptionPtr = { - // { "target-async", &CMICmdCmdGdbSet::OptionFnTargetAsync }, // Example code if need to implement GDB set other options + {"target-async", &CMICmdCmdGdbSet::OptionFnTargetAsync}, // { "auto-solib-add", &CMICmdCmdGdbSet::OptionFnAutoSolibAdd }, // Example code if need to implement GDB set other options {"solib-search-path", &CMICmdCmdGdbSet::OptionFnSolibSearchPath}, {"fallback", &CMICmdCmdGdbSet::OptionFnFallback}}; @@ -210,6 +210,50 @@ CMICmdCmdGdbSet::GetOptionFn(const CMIUtilString &vrPrintFnName, FnGdbOptionPtr } //++ ------------------------------------------------------------------------------------ +// Details: Carry out work to complete the GDB set option 'target-async' to prepare +// and send back information asked for. +// Type: Method. +// Args: vrWords - (R) List of additional parameters used by this option. +// Return: MIstatus::success - Function succeeded. +// MIstatus::failure - Function failed. +// Throws: None. +//-- +bool +CMICmdCmdGdbSet::OptionFnTargetAsync(const CMIUtilString::VecString_t &vrWords) +{ + bool bAsyncMode; + bool bOk = true; + + if (vrWords.size() > 1) + // Too many arguments. + bOk = false; + else if (vrWords.size() == 0) + // If no arguments, default is "on". + bAsyncMode = true; + else if (CMIUtilString::Compare(vrWords[0], "on")) + bAsyncMode = true; + else if (CMIUtilString::Compare(vrWords[0], "off")) + bAsyncMode = false; + else + // Unrecognized argument. + bOk = false; + + if (!bOk) + { + // Report error. + m_bGbbOptionFnHasError = true; + m_strGdbOptionFnError = MIRSRC(IDS_CMD_ERR_GDBSET_OPT_TARGETASYNC); + return MIstatus::failure; + } + + // Turn async mode on/off. + CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance()); + rSessionInfo.GetDebugger().SetAsync(bAsyncMode); + + return MIstatus::success; +} + +//++ ------------------------------------------------------------------------------------ // Details: Carry out work to complete the GDB set option 'solib-search-path' to prepare // and send back information asked for. // Type: Method. |

