From d3173f34e8546a96b8d0df0d9de133f88f10c127 Mon Sep 17 00:00:00 2001 From: Chaoren Lin Date: Fri, 29 May 2015 19:52:29 +0000 Subject: Refactor many file functions to use FileSpec over strings. Summary: This should solve the issue of sending denormalized paths over gdb-remote if we stick to GetPath(false) in GDBRemoteCommunicationClient, and let the server handle any denormalization. Reviewers: ovyalov, zturner, vharron, clayborg Reviewed By: clayborg Subscribers: tberghammer, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D9728 llvm-svn: 238604 --- .../Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp') diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index 5ffd1e9..8b31dbe 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -950,18 +950,18 @@ GDBRemoteCommunicationServerLLGS::Handle_QSetWorkingDir (StringExtractorGDBRemot packet.SetFilePos (::strlen ("QSetWorkingDir:")); std::string path; packet.GetHexByteString (path); - m_process_launch_info.SwapWorkingDirectory (path); + m_process_launch_info.SetWorkingDirectory(FileSpec{path, true}); return SendOKResponse (); } GDBRemoteCommunication::PacketResult GDBRemoteCommunicationServerLLGS::Handle_qGetWorkingDir (StringExtractorGDBRemote &packet) { - const char *working_dir = m_process_launch_info.GetWorkingDirectory(); - if (working_dir && working_dir[0]) + FileSpec working_dir{m_process_launch_info.GetWorkingDirectory()}; + if (working_dir) { StreamString response; - response.PutBytesAsRawHex8(working_dir, strlen(working_dir)); + response.PutCStringAsRawHex8(working_dir.GetCString()); return SendPacketNoLock(response.GetData(), response.GetSize()); } -- cgit v1.1