Send default register number instead of GDB register number in StopReplyPacket.

Summary:
Using GDB register numbers confuses ProcessGDBRemote since the rest of
LLGS (qRegisterInfo, p, P) uses the default register numbers instead.

Test Plan: dosep.py --options --arch x86 ...

Reviewers: ovyalov, vharron, sivachandra

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7635

llvm-svn: 229505
This commit is contained in:
Chaoren Lin 2015-02-17 15:41:28 +00:00
parent 6a504f6ea8
commit caf3114245
1 changed files with 5 additions and 19 deletions

View File

@ -446,24 +446,6 @@ WriteRegisterValueInHexFixedWidth (StreamString &response,
}
}
static void
WriteGdbRegnumWithFixedWidthHexRegisterValue (StreamString &response,
NativeRegisterContextSP &reg_ctx_sp,
const RegisterInfo &reg_info,
const RegisterValue &reg_value)
{
// Output the register number as 'NN:VVVVVVVV;' where NN is a 2 bytes HEX
// gdb register number, and VVVVVVVV is the correct number of hex bytes
// as ASCII for the register value.
if (reg_info.kinds[eRegisterKindGDB] == LLDB_INVALID_REGNUM)
return;
response.Printf ("%.02x:", reg_info.kinds[eRegisterKindGDB]);
WriteRegisterValueInHexFixedWidth (response, reg_ctx_sp, reg_info, &reg_value);
response.PutChar (';');
}
GDBRemoteCommunication::PacketResult
GDBRemoteCommunicationServerLLGS::SendStopReplyPacketForThread (lldb::tid_t tid)
{
@ -588,7 +570,11 @@ GDBRemoteCommunicationServerLLGS::SendStopReplyPacketForThread (lldb::tid_t tid)
RegisterValue reg_value;
Error error = reg_ctx_sp->ReadRegister (reg_info_p, reg_value);
if (error.Success ())
WriteGdbRegnumWithFixedWidthHexRegisterValue (response, reg_ctx_sp, *reg_info_p, reg_value);
{
response.Printf ("%.02x:", *reg_num_p);
WriteRegisterValueInHexFixedWidth(response, reg_ctx_sp, *reg_info_p, &reg_value);
response.PutChar (';');
}
else
{
if (log)