diff options
author | Fangrui Song <i@maskray.me> | 2022-12-18 01:15:25 +0000 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-12-18 01:15:25 +0000 |
commit | fbaf48be0ff6fb24b9aa8fe9c2284fe88a8798dd (patch) | |
tree | 735c071463e87ff80c30d1bb2b4528fc8aa1a8a9 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp | |
parent | a3400191137e7c991b89ebe72211790dae1648a1 (diff) | |
download | llvm-fbaf48be0ff6fb24b9aa8fe9c2284fe88a8798dd.zip llvm-fbaf48be0ff6fb24b9aa8fe9c2284fe88a8798dd.tar.gz llvm-fbaf48be0ff6fb24b9aa8fe9c2284fe88a8798dd.tar.bz2 |
[lldb] Remove redundant .c_str() and .get() calls
Removing .c_str() has a semantics difference, but the use scenarios
likely do not matter as we don't have NUL in the strings.
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp index c2c01d1..e6fece1 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp @@ -747,9 +747,8 @@ GDBRemoteCommunicationServerCommon::Handle_qPlatform_shell( std::string output; FileSpec working_spec(working_dir); FileSystem::Instance().Resolve(working_spec); - Status err = - Host::RunShellCommand(path.c_str(), working_spec, &status, &signo, - &output, std::chrono::seconds(10)); + Status err = Host::RunShellCommand(path, working_spec, &status, &signo, + &output, std::chrono::seconds(10)); StreamGDBRemote response; if (err.Fail()) { response.PutCString("F,"); @@ -1136,8 +1135,7 @@ GDBRemoteCommunicationServerCommon::Handle_qModuleInfo( response.PutChar(';'); response.PutCString("file_path:"); - response.PutStringAsRawHex8( - matched_module_spec.GetFileSpec().GetPath().c_str()); + response.PutStringAsRawHex8(matched_module_spec.GetFileSpec().GetPath()); response.PutChar(';'); response.PutCString("file_offset:"); response.PutHex64(file_offset); @@ -1212,7 +1210,7 @@ void GDBRemoteCommunicationServerCommon::CreateProcessInfoResponse( proc_info.GetUserID(), proc_info.GetGroupID(), proc_info.GetEffectiveUserID(), proc_info.GetEffectiveGroupID()); response.PutCString("name:"); - response.PutStringAsRawHex8(proc_info.GetExecutableFile().GetPath().c_str()); + response.PutStringAsRawHex8(proc_info.GetExecutableFile().GetPath()); response.PutChar(';'); response.PutCString("args:"); |