From 3eb4b4589e0094a39fa2e1a8b1e9f585b6cdaa69 Mon Sep 17 00:00:00 2001 From: Chaoren Lin Date: Wed, 29 Apr 2015 17:24:48 +0000 Subject: Remove trap code from disassembly. Summary: NativeProcessProtocol uses ReadMemory internally for setting/checking breakpoints but also for generic memory reads (Handle_m), this change adds a ReadMemoryWithoutTrap for that purpose. Also fixes a bunch of misuses of addr_t as size/length. Test Plan: `disassemble` no longer shows the trap code. Reviewers: jingham, vharron, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9330 llvm-svn: 236132 --- .../Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 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 d4bbb6f4972..47dc849e25b 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -1846,8 +1846,8 @@ GDBRemoteCommunicationServerLLGS::Handle_m (StringExtractorGDBRemote &packet) // Retrieve the process memory. - lldb::addr_t bytes_read = 0; - Error error = m_debugged_process_sp->ReadMemory (read_addr, &buf[0], byte_count, bytes_read); + size_t bytes_read = 0; + Error error = m_debugged_process_sp->ReadMemoryWithoutTrap(read_addr, &buf[0], byte_count, bytes_read); if (error.Fail ()) { if (log) @@ -1863,7 +1863,7 @@ GDBRemoteCommunicationServerLLGS::Handle_m (StringExtractorGDBRemote &packet) } StreamGDBRemote response; - for (lldb::addr_t i = 0; i < bytes_read; ++i) + for (size_t i = 0; i < bytes_read; ++i) response.PutHex8(buf[i]); return SendPacketNoLock(response.GetData(), response.GetSize()); @@ -1917,7 +1917,7 @@ GDBRemoteCommunicationServerLLGS::Handle_M (StringExtractorGDBRemote &packet) // Convert the hex memory write contents to bytes. StreamGDBRemote response; - const uint64_t convert_count = static_cast (packet.GetHexBytes (&buf[0], byte_count, 0)); + const uint64_t convert_count = packet.GetHexBytes(&buf[0], byte_count, 0); if (convert_count != byte_count) { if (log) @@ -1926,7 +1926,7 @@ GDBRemoteCommunicationServerLLGS::Handle_M (StringExtractorGDBRemote &packet) } // Write the process memory. - lldb::addr_t bytes_written = 0; + size_t bytes_written = 0; Error error = m_debugged_process_sp->WriteMemory (write_addr, &buf[0], byte_count, bytes_written); if (error.Fail ()) { -- cgit v1.2.3