summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-05-09 20:18:18 +0000
committerGreg Clayton <gclayton@apple.com>2011-05-09 20:18:18 +0000
commit7349bd90786bb6f738d775a5044181f6111eb614 (patch)
treecac83b5e20bfe6cf8053948566c567fd9daf5d69 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
parent112a2de78cfa8a32965f1c87243fe601941809f0 (diff)
downloadbcm5719-llvm-7349bd90786bb6f738d775a5044181f6111eb614.tar.gz
bcm5719-llvm-7349bd90786bb6f738d775a5044181f6111eb614.zip
While implementing unwind information using UnwindAssemblyInstEmulation I ran
into some cleanup I have been wanting to do when reading/writing registers. Previously all RegisterContext subclasses would need to implement: virtual bool ReadRegisterBytes (uint32_t reg, DataExtractor &data); virtual bool WriteRegisterBytes (uint32_t reg, DataExtractor &data, uint32_t data_offset = 0); There is now a new class specifically designed to hold register values: lldb_private::RegisterValue The new register context calls that subclasses must implement are: virtual bool ReadRegister (const RegisterInfo *reg_info, RegisterValue &reg_value) = 0; virtual bool WriteRegister (const RegisterInfo *reg_info, const RegisterValue &reg_value) = 0; The RegisterValue class must be big enough to handle any register value. The class contains an enumeration for the value type, and then a union for the data value. Any integer/float values are stored directly in an appropriate host integer/float. Anything bigger is stored in a byte buffer that has a length and byte order. The RegisterValue class also knows how to copy register value bytes into in a buffer with a specified byte order which can be used to write the register value down into memory, and this does the right thing when not all bytes from the register values are needed (getting a uint8 from a uint32 register value..). All RegiterContext and other sources have been switched over to using the new regiter value class. llvm-svn: 131096
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
index 3848ffcd50d..315284780a4 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
@@ -208,21 +208,15 @@ public:
GetRegisterSet (uint32_t reg_set);
virtual bool
- ReadRegisterValue (uint32_t reg, lldb_private::Scalar &value);
+ ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value);
virtual bool
- ReadRegisterBytes (uint32_t reg, lldb_private::DataExtractor &data);
-
+ WriteRegister (const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value);
+
virtual bool
ReadAllRegisterValues (lldb::DataBufferSP &data_sp);
virtual bool
- WriteRegisterValue (uint32_t reg, const lldb_private::Scalar &value);
-
- virtual bool
- WriteRegisterBytes (uint32_t reg, lldb_private::DataExtractor &data, uint32_t data_offset);
-
- virtual bool
WriteAllRegisterValues (const lldb::DataBufferSP &data_sp);
virtual uint32_t
@@ -232,6 +226,17 @@ protected:
friend class ThreadGDBRemote;
bool
+ ReadRegisterBytes (const lldb_private::RegisterInfo *reg_info,
+ lldb_private::RegisterValue &value,
+ lldb_private::DataExtractor &data);
+
+ bool
+ WriteRegisterBytes (const lldb_private::RegisterInfo *reg_info,
+ const lldb_private::RegisterValue &value,
+ lldb_private::DataExtractor &data,
+ uint32_t data_offset);
+
+ bool
PrivateSetRegisterValue (uint32_t reg, StringExtractor &response);
void
OpenPOWER on IntegriCloud