aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-10-17 01:10:23 +0000
committerGreg Clayton <gclayton@apple.com>2013-10-17 01:10:23 +0000
commit312bcbe8b4820d66feb17949622c7c5cb4a5fb49 (patch)
tree03d6c3b3547ae98654becccb3880d2f07e1492ca /lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
parent8afa543737c102d40302b26f72ea8124353d583e (diff)
downloadllvm-312bcbe8b4820d66feb17949622c7c5cb4a5fb49.zip
llvm-312bcbe8b4820d66feb17949622c7c5cb4a5fb49.tar.gz
llvm-312bcbe8b4820d66feb17949622c7c5cb4a5fb49.tar.bz2
<rdar://problem/14972424>
- Made the dynamic register context for the GDB remote plug-in inherit from the generic DynamicRegisterInfo to avoid code duplication - Finished up the target definition python setting stuff. - Added a new "slice" key/value pair that can specify that a register is part of another register: { 'name':'eax', 'set':0, 'bitsize':32, 'encoding':eEncodingUint, 'format':eFormatHex, 'slice': 'rax[31:0]' }, - Added a new "composite" key/value pair that can specify that a register is made up of two or more registers: { 'name':'d0', 'set':0, 'bitsize':64 , 'encoding':eEncodingIEEE754, 'format':eFormatFloat, 'composite': ['s1', 's0'] }, - Added a new "invalidate-regs" key/value pair for when a register is modified, it can invalidate other registers: { 'name':'cpsr', 'set':0, 'bitsize':32 , 'encoding':eEncodingUint, 'format':eFormatHex, 'invalidate-regs': ['r8', 'r9', 'r10', 'r11', 'r12', 'r13', 'r14', 'r15']}, This now completes the feature that allows a GDB remote target to completely describe itself. llvm-svn: 192858
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp130
1 files changed, 0 insertions, 130 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
index 69dae05..61c6a13 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -697,136 +697,6 @@ GDBRemoteRegisterContext::ConvertRegisterKindToRegisterNumber (uint32_t kind, ui
return m_reg_info.ConvertRegisterKindToRegisterNumber (kind, num);
}
-size_t
-GDBRemoteDynamicRegisterInfo::SetRegisterInfo (const lldb_private::PythonDictionary &dict)
-{
-#ifndef LLDB_DISABLE_PYTHON
- PythonList sets (dict.GetItemForKey("sets"));
- if (sets)
- {
- const uint32_t num_sets = sets.GetSize();
- for (uint32_t i=0; i<num_sets; ++i)
- {
- PythonString py_set_name(sets.GetItemAtIndex(i));
- ConstString set_name;
- if (py_set_name)
- set_name.SetCString(py_set_name.GetString());
- if (set_name)
- {
- RegisterSet new_set = { set_name.AsCString(), NULL, 0, NULL };
- m_sets.push_back (new_set);
- }
- else
- {
- Clear();
- return 0;
- }
- }
- m_set_reg_nums.resize(m_sets.size());
- }
- PythonList regs (dict.GetItemForKey("registers"));
- if (regs)
- {
- const uint32_t num_regs = regs.GetSize();
- PythonString name_pystr("name");
- PythonString altname_pystr("alt-name");
- PythonString bitsize_pystr("bitsize");
- PythonString offset_pystr("offset");
- PythonString encoding_pystr("encoding");
- PythonString format_pystr("format");
- PythonString set_pystr("set");
- PythonString gcc_pystr("gcc");
- PythonString gdb_pystr("gdb");
- PythonString dwarf_pystr("dwarf");
- PythonString generic_pystr("generic");
- for (uint32_t i=0; i<num_regs; ++i)
- {
- PythonDictionary reg_info_dict(regs.GetItemAtIndex(i));
- if (reg_info_dict)
- {
- // { 'name':'rcx' , 'bitsize' : 64, 'offset' : 16, 'encoding':'uint' , 'format':'hex' , 'set': 0, 'gcc' : 2, 'dwarf' : 2, 'generic':'arg4', 'alt-name':'arg4', },
- RegisterInfo reg_info;
- bzero (&reg_info, sizeof(reg_info));
-
- reg_info.name = ConstString (reg_info_dict.GetItemForKeyAsString(name_pystr)).GetCString();
- if (reg_info.name == NULL)
- {
- Clear();
- return 0;
- }
-
- reg_info.alt_name = ConstString (reg_info_dict.GetItemForKeyAsString(altname_pystr)).GetCString();
-
- reg_info.byte_offset = reg_info_dict.GetItemForKeyAsInteger(offset_pystr, UINT32_MAX);
-
- if (reg_info.byte_offset == UINT32_MAX)
- {
- Clear();
- return 0;
- }
- reg_info.byte_size = reg_info_dict.GetItemForKeyAsInteger(bitsize_pystr, 0) / 8;
-
- if (reg_info.byte_size == 0)
- {
- Clear();
- return 0;
- }
-
- const char *format_cstr = reg_info_dict.GetItemForKeyAsString(format_pystr);
- if (format_cstr)
- {
- if (Args::StringToFormat(format_cstr, reg_info.format, NULL).Fail())
- {
- Clear();
- return 0;
- }
- }
- else
- {
- reg_info.format = (Format)reg_info_dict.GetItemForKeyAsInteger (format_pystr, eFormatHex);
- }
-
- const char *encoding_cstr = reg_info_dict.GetItemForKeyAsString(encoding_pystr);
- if (encoding_cstr)
- reg_info.encoding = Args::StringToEncoding (encoding_cstr, eEncodingUint);
- else
- reg_info.encoding = (Encoding)reg_info_dict.GetItemForKeyAsInteger (encoding_pystr, eEncodingUint);
-
- const int64_t set = reg_info_dict.GetItemForKeyAsInteger(set_pystr, -1);
- if (set >= m_sets.size())
- {
- Clear();
- return 0;
- }
-
- reg_info.kinds[lldb::eRegisterKindLLDB] = i;
- reg_info.kinds[lldb::eRegisterKindGDB] = reg_info_dict.GetItemForKeyAsInteger(gdb_pystr , LLDB_INVALID_REGNUM);
- reg_info.kinds[lldb::eRegisterKindGCC] = reg_info_dict.GetItemForKeyAsInteger(gcc_pystr , LLDB_INVALID_REGNUM);
- reg_info.kinds[lldb::eRegisterKindDWARF] = reg_info_dict.GetItemForKeyAsInteger(dwarf_pystr , LLDB_INVALID_REGNUM);
- const char *generic_cstr = reg_info_dict.GetItemForKeyAsString(generic_pystr);
- if (generic_cstr)
- reg_info.kinds[lldb::eRegisterKindGeneric] = Args::StringToGenericRegister (generic_cstr);
- else
- reg_info.kinds[lldb::eRegisterKindGeneric] = reg_info_dict.GetItemForKeyAsInteger(generic_pystr, LLDB_INVALID_REGNUM);
- const size_t end_reg_offset = reg_info.byte_offset + reg_info.byte_size;
- if (m_reg_data_byte_size < end_reg_offset)
- m_reg_data_byte_size = end_reg_offset;
-
- m_regs.push_back (reg_info);
- m_set_reg_nums[set].push_back(i);
-
- }
- else
- {
- Clear();
- return 0;
- }
- }
- Finalize ();
- }
-#endif
- return 0;
-}
void
GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters(bool from_scratch)