Skip to content

[lldb-dap] Adaptor -> Adapter (NFC) #129110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 28, 2025
Merged

Conversation

JDevlieghere
Copy link
Member

Both spellings are considered correct and acceptable, with adapter being more common in American English. Given that DAP stands for Debug Adapter Protocol (with an e) let's go with that as the canonical spelling.

Both spellings are considered correct and acceptable, with adapter being
more common in American English. Given that DAP stands for Debug Adapter
Protocol (with an e) let's go with that as the canonical spelling.
@llvmbot
Copy link
Member

llvmbot commented Feb 27, 2025

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

Both spellings are considered correct and acceptable, with adapter being more common in American English. Given that DAP stands for Debug Adapter Protocol (with an e) let's go with that as the canonical spelling.


Full diff: https://github.com/llvm/llvm-project/pull/129110.diff

9 Files Affected:

  • (modified) lldb/tools/lldb-dap/DAP.cpp (+1-1)
  • (modified) lldb/tools/lldb-dap/DAP.h (+1-1)
  • (modified) lldb/tools/lldb-dap/Handler/RequestHandler.cpp (+1-1)
  • (modified) lldb/tools/lldb-dap/JSONUtils.cpp (+2-2)
  • (modified) lldb/tools/lldb-dap/JSONUtils.h (+8-8)
  • (modified) lldb/tools/lldb-dap/Options.td (+1-1)
  • (modified) lldb/tools/lldb-dap/RunInTerminal.cpp (+2-2)
  • (modified) lldb/tools/lldb-dap/RunInTerminal.h (+5-5)
  • (modified) lldb/tools/lldb-dap/lldb-dap.cpp (+6-6)
diff --git a/lldb/tools/lldb-dap/DAP.cpp b/lldb/tools/lldb-dap/DAP.cpp
index cd53e2aca3fb6..53c514b790f38 100644
--- a/lldb/tools/lldb-dap/DAP.cpp
+++ b/lldb/tools/lldb-dap/DAP.cpp
@@ -64,7 +64,7 @@ namespace lldb_dap {
 DAP::DAP(std::string name, llvm::StringRef path, std::ofstream *log,
          lldb::IOObjectSP input, lldb::IOObjectSP output, ReplMode repl_mode,
          std::vector<std::string> pre_init_commands)
-    : name(std::move(name)), debug_adaptor_path(path), log(log),
+    : name(std::move(name)), debug_adapter_path(path), log(log),
       input(std::move(input)), output(std::move(output)),
       broadcaster("lldb-dap"), exception_breakpoints(),
       pre_init_commands(std::move(pre_init_commands)),
diff --git a/lldb/tools/lldb-dap/DAP.h b/lldb/tools/lldb-dap/DAP.h
index a7c7e5d9bbc19..8b2e498a28c95 100644
--- a/lldb/tools/lldb-dap/DAP.h
+++ b/lldb/tools/lldb-dap/DAP.h
@@ -146,7 +146,7 @@ struct SendEventRequestHandler : public lldb::SBCommandPluginInterface {
 
 struct DAP {
   std::string name;
-  llvm::StringRef debug_adaptor_path;
+  llvm::StringRef debug_adapter_path;
   std::ofstream *log;
   InputStream input;
   OutputStream output;
diff --git a/lldb/tools/lldb-dap/Handler/RequestHandler.cpp b/lldb/tools/lldb-dap/Handler/RequestHandler.cpp
index 0a32e39ea3aff..606ada90ce2e5 100644
--- a/lldb/tools/lldb-dap/Handler/RequestHandler.cpp
+++ b/lldb/tools/lldb-dap/Handler/RequestHandler.cpp
@@ -100,7 +100,7 @@ static llvm::Error RunInTerminal(DAP &dap,
   debugger_pid = getpid();
 #endif
   llvm::json::Object reverse_request = CreateRunInTerminalReverseRequest(
-      launch_request, dap.debug_adaptor_path, comm_file.m_path, debugger_pid);
+      launch_request, dap.debug_adapter_path, comm_file.m_path, debugger_pid);
   dap.SendReverseRequest<LogFailureResponseHandler>("runInTerminal",
                                                     std::move(reverse_request));
 
diff --git a/lldb/tools/lldb-dap/JSONUtils.cpp b/lldb/tools/lldb-dap/JSONUtils.cpp
index 9f08efb2a3ac1..9dec4ca1df49a 100644
--- a/lldb/tools/lldb-dap/JSONUtils.cpp
+++ b/lldb/tools/lldb-dap/JSONUtils.cpp
@@ -1436,7 +1436,7 @@ llvm::json::Value CreateCompileUnit(lldb::SBCompileUnit &unit) {
 /// https://microsoft.github.io/debug-adapter-protocol/specification#Reverse_Requests_RunInTerminal
 llvm::json::Object
 CreateRunInTerminalReverseRequest(const llvm::json::Object &launch_request,
-                                  llvm::StringRef debug_adaptor_path,
+                                  llvm::StringRef debug_adapter_path,
                                   llvm::StringRef comm_file,
                                   lldb::pid_t debugger_pid) {
   llvm::json::Object run_in_terminal_args;
@@ -1446,7 +1446,7 @@ CreateRunInTerminalReverseRequest(const llvm::json::Object &launch_request,
 
   const auto *launch_request_arguments = launch_request.getObject("arguments");
   // The program path must be the first entry in the "args" field
-  std::vector<std::string> args = {debug_adaptor_path.str(), "--comm-file",
+  std::vector<std::string> args = {debug_adapter_path.str(), "--comm-file",
                                    comm_file.str()};
   if (debugger_pid != LLDB_INVALID_PROCESS_ID) {
     args.push_back("--debugger-pid");
diff --git a/lldb/tools/lldb-dap/JSONUtils.h b/lldb/tools/lldb-dap/JSONUtils.h
index db56d98777347..55d2360e0a224 100644
--- a/lldb/tools/lldb-dap/JSONUtils.h
+++ b/lldb/tools/lldb-dap/JSONUtils.h
@@ -233,7 +233,7 @@ void AppendBreakpoint(
     std::optional<llvm::StringRef> request_path = std::nullopt,
     std::optional<uint32_t> request_line = std::nullopt);
 
-/// Converts breakpoint location to a debug adaptor protocol "Breakpoint".
+/// Converts breakpoint location to a debug adapter protocol "Breakpoint".
 ///
 /// \param[in] bp
 ///     A LLDB breakpoint object to convert into a JSON value
@@ -290,7 +290,7 @@ llvm::json::Value CreateModule(lldb::SBTarget &target, lldb::SBModule &module);
 llvm::json::Object CreateEventObject(const llvm::StringRef event_name);
 
 /// Create a "ExceptionBreakpointsFilter" JSON object as described in
-/// the debug adaptor definition.
+/// the debug adapter definition.
 ///
 /// \param[in] bp
 ///     The exception breakpoint object to use
@@ -301,7 +301,7 @@ llvm::json::Object CreateEventObject(const llvm::StringRef event_name);
 llvm::json::Value
 CreateExceptionBreakpointFilter(const ExceptionBreakpoint &bp);
 
-/// Create a "Scope" JSON object as described in the debug adaptor definition.
+/// Create a "Scope" JSON object as described in the debug adapter definition.
 ///
 /// \param[in] name
 ///     The value to place into the "name" key
@@ -322,7 +322,7 @@ llvm::json::Value CreateScope(const llvm::StringRef name,
                               int64_t variablesReference,
                               int64_t namedVariables, bool expensive);
 
-/// Create a "Source" JSON object as described in the debug adaptor definition.
+/// Create a "Source" JSON object as described in the debug adapter definition.
 ///
 /// \param[in] file
 ///     The SBFileSpec to use when populating out the "Source" object
@@ -332,7 +332,7 @@ llvm::json::Value CreateScope(const llvm::StringRef name,
 ///     definition outlined by Microsoft.
 llvm::json::Value CreateSource(const lldb::SBFileSpec &file);
 
-/// Create a "Source" JSON object as described in the debug adaptor definition.
+/// Create a "Source" JSON object as described in the debug adapter definition.
 ///
 /// \param[in] line_entry
 ///     The LLDB line table to use when populating out the "Source"
@@ -573,8 +573,8 @@ llvm::json::Value CreateCompileUnit(lldb::SBCompileUnit &unit);
 ///     The original launch_request object whose fields are used to construct
 ///     the reverse request object.
 ///
-/// \param[in] debug_adaptor_path
-///     Path to the current debug adaptor. It will be used to delegate the
+/// \param[in] debug_adapter_path
+///     Path to the current debug adapter. It will be used to delegate the
 ///     launch of the target.
 ///
 /// \param[in] comm_file
@@ -590,7 +590,7 @@ llvm::json::Value CreateCompileUnit(lldb::SBCompileUnit &unit);
 ///     Microsoft.
 llvm::json::Object
 CreateRunInTerminalReverseRequest(const llvm::json::Object &launch_request,
-                                  llvm::StringRef debug_adaptor_path,
+                                  llvm::StringRef debug_adapter_path,
                                   llvm::StringRef comm_file,
                                   lldb::pid_t debugger_pid);
 
diff --git a/lldb/tools/lldb-dap/Options.td b/lldb/tools/lldb-dap/Options.td
index 97a6ec118c47b..a1baf2f0370bd 100644
--- a/lldb/tools/lldb-dap/Options.td
+++ b/lldb/tools/lldb-dap/Options.td
@@ -33,7 +33,7 @@ def launch_target: S<"launch-target">,
 
 def comm_file: S<"comm-file">,
   MetaVarName<"<file>">,
-  HelpText<"The fifo file used to communicate the with the debug adaptor "
+  HelpText<"The fifo file used to communicate the with the debug adapter "
     "when using --launch-target.">;
 
 def debugger_pid: S<"debugger-pid">,
diff --git a/lldb/tools/lldb-dap/RunInTerminal.cpp b/lldb/tools/lldb-dap/RunInTerminal.cpp
index 4fe09e2885a8e..9f309dd78221a 100644
--- a/lldb/tools/lldb-dap/RunInTerminal.cpp
+++ b/lldb/tools/lldb-dap/RunInTerminal.cpp
@@ -97,9 +97,9 @@ static Error ToError(const RunInTerminalMessage &message) {
 
 RunInTerminalLauncherCommChannel::RunInTerminalLauncherCommChannel(
     StringRef comm_file)
-    : m_io(comm_file, "debug adaptor") {}
+    : m_io(comm_file, "debug adapter") {}
 
-Error RunInTerminalLauncherCommChannel::WaitUntilDebugAdaptorAttaches(
+Error RunInTerminalLauncherCommChannel::WaitUntilDebugAdapterAttaches(
     std::chrono::milliseconds timeout) {
   if (Expected<RunInTerminalMessageUP> message =
           GetNextMessage(m_io, timeout)) {
diff --git a/lldb/tools/lldb-dap/RunInTerminal.h b/lldb/tools/lldb-dap/RunInTerminal.h
index b20f8beb6071d..457850c8ea538 100644
--- a/lldb/tools/lldb-dap/RunInTerminal.h
+++ b/lldb/tools/lldb-dap/RunInTerminal.h
@@ -72,7 +72,7 @@ class RunInTerminalLauncherCommChannel {
 public:
   RunInTerminalLauncherCommChannel(llvm::StringRef comm_file);
 
-  /// Wait until the debug adaptor attaches.
+  /// Wait until the debug adapter attaches.
   ///
   /// \param[in] timeout
   ///     How long to wait to be attached.
@@ -80,16 +80,16 @@ class RunInTerminalLauncherCommChannel {
   /// \return
   ///     An \a llvm::Error object in case of errors or if this operation times
   ///     out.
-  llvm::Error WaitUntilDebugAdaptorAttaches(std::chrono::milliseconds timeout);
+  llvm::Error WaitUntilDebugAdapterAttaches(std::chrono::milliseconds timeout);
 
-  /// Notify the debug adaptor this process' pid.
+  /// Notify the debug adapter this process' pid.
   ///
   /// \return
   ///     An \a llvm::Error object in case of errors or if this operation times
   ///     out.
   llvm::Error NotifyPid();
 
-  /// Notify the debug adaptor that there's been an error.
+  /// Notify the debug adapter that there's been an error.
   void NotifyError(llvm::StringRef error);
 
 private:
@@ -122,7 +122,7 @@ class RunInTerminalDebugAdapterCommChannel {
   FifoFileIO m_io;
 };
 
-/// Create a fifo file used to communicate the debug adaptor with
+/// Create a fifo file used to communicate the debug adapter with
 /// the runInTerminal launcher.
 llvm::Expected<std::shared_ptr<FifoFile>> CreateRunInTerminalCommFile();
 
diff --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp
index 6dff960daede9..d005eccfae903 100644
--- a/lldb/tools/lldb-dap/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/lldb-dap.cpp
@@ -175,22 +175,22 @@ static void PrintHelp(LLDBDAPOptTable &table, llvm::StringRef tool_name) {
 // If --launch-target is provided, this instance of lldb-dap becomes a
 // runInTerminal launcher. It will ultimately launch the program specified in
 // the --launch-target argument, which is the original program the user wanted
-// to debug. This is done in such a way that the actual debug adaptor can
+// to debug. This is done in such a way that the actual debug adapter can
 // place breakpoints at the beginning of the program.
 //
-// The launcher will communicate with the debug adaptor using a fifo file in the
+// The launcher will communicate with the debug adapter using a fifo file in the
 // directory specified in the --comm-file argument.
 //
-// Regarding the actual flow, this launcher will first notify the debug adaptor
+// Regarding the actual flow, this launcher will first notify the debug adapter
 // of its pid. Then, the launcher will be in a pending state waiting to be
-// attached by the adaptor.
+// attached by the adapter.
 //
 // Once attached and resumed, the launcher will exec and become the program
 // specified by --launch-target, which is the original target the
 // user wanted to run.
 //
 // In case of errors launching the target, a suitable error message will be
-// emitted to the debug adaptor.
+// emitted to the debug adapter.
 static llvm::Error LaunchRunInTerminalTarget(llvm::opt::Arg &target_arg,
                                              llvm::StringRef comm_file,
                                              lldb::pid_t debugger_pid,
@@ -219,7 +219,7 @@ static llvm::Error LaunchRunInTerminalTarget(llvm::opt::Arg &target_arg,
   const char *timeout_env_var = getenv("LLDB_DAP_RIT_TIMEOUT_IN_MS");
   int timeout_in_ms =
       timeout_env_var != nullptr ? atoi(timeout_env_var) : 20000;
-  if (llvm::Error err = comm_channel.WaitUntilDebugAdaptorAttaches(
+  if (llvm::Error err = comm_channel.WaitUntilDebugAdapterAttaches(
           std::chrono::milliseconds(timeout_in_ms))) {
     return err;
   }

Copy link
Collaborator

@slackito slackito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ashgti
Copy link
Contributor

ashgti commented Feb 27, 2025

There are a few other places where Adaptor is used:

$ rg -i adaptor lldb
lldb/packages/Python/lldbsuite/test/test_categories.py
34:    "lldb-dap": "Tests for the Debug Adaptor Protocol with lldb-dap",

lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
79:            trace_file.write("from adaptor:\n%s\n" % (json_str))
262:        adaptor"""
270:            self.trace_file.write("to adaptor:\n%s\n" % (json_str))
278:        """Get a JSON packet from the VSCode debug adaptor. This function
1187:class DebugAdaptorServer(DebugCommunication):
1199:            process, connection = DebugAdaptorServer.launch(
1227:        adaptor_env = os.environ.copy()
1229:            adaptor_env.update(env)
1232:            adaptor_env["LLDBDAP_LOG"] = log_file
1244:            env=adaptor_env,
1274:        super(DebugAdaptorServer, self).terminate()
1350:            "A testing framework for the Visual Studio Code Debug Adaptor protocol"
1360:            "Visual Studio Code Debug Adaptor protocol."
1410:            "current Visual Studio Code Debug Adaptor executable."
1421:        help="Pause waiting for a debugger to attach to the debug adaptor",
1584:            "Debug Adaptor vscode executable path using the --vscode "
1588:    dbg = DebugAdaptorServer(

lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
17:    def create_debug_adaptor(self, lldbDAPEnv=None, connection=None):
18:        """Create the Visual Studio Code debug adaptor"""
23:        self.dap_server = dap_server.DebugAdaptorServer(
31:    def build_and_create_debug_adaptor(self, lldbDAPEnv=None):
33:        self.create_debug_adaptor(lldbDAPEnv)
327:        """Build the default Makefile target, create the DAP debug adaptor,
331:        # Make sure we disconnect and terminate the DAP debug adaptor even
482:        """Build the default Makefile target, create the DAP debug adaptor,
485:        self.build_and_create_debug_adaptor(lldbDAPEnv)

lldb/test/API/tools/lldb-dap/disconnect/TestDAP_disconnect.py
55:        self.build_and_create_debug_adaptor()

lldb/test/API/tools/lldb-dap/commands/TestDAP_commands.py
78:        self.build_and_create_debug_adaptor()

lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py
116:        self.create_debug_adaptor()

lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
63:        self.build_and_create_debug_adaptor()
95:        self.build_and_create_debug_adaptor()
123:        self.build_and_create_debug_adaptor()
142:        self.build_and_create_debug_adaptor()

lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
47:        self.build_and_create_debug_adaptor()
63:        self.build_and_create_debug_adaptor()
104:        self.build_and_create_debug_adaptor()
140:        self.build_and_create_debug_adaptor()
214:        self.build_and_create_debug_adaptor()

lldb/test/API/tools/lldb-dap/coreFile/TestDAP_coreFile.py
21:        self.create_debug_adaptor()
67:        self.create_debug_adaptor()
81:        self.create_debug_adaptor()

lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py
30:        self.build_and_create_debug_adaptor()
103:        This packet is a bit tricky on the debug adaptor side since there
119:        # Visual Studio Code Debug Adaptors have no way to specify the file
260:        # Visual Studio Code Debug Adaptors have no way to specify the file

lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setExceptionBreakpoints.py
17:        This packet is a bit tricky on the debug adaptor side since there
29:        # Visual Studio Code Debug Adaptors have no way to specify the file

lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py
17:        This packet is a bit tricky on the debug adaptor side since there
28:        # Visual Studio Code Debug Adaptors have no way to specify the file

lldb/test/API/tools/lldb-dap/server/TestDAP_server.py
18:        (process, connection) = dap_server.DebugAdaptorServer.launch(
32:        self.dap_server = dap_server.DebugAdaptorServer(
86:        self.dap_server = dap_server.DebugAdaptorServer(

lldb/test/API/tools/lldb-dap/runInTerminal/TestDAP_runInTerminal.py
121:        self.build_and_create_debug_adaptor()
250:        self.assertIn("Timed out trying to get messages from the debug adaptor", stderr)

lldb/test/API/tools/lldb-dap/breakpoint-events/TestDAP_breakpointEvents.py
44:        # Visual Studio Code Debug Adaptors have no way to specify the file

But these could be in a follow up as well.

@JDevlieghere JDevlieghere merged commit fb191ef into llvm:main Feb 28, 2025
10 checks passed
@JDevlieghere JDevlieghere deleted the adaptoer branch February 28, 2025 01:56
cheezeburglar pushed a commit to cheezeburglar/llvm-project that referenced this pull request Feb 28, 2025
Both spellings are considered correct and acceptable, with adapter being
more common in American English. Given that DAP stands for Debug Adapter
Protocol (with an e) let's go with that as the canonical spelling.
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Mar 10, 2025
Both spellings are considered correct and acceptable, with adapter being
more common in American English. Given that DAP stands for Debug Adapter
Protocol (with an e) let's go with that as the canonical spelling.
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Mar 20, 2025
Both spellings are considered correct and acceptable, with adapter being
more common in American English. Given that DAP stands for Debug Adapter
Protocol (with an e) let's go with that as the canonical spelling.
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Apr 2, 2025
Both spellings are considered correct and acceptable, with adapter being
more common in American English. Given that DAP stands for Debug Adapter
Protocol (with an e) let's go with that as the canonical spelling.
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Apr 17, 2025
Both spellings are considered correct and acceptable, with adapter being
more common in American English. Given that DAP stands for Debug Adapter
Protocol (with an e) let's go with that as the canonical spelling.
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Apr 30, 2025
Both spellings are considered correct and acceptable, with adapter being
more common in American English. Given that DAP stands for Debug Adapter
Protocol (with an e) let's go with that as the canonical spelling.
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request May 15, 2025
Both spellings are considered correct and acceptable, with adapter being
more common in American English. Given that DAP stands for Debug Adapter
Protocol (with an e) let's go with that as the canonical spelling.
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request May 29, 2025
Both spellings are considered correct and acceptable, with adapter being
more common in American English. Given that DAP stands for Debug Adapter
Protocol (with an e) let's go with that as the canonical spelling.
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Jun 13, 2025
Both spellings are considered correct and acceptable, with adapter being
more common in American English. Given that DAP stands for Debug Adapter
Protocol (with an e) let's go with that as the canonical spelling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants