@@ -531,15 +531,14 @@ void request_attach(const llvm::json::Object &request) {
531531 g_vsc.exit_commands = GetStrings (arguments, " exitCommands" );
532532 auto attachCommands = GetStrings (arguments, " attachCommands" );
533533 g_vsc.stop_at_entry = GetBoolean (arguments, " stopOnEntry" , false );
534- const auto debuggerRoot = GetString (arguments, " debuggerRoot" );
534+ const llvm::StringRef debuggerRoot = GetString (arguments, " debuggerRoot" );
535535
536536 // This is a hack for loading DWARF in .o files on Mac where the .o files
537537 // in the debug map of the main executable have relative paths which require
538538 // the lldb-vscode binary to have its working directory set to that relative
539539 // root for the .o files in order to be able to load debug info.
540- if (!debuggerRoot.empty ()) {
541- llvm::sys::fs::set_current_path (debuggerRoot.data ());
542- }
540+ if (!debuggerRoot.empty ())
541+ llvm::sys::fs::set_current_path (debuggerRoot);
543542
544543 // Run any initialize LLDB commands the user specified in the launch.json
545544 g_vsc.RunInitCommands ();
@@ -1363,15 +1362,14 @@ void request_launch(const llvm::json::Object &request) {
13631362 g_vsc.exit_commands = GetStrings (arguments, " exitCommands" );
13641363 auto launchCommands = GetStrings (arguments, " launchCommands" );
13651364 g_vsc.stop_at_entry = GetBoolean (arguments, " stopOnEntry" , false );
1366- const auto debuggerRoot = GetString (arguments, " debuggerRoot" );
1365+ const llvm::StringRef debuggerRoot = GetString (arguments, " debuggerRoot" );
13671366
13681367 // This is a hack for loading DWARF in .o files on Mac where the .o files
13691368 // in the debug map of the main executable have relative paths which require
13701369 // the lldb-vscode binary to have its working directory set to that relative
13711370 // root for the .o files in order to be able to load debug info.
1372- if (!debuggerRoot.empty ()) {
1373- llvm::sys::fs::set_current_path (debuggerRoot.data ());
1374- }
1371+ if (!debuggerRoot.empty ())
1372+ llvm::sys::fs::set_current_path (debuggerRoot);
13751373
13761374 // Run any initialize LLDB commands the user specified in the launch.json.
13771375 // This is run before target is created, so commands can't do anything with
0 commit comments