@@ -54,9 +54,9 @@ void AttachRequestHandler::operator()(const llvm::json::Object &request) const {
5454 const int invalid_port = 0 ;
5555 const auto *arguments = request.getObject (" arguments" );
5656 const lldb::pid_t pid =
57- GetUnsigned (arguments, " pid" , LLDB_INVALID_PROCESS_ID);
57+ GetUnsigned (arguments, " pid" ). value_or ( LLDB_INVALID_PROCESS_ID);
5858 const auto gdb_remote_port =
59- GetUnsigned (arguments, " gdb-remote-port" , invalid_port);
59+ GetUnsigned (arguments, " gdb-remote-port" ). value_or ( invalid_port);
6060 const auto gdb_remote_hostname =
6161 GetString (arguments, " gdb-remote-hostname" , " localhost" );
6262 if (pid != LLDB_INVALID_PROCESS_ID)
@@ -70,7 +70,8 @@ void AttachRequestHandler::operator()(const llvm::json::Object &request) const {
7070 dap.terminate_commands = GetStrings (arguments, " terminateCommands" );
7171 auto attachCommands = GetStrings (arguments, " attachCommands" );
7272 llvm::StringRef core_file = GetString (arguments, " coreFile" );
73- const uint64_t timeout_seconds = GetUnsigned (arguments, " timeout" , 30 );
73+ const uint64_t timeout_seconds =
74+ GetUnsigned (arguments, " timeout" ).value_or (30 );
7475 dap.stop_at_entry = core_file.empty ()
7576 ? GetBoolean (arguments, " stopOnEntry" ).value_or (false )
7677 : true ;
0 commit comments