From 0ba20241a619562b984551a542094cfdf6dd339b Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Mon, 21 Jan 2013 23:32:42 +0000 Subject: [PATCH] Changed the register number lists for the qRegisterInfo packet response to be raw hex to match all other register reading and writing APIs. llvm-svn: 173105 --- lldb/docs/lldb-gdb-remote.txt | 12 ++++++------ .../Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 8 ++++++-- lldb/tools/debugserver/source/RNBRemote.cpp | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lldb/docs/lldb-gdb-remote.txt b/lldb/docs/lldb-gdb-remote.txt index 68dc898ba472..83473d325e82 100644 --- a/lldb/docs/lldb-gdb-remote.txt +++ b/lldb/docs/lldb-gdb-remote.txt @@ -371,15 +371,15 @@ generic If the register is a generic register that most CPUs have, classify arguments when the argument fits into a register) container-regs - The value for this key is a comma separated list of decimal register - numbers. + The value for this key is a comma separated list of raw hex (no + leading "0x") register numbers. This specifies that this register is contained in other concrete register values. For example "eax" is in the lower 32 bits of the "rax" register value for x86_64, so "eax" could specify that it is contained in "rax" by specifying the register number for "rax". - "container-regs:0,1;" + "container-regs:00,0a,3b;" This is handy for defining what GDB used to call "pseudo" registers. These registers are never requested by LLDB via the register read @@ -387,13 +387,13 @@ container-regs of this register. invalidate-regs - The value for this key is a comma separated list of decimal register - numbers. + The value for this key is a comma separated list of raw hex (no + leading "0x") register numbers. This specifies which register values should be invalidated when this register is modified. - "invalidate-regs:1,2,3;" + "invalidate-regs:01,0b,1e;" This is handy when modifying a specific register can cause other register values to change. For example, when debugging an ARM target, diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index ce220d33abd9..07ced0df7982 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -382,7 +382,9 @@ ProcessGDBRemote::BuildDynamicRegisterInfo (bool force) value_pair = value_pair.second.split(','); if (!value_pair.first.empty()) { - value_regs.push_back (Args::StringToUInt32 (value_pair.first.str().c_str())); + uint32_t reg = Args::StringToUInt32 (value_pair.first.str().c_str(), LLDB_INVALID_REGNUM, 16); + if (reg != LLDB_INVALID_REGNUM) + value_regs.push_back (reg); } } while (!value_pair.second.empty()); } @@ -395,7 +397,9 @@ ProcessGDBRemote::BuildDynamicRegisterInfo (bool force) value_pair = value_pair.second.split(','); if (!value_pair.first.empty()) { - invalidate_regs.push_back (Args::StringToUInt32 (value_pair.first.str().c_str())); + uint32_t reg = Args::StringToUInt32 (value_pair.first.str().c_str(), LLDB_INVALID_REGNUM, 16); + if (reg != LLDB_INVALID_REGNUM) + invalidate_regs.push_back (reg); } } while (!value_pair.second.empty()); } diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp index 4e75715bdf3b..bcab419cd48d 100644 --- a/lldb/tools/debugserver/source/RNBRemote.cpp +++ b/lldb/tools/debugserver/source/RNBRemote.cpp @@ -1572,7 +1572,7 @@ RNBRemote::HandlePacket_qRegisterInfo (const char *p) { if (i > 0) ostrm << ','; - ostrm << DECIMAL << reg_entry->nub_info.update_regs[i]; + ostrm << RAW_HEXBASE << reg_entry->nub_info.update_regs[i]; } ostrm << ';'; }