Commit 703dc714 authored by oharboe's avatar oharboe
Browse files

- fixed a problem with big endian XScale and GDB register packets.
- hmm..... did I screw up? Was XScale and not gdb_server busted here?
  My thinking was that OpenOCD has a canonical internal representation
  of registers that match GDB's expectations


git-svn-id: svn://svn.berlios.de/openocd/trunk@484 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent e6dac739
......@@ -773,21 +773,10 @@ void gdb_str_to_target(target_t *target, char *tstr, reg_t *reg)
buf = reg->value;
buf_len = CEIL(reg->size, 8);
if (target->endianness == TARGET_LITTLE_ENDIAN)
for (i = 0; i < buf_len; i++)
{
for (i = 0; i < buf_len; i++)
{
tstr[i*2] = DIGITS[(buf[i]>>4) & 0xf];
tstr[i*2+1] = DIGITS[buf[i]&0xf];
}
}
else
{
for (i = 0; i < buf_len; i++)
{
tstr[(buf_len-1-i)*2] = DIGITS[(buf[i]>>4)&0xf];
tstr[(buf_len-1-i)*2+1] = DIGITS[buf[i]&0xf];
}
tstr[i*2] = DIGITS[(buf[i]>>4) & 0xf];
tstr[i*2+1] = DIGITS[buf[i]&0xf];
}
}
......@@ -802,20 +791,10 @@ void gdb_target_to_str(target_t *target, char *tstr, char *str)
exit(-1);
}
if (target->endianness == TARGET_LITTLE_ENDIAN)
for (i = 0; i < str_len; i+=2)
{
for (i = 0; i < str_len; i+=2)
{
str[str_len - i - 1] = tstr[i + 1];
str[str_len - i - 2] = tstr[i];
}
}
else
{
for (i = 0; i < str_len; i++)
{
str[i] = tstr[i];
}
str[str_len - i - 1] = tstr[i + 1];
str[str_len - i - 2] = tstr[i];
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment