aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/include/lldb/Interpreter/CommandInterpreter.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lldb/include/lldb/Interpreter/CommandInterpreter.h')
-rw-r--r--contrib/llvm-project/lldb/include/lldb/Interpreter/CommandInterpreter.h41
1 files changed, 38 insertions, 3 deletions
diff --git a/contrib/llvm-project/lldb/include/lldb/Interpreter/CommandInterpreter.h b/contrib/llvm-project/lldb/include/lldb/Interpreter/CommandInterpreter.h
index 8a9dce7a19bc..c4f9dd2fdb37 100644
--- a/contrib/llvm-project/lldb/include/lldb/Interpreter/CommandInterpreter.h
+++ b/contrib/llvm-project/lldb/include/lldb/Interpreter/CommandInterpreter.h
@@ -20,6 +20,7 @@
#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/Event.h"
#include "lldb/Utility/Log.h"
+#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/StringList.h"
#include "lldb/lldb-forward.h"
#include "lldb/lldb-private.h"
@@ -255,7 +256,7 @@ public:
}
void SourceInitFileCwd(CommandReturnObject &result);
- void SourceInitFileHome(CommandReturnObject &result);
+ void SourceInitFileHome(CommandReturnObject &result, bool is_repl = false);
bool AddCommand(llvm::StringRef name, const lldb::CommandObjectSP &cmd_sp,
bool can_replace);
@@ -264,7 +265,7 @@ public:
bool can_replace);
lldb::CommandObjectSP GetCommandSPExact(llvm::StringRef cmd,
- bool include_aliases) const;
+ bool include_aliases = false) const;
CommandObject *GetCommandObject(llvm::StringRef cmd,
StringList *matches = nullptr,
@@ -350,6 +351,10 @@ public:
CommandObject *GetCommandObjectForCommand(llvm::StringRef &command_line);
+ /// Returns the auto-suggestion string that should be added to the given
+ /// command line.
+ llvm::Optional<std::string> GetAutoSuggestionForCommand(llvm::StringRef line);
+
// This handles command line completion.
void HandleCompletion(CompletionRequest &request);
@@ -485,9 +490,11 @@ public:
bool GetExpandRegexAliases() const;
bool GetPromptOnQuit() const;
-
void SetPromptOnQuit(bool enable);
+ bool GetSaveSessionOnQuit() const;
+ void SetSaveSessionOnQuit(bool enable);
+
bool GetEchoCommands() const;
void SetEchoCommands(bool enable);
@@ -498,6 +505,12 @@ public:
return m_user_dict;
}
+ const CommandObject::CommandMap &GetCommands() const {
+ return m_command_dict;
+ }
+
+ const CommandObject::CommandMap &GetAliases() const { return m_alias_dict; }
+
/// Specify if the command interpreter should allow that the user can
/// specify a custom exit code when calling 'quit'.
void AllowExitCodeOnQuit(bool allow);
@@ -526,6 +539,20 @@ public:
bool GetSpaceReplPrompts() const;
+ /// Save the current debugger session transcript to a file on disk.
+ /// \param output_file
+ /// The file path to which the session transcript will be written. Since
+ /// the argument is optional, an arbitrary temporary file will be create
+ /// when no argument is passed.
+ /// \param result
+ /// This is used to pass function output and error messages.
+ /// \return \b true if the session transcript was successfully written to
+ /// disk, \b false otherwise.
+ bool SaveTranscript(CommandReturnObject &result,
+ llvm::Optional<std::string> output_file = llvm::None);
+
+ FileSpec GetCurrentSourceDir();
+
protected:
friend class Debugger;
@@ -612,7 +639,13 @@ private:
ChildrenTruncatedWarningStatus m_truncation_warning; // Whether we truncated
// children and whether
// the user has been told
+
+ // FIXME: Stop using this to control adding to the history and then replace
+ // this with m_command_source_dirs.size().
uint32_t m_command_source_depth;
+ /// A stack of directory paths. When not empty, the last one is the directory
+ /// of the file that's currently sourced.
+ std::vector<FileSpec> m_command_source_dirs;
std::vector<uint32_t> m_command_source_flags;
CommandInterpreterRunResult m_result;
@@ -621,6 +654,8 @@ private:
llvm::Optional<int> m_quit_exit_code;
// If the driver is accepts custom exit codes for the 'quit' command.
bool m_allow_exit_code = false;
+
+ StreamString m_transcript_stream;
};
} // namespace lldb_private