summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia K <ki.stfu@gmail.com>2015-03-23 20:49:51 +0000
committerIlia K <ki.stfu@gmail.com>2015-03-23 20:49:51 +0000
commitfd77f8cf80bb3eef670c0dbb8a74ed7f06dd62f8 (patch)
tree5542367fac653527a2878aa685b3ab8e57764ae2
parente771b59017ab2f22687013de35c611df324cc78f (diff)
downloadbcm5719-llvm-fd77f8cf80bb3eef670c0dbb8a74ed7f06dd62f8.tar.gz
bcm5719-llvm-fd77f8cf80bb3eef670c0dbb8a74ed7f06dd62f8.zip
Add target-async option in -gdb-set command (MI)
llvm-svn: 233018
-rw-r--r--lldb/tools/lldb-mi/MICmdCmdGdbSet.cpp46
-rw-r--r--lldb/tools/lldb-mi/MICmdCmdGdbSet.h1
-rw-r--r--lldb/tools/lldb-mi/MICmnResources.cpp1
-rw-r--r--lldb/tools/lldb-mi/MICmnResources.h1
4 files changed, 48 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.
diff --git a/lldb/tools/lldb-mi/MICmdCmdGdbSet.h b/lldb/tools/lldb-mi/MICmdCmdGdbSet.h
index f0840026a29..d9684bd9316 100644
--- a/lldb/tools/lldb-mi/MICmdCmdGdbSet.h
+++ b/lldb/tools/lldb-mi/MICmdCmdGdbSet.h
@@ -69,6 +69,7 @@ class CMICmdCmdGdbSet : public CMICmdBase
// Methods:
private:
bool GetOptionFn(const CMIUtilString &vrGdbOptionName, FnGdbOptionPtr &vrwpFn) const;
+ bool OptionFnTargetAsync(const CMIUtilString::VecString_t &vrWords);
bool OptionFnSolibSearchPath(const CMIUtilString::VecString_t &vrWords);
bool OptionFnFallback(const CMIUtilString::VecString_t &vrWords);
diff --git a/lldb/tools/lldb-mi/MICmnResources.cpp b/lldb/tools/lldb-mi/MICmnResources.cpp
index 784847cd089..69420ba90d7 100644
--- a/lldb/tools/lldb-mi/MICmnResources.cpp
+++ b/lldb/tools/lldb-mi/MICmnResources.cpp
@@ -243,6 +243,7 @@ const CMICmnResources::SRsrcTextData CMICmnResources::ms_pResourceId2TextData[]
{IDS_CMD_ERR_SET_NEW_DRIVER_STATE, "Command '%s'. Command tried to set new MI Driver running state and failed. %s"},
{IDS_CMD_ERR_INFO_PRINTFN_NOT_FOUND, "The request '%s' was not recogised, not implemented"},
{IDS_CMD_ERR_INFO_PRINTFN_FAILED, "The request '%s' failed."},
+ {IDS_CMD_ERR_GDBSET_OPT_TARGETASYNC, "'target-async' expects \"on\" or \"off\""},
{IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH, "'solib-search-path' requires at least one argument"}};
//++ ------------------------------------------------------------------------------------
diff --git a/lldb/tools/lldb-mi/MICmnResources.h b/lldb/tools/lldb-mi/MICmnResources.h
index e1d8aea5456..68523034d18 100644
--- a/lldb/tools/lldb-mi/MICmnResources.h
+++ b/lldb/tools/lldb-mi/MICmnResources.h
@@ -261,6 +261,7 @@ enum
IDS_CMD_ERR_SET_NEW_DRIVER_STATE,
IDS_CMD_ERR_INFO_PRINTFN_NOT_FOUND,
IDS_CMD_ERR_INFO_PRINTFN_FAILED,
+ IDS_CMD_ERR_GDBSET_OPT_TARGETASYNC,
IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH
};
OpenPOWER on IntegriCloud