Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Add a --synchronous option to lldb-mi to facilitate reliable testing.
Browse files Browse the repository at this point in the history
Patch by Alexander Polyakov!

Differential Revision: https://reviews.llvm.org/D47110

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@333140 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
adrian-prantl committed May 23, 2018
1 parent 4398602 commit 46982f2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/lldb-mi/MICmnResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ const CMICmnResources::SRsrcTextData
{IDE_MI_APP_ARG_EXECUTABLE, "executable (NOT IMPLEMENTED)\n\tThe file "
"path to the executable i.e. '\"C:\\My "
"Dev\\foo.exe\"'."},
{IDE_MI_APP_ARG_SYNCHRONOUS, "--synchronous\n\tBlock until each command "
"has finished executing.\n\tUsed for testing only."},
{IDS_STDIN_ERR_INVALID_PROMPT,
"Stdin. Invalid prompt description '%s'"},
{IDS_STDIN_ERR_THREAD_CREATION_FAILED,
Expand Down
1 change: 1 addition & 0 deletions tools/lldb-mi/MICmnResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ enum {
IDE_MI_APP_ARG_APP_LOG_DIR,
IDE_MI_APP_ARG_EXAMPLE,
IDE_MI_APP_ARG_EXECUTABLE,
IDE_MI_APP_ARG_SYNCHRONOUS,

IDS_STDIN_ERR_INVALID_PROMPT,
IDS_STDIN_ERR_THREAD_CREATION_FAILED,
Expand Down
4 changes: 4 additions & 0 deletions tools/lldb-mi/MIDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ lldb::SBError CMIDriver::DoParseArgs(const int argc, const char *argv[],
// that are only handled by *this driver:
// --executable <file>
// --source <file> or -s <file>
// --synchronous
// The application's options --interpreter and --executable in code act
// very similar.
// The --executable is necessary to differentiate whether the MI Driver
Expand All @@ -397,6 +398,7 @@ lldb::SBError CMIDriver::DoParseArgs(const int argc, const char *argv[],
// argument for a debug session. Using --interpreter on the command
// line does not
// issue additional commands to initialise a debug session.
// Option --synchronous disables an asynchronous mode in the lldb-mi driver.
// Type: Overridden.
// Args: argc - (R) An integer that contains the count of arguments
// that follow in
Expand Down Expand Up @@ -469,6 +471,8 @@ lldb::SBError CMIDriver::ParseArgs(const int argc, const char *argv[],
// command line
{ // See fn description.
bHaveExecutableLongOption = true;
} else if (strArg.compare("--synchronous") == 0) {
CMICmnLLDBDebugSessionInfo::Instance().GetDebugger().SetAsync(false);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions tools/lldb-mi/MIDriverMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ CMIUtilString CMIDriverMgr::GetHelpOnCmdLineArgOptions() const {
MIRSRC(IDE_MI_APP_ARG_VERSION), MIRSRC(IDE_MI_APP_ARG_VERSION_LONG),
MIRSRC(IDE_MI_APP_ARG_INTERPRETER), MIRSRC(IDE_MI_APP_ARG_SOURCE),
MIRSRC(IDE_MI_APP_ARG_EXECUTEABLE),
MIRSRC(IDE_MI_APP_ARG_SYNCHRONOUS),
CMIUtilString::Format(
MIRSRC(IDE_MI_APP_ARG_APP_LOG),
CMICmnLogMediumFile::Instance().GetFileName().c_str()),
Expand Down

0 comments on commit 46982f2

Please sign in to comment.