gdb.trace: Fix off-by-one in tfile_fetch_registers.
authorMarcin Kościelnicki <koriakin@0x04.net>
Sat, 6 Feb 2016 15:30:01 +0000 (16:30 +0100)
committerMarcin Kościelnicki <koriakin@0x04.net>
Wed, 10 Feb 2016 13:50:22 +0000 (14:50 +0100)
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
gdb/tracefile-tfile.c

index 1bca0d79e1a93be3b89d85be487854a3929772f8..9f8aa1d5c4116e9c19ce2e7586275ccb5db03e95 100644 (file)
@@ -1,3 +1,8 @@
+2016-02-10  Marcin Kościelnicki  <koriakin@0x04.net>
+
+       * tracefile-tfile.c (tfile_fetch_registers): Fix off-by-one in bounds
+       check.
+
 2016-02-10  Joel Brobecker  <brobecker@adacore.com>
 
        * NEWS: Create a new section for the next release branch.
index b7618942359eae94249f8b4cee0ec50c172303c4..dc7b05a05ff16688080abe0f0f2d07df5c82906f 100644 (file)
@@ -816,7 +816,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)
            {