summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Debugger.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-08-02 00:18:44 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-08-02 00:18:44 +0000
commite063eccc19c51572db67cf0689b594b3e5dc4d9e (patch)
tree3a69932e0e8b111d36d4fa6a198b717c790ebd78 /lldb/source/Core/Debugger.cpp
parent12961ff0fad91d9e51329a1e59213499e33eb3a0 (diff)
downloadbcm5719-llvm-e063eccc19c51572db67cf0689b594b3e5dc4d9e.tar.gz
bcm5719-llvm-e063eccc19c51572db67cf0689b594b3e5dc4d9e.zip
Format OptionEnumValueElement (NFC)
Reformat OptionEnumValueElement to make it easier to distinguish between its fields. This also removes the need to disable clang-format for these arrays. Differential revision: https://reviews.llvm.org/D65489 llvm-svn: 367638
Diffstat (limited to 'lldb/source/Core/Debugger.cpp')
-rw-r--r--lldb/source/Core/Debugger.cpp102
1 files changed, 71 insertions, 31 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 5efe78635d2..83c91b84aee 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -93,22 +93,47 @@ static DebuggerList *g_debugger_list_ptr =
nullptr; // NOTE: intentional leak to avoid issues with C++ destructor chain
static constexpr OptionEnumValueElement g_show_disassembly_enum_values[] = {
- {Debugger::eStopDisassemblyTypeNever, "never",
- "Never show disassembly when displaying a stop context."},
- {Debugger::eStopDisassemblyTypeNoDebugInfo, "no-debuginfo",
- "Show disassembly when there is no debug information."},
- {Debugger::eStopDisassemblyTypeNoSource, "no-source",
- "Show disassembly when there is no source information, or the source file "
- "is missing when displaying a stop context."},
- {Debugger::eStopDisassemblyTypeAlways, "always",
- "Always show disassembly when displaying a stop context."} };
+ {
+ Debugger::eStopDisassemblyTypeNever,
+ "never",
+ "Never show disassembly when displaying a stop context.",
+ },
+ {
+ Debugger::eStopDisassemblyTypeNoDebugInfo,
+ "no-debuginfo",
+ "Show disassembly when there is no debug information.",
+ },
+ {
+ Debugger::eStopDisassemblyTypeNoSource,
+ "no-source",
+ "Show disassembly when there is no source information, or the source "
+ "file "
+ "is missing when displaying a stop context.",
+ },
+ {
+ Debugger::eStopDisassemblyTypeAlways,
+ "always",
+ "Always show disassembly when displaying a stop context.",
+ },
+};
static constexpr OptionEnumValueElement g_language_enumerators[] = {
- {eScriptLanguageNone, "none", "Disable scripting languages."},
- {eScriptLanguagePython, "python",
- "Select python as the default scripting language."},
- {eScriptLanguageDefault, "default",
- "Select the lldb default as the default scripting language."} };
+ {
+ eScriptLanguageNone,
+ "none",
+ "Disable scripting languages.",
+ },
+ {
+ eScriptLanguagePython,
+ "python",
+ "Select python as the default scripting language.",
+ },
+ {
+ eScriptLanguageDefault,
+ "default",
+ "Select the lldb default as the default scripting language.",
+ },
+};
#define MODULE_WITH_FUNC \
"{ " \
@@ -189,18 +214,32 @@ static constexpr OptionEnumValueElement g_language_enumerators[] = {
// without-args}}:\n}{${current-pc-arrow} }{${addr-file-or-load}}:
static constexpr OptionEnumValueElement s_stop_show_column_values[] = {
- {eStopShowColumnAnsiOrCaret, "ansi-or-caret",
- "Highlight the stop column with ANSI terminal codes when color/ANSI mode "
- "is enabled; otherwise, fall back to using a text-only caret (^) as if "
- "\"caret-only\" mode was selected."},
- {eStopShowColumnAnsi, "ansi", "Highlight the stop column with ANSI "
- "terminal codes when running LLDB with "
- "color/ANSI enabled."},
- {eStopShowColumnCaret, "caret",
- "Highlight the stop column with a caret character (^) underneath the stop "
- "column. This method introduces a new line in source listings that "
- "display thread stop locations."},
- {eStopShowColumnNone, "none", "Do not highlight the stop column."}};
+ {
+ eStopShowColumnAnsiOrCaret,
+ "ansi-or-caret",
+ "Highlight the stop column with ANSI terminal codes when color/ANSI "
+ "mode is enabled; otherwise, fall back to using a text-only caret (^) "
+ "as if \"caret-only\" mode was selected.",
+ },
+ {
+ eStopShowColumnAnsi,
+ "ansi",
+ "Highlight the stop column with ANSI terminal codes when running LLDB "
+ "with color/ANSI enabled.",
+ },
+ {
+ eStopShowColumnCaret,
+ "caret",
+ "Highlight the stop column with a caret character (^) underneath the "
+ "stop column. This method introduces a new line in source listings "
+ "that display thread stop locations.",
+ },
+ {
+ eStopShowColumnNone,
+ "none",
+ "Do not highlight the stop column.",
+ },
+};
#define LLDB_PROPERTIES_debugger
#include "CoreProperties.inc"
@@ -216,7 +255,8 @@ Status Debugger::SetPropertyValue(const ExecutionContext *exe_ctx,
VarSetOperationType op,
llvm::StringRef property_path,
llvm::StringRef value) {
- bool is_load_script = (property_path == "target.load-script-from-symbol-file");
+ bool is_load_script =
+ (property_path == "target.load-script-from-symbol-file");
bool is_escape_non_printables = (property_path == "escape-non-printables");
TargetSP target_sp;
LoadScriptFromSymFile load_script_old_value;
@@ -609,8 +649,7 @@ void Debugger::Destroy(DebuggerSP &debugger_sp) {
}
}
-DebuggerSP
-Debugger::FindDebuggerWithInstanceName(ConstString instance_name) {
+DebuggerSP Debugger::FindDebuggerWithInstanceName(ConstString instance_name) {
DebuggerSP debugger_sp;
if (g_debugger_list_ptr && g_debugger_list_mutex_ptr) {
std::lock_guard<std::recursive_mutex> guard(*g_debugger_list_mutex_ptr);
@@ -1487,8 +1526,9 @@ bool Debugger::StartEventHandlerThread() {
eBroadcastBitEventThreadIsListening);
auto thread_name =
- full_name.GetLength() < llvm::get_max_thread_name_length() ?
- full_name.AsCString() : "dbg.evt-handler";
+ full_name.GetLength() < llvm::get_max_thread_name_length()
+ ? full_name.AsCString()
+ : "dbg.evt-handler";
// Use larger 8MB stack for this thread
llvm::Expected<HostThread> event_handler_thread =
OpenPOWER on IntegriCloud