diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-13 19:18:16 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-13 19:18:16 +0000 |
commit | 63af2d73a95ba6749922d557e2ec6f77fe13f115 (patch) | |
tree | 4b21759e5a6e894301a01720e99f9519e7bc76b9 /lldb/tools | |
parent | bd2b94d8af0184bdcce92276e7518b5f82fcd39b (diff) |
Add GDB remote packet reproducer.
Diffstat (limited to 'lldb/tools')
-rw-r--r-- | lldb/tools/driver/Driver.cpp | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp index 835f1d990d1..5b129e7559e 100644 --- a/lldb/tools/driver/Driver.cpp +++ b/lldb/tools/driver/Driver.cpp @@ -120,19 +120,23 @@ static constexpr OptionDefinition g_options[] = { "Tells the debugger to execute this one-line lldb command after any file " "provided on the command line has been loaded."}, {LLDB_3_TO_5, false, "source-before-file", 'S', required_argument, 0, - eArgTypeFilename, "Tells the debugger to read in and execute the lldb " - "commands in the given file, before any file provided " - "on the command line has been loaded."}, + eArgTypeFilename, + "Tells the debugger to read in and execute the lldb " + "commands in the given file, before any file provided " + "on the command line has been loaded."}, {LLDB_3_TO_5, false, "one-line-before-file", 'O', required_argument, 0, - eArgTypeNone, "Tells the debugger to execute this one-line lldb command " - "before any file provided on the command line has been " - "loaded."}, + eArgTypeNone, + "Tells the debugger to execute this one-line lldb command " + "before any file provided on the command line has been " + "loaded."}, {LLDB_3_TO_5, false, "one-line-on-crash", 'k', required_argument, 0, - eArgTypeNone, "When in batch mode, tells the debugger to execute this " - "one-line lldb command if the target crashes."}, + eArgTypeNone, + "When in batch mode, tells the debugger to execute this " + "one-line lldb command if the target crashes."}, {LLDB_3_TO_5, false, "source-on-crash", 'K', required_argument, 0, - eArgTypeFilename, "When in batch mode, tells the debugger to source this " - "file of lldb commands if the target crashes."}, + eArgTypeFilename, + "When in batch mode, tells the debugger to source this " + "file of lldb commands if the target crashes."}, {LLDB_3_TO_5, false, "source-quietly", 'Q', no_argument, 0, eArgTypeNone, "Tells the debugger to execute this one-line lldb command before any file " "provided on the command line has been loaded."}, @@ -159,6 +163,9 @@ static constexpr OptionDefinition g_options[] = { "extensions have been implemented."}, {LLDB_3_TO_5, false, "debug", 'd', no_argument, 0, eArgTypeNone, "Tells the debugger to print out extra information for debugging itself."}, + {LLDB_3_TO_5, false, "reproducer", 'z', required_argument, 0, + eArgTypeFilename, + "Tells the debugger to use the fullpath to <path> as a reproducer."}, {LLDB_OPT_SET_7, true, "repl", 'r', optional_argument, 0, eArgTypeNone, "Runs lldb in REPL mode with a stub process."}, {LLDB_OPT_SET_7, true, "repl-language", 'R', required_argument, 0, @@ -724,6 +731,16 @@ SBError Driver::ParseArgs(int argc, const char *argv[], FILE *out_fh, m_option_data.m_debug_mode = true; break; + case 'z': { + SBFileSpec file(optarg); + if (file.Exists()) { + m_debugger.SetReproducerPath(optarg); + } else + error.SetErrorStringWithFormat("file specified in --reproducer " + "(-z) option doesn't exist: '%s'", + optarg); + } break; + case 'Q': m_option_data.m_source_quietly = true; break; |