[Lldb-commits] [lldb] [lldb][lldb-dap] fix repeating commands in	repl mode (PR #135008)
    Jonas Devlieghere via lldb-commits 
    lldb-commits at lists.llvm.org
       
    Tue Apr 22 07:41:35 PDT 2025
    
    
  
================
@@ -81,18 +85,23 @@ bool RunLLDBCommands(lldb::SBDebugger &debugger, llvm::StringRef prefix,
 ///     If \b false, then command prefixes like \b ! or \b ? are not parsed and
 ///     each command is executed verbatim.
 ///
+/// \param[in] echo_commands
+///     If \b true, the command are echoed to the stream.
+///
 /// \return
 ///     A std::string that contains the prefix and all commands and
 ///     command output.
 std::string RunLLDBCommands(lldb::SBDebugger &debugger, llvm::StringRef prefix,
                             const llvm::ArrayRef<std::string> &commands,
                             bool &required_command_failed,
-                            bool parse_command_directives = true);
+                            bool parse_command_directives = true,
+                            bool echo_commands = false);
 
 /// Similar to the method above, but without parsing command directives.
-std::string
-RunLLDBCommandsVerbatim(lldb::SBDebugger &debugger, llvm::StringRef prefix,
-                        const llvm::ArrayRef<std::string> &commands);
+std::string RunLLDBCommandsVerbatim(lldb::SBDebugger &debugger,
+                                    llvm::StringRef prefix,
+                                    const llvm::ArrayRef<std::string> &commands,
+                                    bool echo_commands);
----------------
JDevlieghere wrote:
I think we should drop this method altogether and use `RunLLDBCommands`. Maybe it made sense in the past (I actually don't think so because there's the default argument) but with the extra option I think it makes even less sense. The alternative would be to drop the `echo_commands` argument and always set that to false in the implementation, as there are no call sites that actually set this to true right now. 
https://github.com/llvm/llvm-project/pull/135008
    
    
More information about the lldb-commits
mailing list