From 19ecdedcd2b7fb44689ce3cd59a6a078539eef3f Mon Sep 17 00:00:00 2001 From: Adrian Vogelsgesang Date: Sun, 22 Sep 2024 19:15:16 +0200 Subject: [PATCH] [lldb-dap] Rename `enableDisplayExtendedBacktrace` (#109521) The `enable` prefix is a filler word which adds no additional information. Rename the setting to `displayExtendedBacktrace` Given that this setting was only introduced a month ago, and that there has not been any release since then, I assume that usage is still rather low. As such, it should be fine to not provide backwards-compatibility workarounds. --- .../Python/lldbsuite/test/tools/lldb-dap/dap_server.py | 4 ++-- .../lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py | 8 ++++---- .../extendedStackTrace/TestDAP_extendedStackTrace.py | 2 +- lldb/tools/lldb-dap/DAP.cpp | 2 +- lldb/tools/lldb-dap/DAP.h | 2 +- lldb/tools/lldb-dap/README.md | 4 ++-- lldb/tools/lldb-dap/lldb-dap.cpp | 10 +++++----- lldb/tools/lldb-dap/package.json | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py index bbd701efa3a666..449af1b67d8022 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py @@ -778,7 +778,7 @@ def request_launch( runInTerminal=False, postRunCommands=None, enableAutoVariableSummaries=False, - enableDisplayExtendedBacktrace=False, + displayExtendedBacktrace=False, enableSyntheticChildDebugging=False, commandEscapePrefix=None, customFrameFormat=None, @@ -831,7 +831,7 @@ def request_launch( args_dict["enableAutoVariableSummaries"] = enableAutoVariableSummaries args_dict["enableSyntheticChildDebugging"] = enableSyntheticChildDebugging - args_dict["enableDisplayExtendedBacktrace"] = enableDisplayExtendedBacktrace + args_dict["displayExtendedBacktrace"] = displayExtendedBacktrace args_dict["commandEscapePrefix"] = commandEscapePrefix command_dict = {"command": "launch", "type": "request", "arguments": args_dict} response = self.send_recv(command_dict) diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py index 7b192d62881729..7e80912be44642 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py @@ -386,7 +386,7 @@ def launch( expectFailure=False, postRunCommands=None, enableAutoVariableSummaries=False, - enableDisplayExtendedBacktrace=False, + displayExtendedBacktrace=False, enableSyntheticChildDebugging=False, commandEscapePrefix=None, customFrameFormat=None, @@ -428,7 +428,7 @@ def cleanup(): runInTerminal=runInTerminal, postRunCommands=postRunCommands, enableAutoVariableSummaries=enableAutoVariableSummaries, - enableDisplayExtendedBacktrace=enableDisplayExtendedBacktrace, + displayExtendedBacktrace=displayExtendedBacktrace, enableSyntheticChildDebugging=enableSyntheticChildDebugging, commandEscapePrefix=commandEscapePrefix, customFrameFormat=customFrameFormat, @@ -468,7 +468,7 @@ def build_and_launch( postRunCommands=None, lldbDAPEnv=None, enableAutoVariableSummaries=False, - enableDisplayExtendedBacktrace=False, + displayExtendedBacktrace=False, enableSyntheticChildDebugging=False, commandEscapePrefix=None, customFrameFormat=None, @@ -505,7 +505,7 @@ def build_and_launch( postRunCommands=postRunCommands, enableAutoVariableSummaries=enableAutoVariableSummaries, enableSyntheticChildDebugging=enableSyntheticChildDebugging, - enableDisplayExtendedBacktrace=enableDisplayExtendedBacktrace, + displayExtendedBacktrace=displayExtendedBacktrace, commandEscapePrefix=commandEscapePrefix, customFrameFormat=customFrameFormat, customThreadFormat=customThreadFormat, diff --git a/lldb/test/API/tools/lldb-dap/extendedStackTrace/TestDAP_extendedStackTrace.py b/lldb/test/API/tools/lldb-dap/extendedStackTrace/TestDAP_extendedStackTrace.py index 0cc8534daf4e94..ba35ea9e0b64e6 100644 --- a/lldb/test/API/tools/lldb-dap/extendedStackTrace/TestDAP_extendedStackTrace.py +++ b/lldb/test/API/tools/lldb-dap/extendedStackTrace/TestDAP_extendedStackTrace.py @@ -36,7 +36,7 @@ def test_stackTrace(self): "DYLD_LIBRARY_PATH=/usr/lib/system/introspection", "DYLD_INSERT_LIBRARIES=" + backtrace_recording_lib, ], - enableDisplayExtendedBacktrace=True, + displayExtendedBacktrace=True, ) source = "main.m" breakpoint = line_number(source, "breakpoint 1") diff --git a/lldb/tools/lldb-dap/DAP.cpp b/lldb/tools/lldb-dap/DAP.cpp index 4be9bb055dd1f4..884a71ff6693f8 100644 --- a/lldb/tools/lldb-dap/DAP.cpp +++ b/lldb/tools/lldb-dap/DAP.cpp @@ -36,7 +36,7 @@ DAP::DAP() focus_tid(LLDB_INVALID_THREAD_ID), stop_at_entry(false), is_attach(false), enable_auto_variable_summaries(false), enable_synthetic_child_debugging(false), - enable_display_extended_backtrace(false), + display_extended_backtrace(false), restarting_process_id(LLDB_INVALID_PROCESS_ID), configuration_done_sent(false), waiting_for_run_in_terminal(false), progress_event_reporter( diff --git a/lldb/tools/lldb-dap/DAP.h b/lldb/tools/lldb-dap/DAP.h index bc2c055e2c56d5..57719f98d2aa17 100644 --- a/lldb/tools/lldb-dap/DAP.h +++ b/lldb/tools/lldb-dap/DAP.h @@ -185,7 +185,7 @@ struct DAP { bool is_attach; bool enable_auto_variable_summaries; bool enable_synthetic_child_debugging; - bool enable_display_extended_backtrace; + bool display_extended_backtrace; // The process event thread normally responds to process exited events by // shutting down the entire adapter. When we're restarting, we keep the id of // the old process here so we can detect this case and keep running. diff --git a/lldb/tools/lldb-dap/README.md b/lldb/tools/lldb-dap/README.md index a51ee95dc83c69..c3bed593154e02 100644 --- a/lldb/tools/lldb-dap/README.md +++ b/lldb/tools/lldb-dap/README.md @@ -7,7 +7,7 @@ This binary is not packaged with the VS Code extension. There are multiple ways to obtain this binary: * build it from source (see [LLDB's build instructions](https://lldb.llvm.org/resources/build.html)) -* download it one of the relase packages from the [LLVM release page](https://github.com/llvm/llvm-project/releases/). The `LLVM-19.1.0-{operating_system}.tar.xz` packages contain a prebuilt `lldb-dap` binary. +* download one of the relase packages from the [LLVM release page](https://github.com/llvm/llvm-project/releases/). The `LLVM-19.1.0-{operating_system}.tar.xz` packages contain a prebuilt `lldb-dap` binary. * use the binary provided by your toolchain (for example `xcrun -f lldb-dap` on macOS) or contact your toolchain vendor to include it. By default, the VS Code extension will expect to find `lldb-dap` in your `PATH`. @@ -188,8 +188,8 @@ specific key/value pairs: |**commandEscapePrefix** | string | | The escape prefix to use for executing regular LLDB commands in the Debug Console, instead of printing variables. Defaults to a back-tick (`\``). If it's an empty string, then all expression in the Debug Console are treated as regular LLDB commands. |**customFrameFormat** | string | | If non-empty, stack frames will have descriptions generated based on the provided format. See https://lldb.llvm.org/use/formatting.html for an explanation on format strings for frames. If the format string contains errors, an error message will be displayed on the Debug Console and the default frame names will be used. This might come with a performance cost because debug information might need to be processed to generate the description. |**customThreadFormat** | string | | Same as `customFrameFormat`, but for threads instead of stack frames. +|**displayExtendedBacktrace**|bool| | Enable language specific extended backtraces. |**enableAutoVariableSummaries**|bool| | Enable auto generated summaries for variables when no summaries exist for a given type. This feature can cause performance delays in large projects when viewing variables. -|**enableDisplayExtendedBacktrace**|bool| | Enable language specific extended backtraces. |**enableSyntheticChildDebugging**|bool| | If a variable is displayed using a synthetic children, also display the actual contents of the variable at the end under a [raw] entry. This is useful when creating sythetic child plug-ins as it lets you see the actual contents of the variable. |**initCommands** |[string]| | LLDB commands executed upon debugger startup prior to creating the LLDB target. |**preRunCommands** |[string]| | LLDB commands executed just before launching/attaching, after the LLDB target has been created. diff --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp index 93676d7add239d..c7653fed2def4e 100644 --- a/lldb/tools/lldb-dap/lldb-dap.cpp +++ b/lldb/tools/lldb-dap/lldb-dap.cpp @@ -695,7 +695,7 @@ bool FillStackFrames(lldb::SBThread &thread, llvm::json::Array &stack_frames, stack_frames.emplace_back(CreateStackFrame(frame)); } - if (g_dap.enable_display_extended_backtrace && reached_end_of_stack) { + if (g_dap.display_extended_backtrace && reached_end_of_stack) { // Check for any extended backtraces. for (uint32_t bt = 0; bt < thread.GetProcess().GetNumExtendedBacktraceTypes(); bt++) { @@ -778,8 +778,8 @@ void request_attach(const llvm::json::Object &request) { GetBoolean(arguments, "enableAutoVariableSummaries", false); g_dap.enable_synthetic_child_debugging = GetBoolean(arguments, "enableSyntheticChildDebugging", false); - g_dap.enable_display_extended_backtrace = - GetBoolean(arguments, "enableDisplayExtendedBacktrace", false); + g_dap.display_extended_backtrace = + GetBoolean(arguments, "displayExtendedBacktrace", false); g_dap.command_escape_prefix = GetString(arguments, "commandEscapePrefix", "`"); g_dap.SetFrameFormat(GetString(arguments, "customFrameFormat")); @@ -2156,8 +2156,8 @@ void request_launch(const llvm::json::Object &request) { GetBoolean(arguments, "enableAutoVariableSummaries", false); g_dap.enable_synthetic_child_debugging = GetBoolean(arguments, "enableSyntheticChildDebugging", false); - g_dap.enable_display_extended_backtrace = - GetBoolean(arguments, "enableDisplayExtendedBacktrace", false); + g_dap.display_extended_backtrace = + GetBoolean(arguments, "displayExtendedBacktrace", false); g_dap.command_escape_prefix = GetString(arguments, "commandEscapePrefix", "`"); g_dap.SetFrameFormat(GetString(arguments, "customFrameFormat")); diff --git a/lldb/tools/lldb-dap/package.json b/lldb/tools/lldb-dap/package.json index 33b09d56ab17e2..7b6133d1c20a7a 100644 --- a/lldb/tools/lldb-dap/package.json +++ b/lldb/tools/lldb-dap/package.json @@ -268,7 +268,7 @@ "description": "Enable auto generated summaries for variables when no summaries exist for a given type. This feature can cause performance delays in large projects when viewing variables.", "default": false }, - "enableDisplayExtendedBacktrace": { + "displayExtendedBacktrace": { "type": "boolean", "description": "Enable language specific extended backtraces.", "default": false @@ -393,7 +393,7 @@ "description": "Enable auto generated summaries for variables when no summaries exist for a given type. This feature can cause performance delays in large projects when viewing variables.", "default": false }, - "enableDisplayExtendedBacktrace": { + "displayExtendedBacktrace": { "type": "boolean", "description": "Enable language specific extended backtraces.", "default": false