[4/4] gdb.trace: Fix off-by-one in tfile_fetch_registers.
Commit Message
This resulted in the last register being considered unavailable.
On plain x86_64 (without AVX), this happened to be orig_rax.
gdb/ChangeLog:
* tracefile-tfile.c (tfile_fetch_registers): Fix off-by-one in bounds
check.
---
gdb/ChangeLog | 5 +++++
gdb/tracefile-tfile.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
Comments
On 02/06/2016 03:39 PM, Marcin Kościelnicki wrote:
> This resulted in the last register being considered unavailable.
> On plain x86_64 (without AVX), this happened to be orig_rax.
>
> gdb/ChangeLog:
>
> * tracefile-tfile.c (tfile_fetch_registers): Fix off-by-one in bounds
> check.
OK.
Thanks,
Pedro Alves
On 10/02/16 14:21, Pedro Alves wrote:
> On 02/06/2016 03:39 PM, Marcin Kościelnicki wrote:
>> This resulted in the last register being considered unavailable.
>> On plain x86_64 (without AVX), this happened to be orig_rax.
>>
>> gdb/ChangeLog:
>>
>> * tracefile-tfile.c (tfile_fetch_registers): Fix off-by-one in bounds
>> check.
>
> OK.
>
> Thanks,
> Pedro Alves
>
Thanks, pushed.
@@ -1,5 +1,10 @@
2016-02-06 Marcin Kościelnicki <koriakin@0x04.net>
+ * tracefile-tfile.c (tfile_fetch_registers): Fix off-by-one in bounds
+ check.
+
+2016-02-06 Marcin Kościelnicki <koriakin@0x04.net>
+
* tracefile-tfile.c (tfile_fetch_registers): Use g packet order
instead of gdb order.
@@ -879,7 +879,7 @@ tfile_fetch_registers (struct target_ops *ops,
regsize = register_size (gdbarch, regn);
/* Make sure we stay within block bounds. */
- if (offset + regsize >= trace_regblock_size)
+ if (offset + regsize > trace_regblock_size)
break;
if (regcache_register_status (regcache, regn) == REG_UNKNOWN)
{