gdb: fixed faulty response to "read registers" command.

Due to incorrect trimming of register values, we sometimes sent a
reply packet which contained extra digits.
This commit is contained in:
Daniel Beer 2010-12-02 20:09:44 +13:00
parent 1f7808a78f
commit b8d461b8ba
1 changed files with 3 additions and 1 deletions

4
gdb.c
View File

@ -214,7 +214,9 @@ static int read_registers(struct gdb_data *data)
gdb_packet_start(data);
for (i = 0; i < DEVICE_NUM_REGS; i++)
gdb_printf(data, "%02x%02x", regs[i] & 0xff, regs[i] >> 8);
gdb_printf(data, "%02x%02x",
regs[i] & 0xff,
(regs[i] >> 8) & 0xff);
gdb_packet_end(data);
return gdb_flush_ack(data);
}