diff options
| author | Pavel Labath <labath@google.com> | 2016-08-19 12:31:49 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2016-08-19 12:31:49 +0000 |
| commit | b42b48e051e9aaa374fe6da51acb15c7500072ca (patch) | |
| tree | 111add2ee72fa9e25687a80a993567b54d297e49 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
| parent | b8824a5d3f2f8d7a687520c4db641c4d53dc02a5 (diff) | |
| download | bcm5719-llvm-b42b48e051e9aaa374fe6da51acb15c7500072ca.tar.gz bcm5719-llvm-b42b48e051e9aaa374fe6da51acb15c7500072ca.zip | |
Remove the last manually constructed packet from gdb-remote register context + small refactor
Summary:
The tricky part here was that the exisiting implementation of WriteAllRegisters was expecting
hex-encoded data (as that was what the first implementation I replaced was using, but here we had
binary data to begin with. I thought the read/write register functions would be more useful if
they handled the hex-encoding themselves (all the other client functions provide the responses in
a more-or-less digested form). The read functions return a DataBuffer, so they can allocate as
much memory as they need to, while the write functions functions take an llvm::ArrayRef, as that
can be constructed from pretty much anything.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D23659
llvm-svn: 279232
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index be5c3b552c8..67fa0ee3730 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1991,7 +1991,10 @@ ProcessGDBRemote::SetThreadStopInfo (lldb::tid_t tid, { StringExtractor reg_value_extractor; reg_value_extractor.GetStringRef() = pair.second; - gdb_thread->PrivateSetRegisterValue (pair.first, reg_value_extractor); + DataBufferSP buffer_sp(new DataBufferHeap(reg_value_extractor.GetStringRef().size() / 2, 0)); + reg_value_extractor.GetHexBytes(buffer_sp->GetBytes(), buffer_sp->GetByteSize(), '\xcc'); + gdb_thread->PrivateSetRegisterValue( + pair.first, llvm::ArrayRef<uint8_t>(buffer_sp->GetBytes(), buffer_sp->GetByteSize())); } thread_sp->SetName (thread_name.empty() ? NULL : thread_name.c_str()); |

