From 473b99e5721ad623cc5826e03a73e2cf6cef4eb5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcin=20Ko=C5=9Bcielnicki?= Date: Sat, 6 Feb 2016 16:30:01 +0100 Subject: [PATCH] gdb.trace: Fix off-by-one in tfile_fetch_registers. 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(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1bca0d79e1a..9f8aa1d5c41 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-02-10 Marcin Kościelnicki + + * tracefile-tfile.c (tfile_fetch_registers): Fix off-by-one in bounds + check. + 2016-02-10 Joel Brobecker * NEWS: Create a new section for the next release branch. diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c index b7618942359..dc7b05a05ff 100644 --- a/gdb/tracefile-tfile.c +++ b/gdb/tracefile-tfile.c @@ -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) { -- 2.30.2