diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-24 22:00:03 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-24 22:00:03 +0000 |
commit | 480093f4440d54b30b3025afeac24b48f2ba7a2e (patch) | |
tree | 162e72994062888647caf0d875428db9445491a8 /contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp | |
parent | 489b1cf2ecf5b9b4a394857987014bfb09067726 (diff) | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) |
Notes
Diffstat (limited to 'contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r-- | contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp b/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp index 0c059096c6cd..1ee80503f569 100644 --- a/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp @@ -48,7 +48,8 @@ #include "lldb/Utility/Stream.h" #include "lldb/Utility/Timer.h" -#ifndef LLDB_DISABLE_LIBEDIT +#include "lldb/Host/Config.h" +#if LLDB_ENABLE_LIBEDIT #include "lldb/Host/Editline.h" #endif #include "lldb/Host/Host.h" @@ -137,9 +138,9 @@ bool CommandInterpreter::GetPromptOnQuit() const { nullptr, idx, g_interpreter_properties[idx].default_uint_value != 0); } -void CommandInterpreter::SetPromptOnQuit(bool b) { +void CommandInterpreter::SetPromptOnQuit(bool enable) { const uint32_t idx = ePropertyPromptOnQuit; - m_collection_sp->SetPropertyAtIndexAsBoolean(nullptr, idx, b); + m_collection_sp->SetPropertyAtIndexAsBoolean(nullptr, idx, enable); } bool CommandInterpreter::GetEchoCommands() const { @@ -148,9 +149,9 @@ bool CommandInterpreter::GetEchoCommands() const { nullptr, idx, g_interpreter_properties[idx].default_uint_value != 0); } -void CommandInterpreter::SetEchoCommands(bool b) { +void CommandInterpreter::SetEchoCommands(bool enable) { const uint32_t idx = ePropertyEchoCommands; - m_collection_sp->SetPropertyAtIndexAsBoolean(nullptr, idx, b); + m_collection_sp->SetPropertyAtIndexAsBoolean(nullptr, idx, enable); } bool CommandInterpreter::GetEchoCommentCommands() const { @@ -159,9 +160,9 @@ bool CommandInterpreter::GetEchoCommentCommands() const { nullptr, idx, g_interpreter_properties[idx].default_uint_value != 0); } -void CommandInterpreter::SetEchoCommentCommands(bool b) { +void CommandInterpreter::SetEchoCommentCommands(bool enable) { const uint32_t idx = ePropertyEchoCommentCommands; - m_collection_sp->SetPropertyAtIndexAsBoolean(nullptr, idx, b); + m_collection_sp->SetPropertyAtIndexAsBoolean(nullptr, idx, enable); } void CommandInterpreter::AllowExitCodeOnQuit(bool allow) { @@ -362,10 +363,23 @@ void CommandInterpreter::Initialize() { "controlled by the type's author."); po->SetHelpLong(""); } - AddAlias("parray", cmd_obj_sp, "--element-count %1 --")->SetHelpLong(""); - AddAlias("poarray", cmd_obj_sp, - "--object-description --element-count %1 --") - ->SetHelpLong(""); + CommandAlias *parray_alias = + AddAlias("parray", cmd_obj_sp, "--element-count %1 --"); + if (parray_alias) { + parray_alias->SetHelp + ("parray <COUNT> <EXPRESSION> -- lldb will evaluate EXPRESSION " + "to get a typed-pointer-to-an-array in memory, and will display " + "COUNT elements of that type from the array."); + parray_alias->SetHelpLong(""); + } + CommandAlias *poarray_alias = AddAlias("poarray", cmd_obj_sp, + "--object-description --element-count %1 --"); + if (poarray_alias) { + poarray_alias->SetHelp("poarray <COUNT> <EXPRESSION> -- lldb will " + "evaluate EXPRESSION to get the address of an array of COUNT " + "objects in memory, and will call po on them."); + poarray_alias->SetHelpLong(""); + } } cmd_obj_sp = GetCommandSPExact("process kill", false); @@ -2825,8 +2839,7 @@ bool CommandInterpreter::IOHandlerInterrupt(IOHandler &io_handler) { } void CommandInterpreter::GetLLDBCommandsFromIOHandler( - const char *prompt, IOHandlerDelegate &delegate, bool asynchronously, - void *baton) { + const char *prompt, IOHandlerDelegate &delegate, void *baton) { Debugger &debugger = GetDebugger(); IOHandlerSP io_handler_sp( new IOHandlerEditline(debugger, IOHandler::Type::CommandList, @@ -2841,16 +2854,12 @@ void CommandInterpreter::GetLLDBCommandsFromIOHandler( if (io_handler_sp) { io_handler_sp->SetUserData(baton); - if (asynchronously) - debugger.PushIOHandler(io_handler_sp); - else - debugger.RunIOHandler(io_handler_sp); + debugger.PushIOHandler(io_handler_sp); } } void CommandInterpreter::GetPythonCommandsFromIOHandler( - const char *prompt, IOHandlerDelegate &delegate, bool asynchronously, - void *baton) { + const char *prompt, IOHandlerDelegate &delegate, void *baton) { Debugger &debugger = GetDebugger(); IOHandlerSP io_handler_sp( new IOHandlerEditline(debugger, IOHandler::Type::PythonCode, @@ -2865,10 +2874,7 @@ void CommandInterpreter::GetPythonCommandsFromIOHandler( if (io_handler_sp) { io_handler_sp->SetUserData(baton); - if (asynchronously) - debugger.PushIOHandler(io_handler_sp); - else - debugger.RunIOHandler(io_handler_sp); + debugger.PushIOHandler(io_handler_sp); } } |