From: Marcin Kościelnicki Date: Sat, 6 Feb 2016 15:30:01 +0000 (+0100) Subject: gdb.trace: Fix off-by-one in tfile_fetch_registers. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=473b99e5721ad623cc5826e03a73e2cf6cef4eb5;p=binutils-gdb.git 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. --- 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) {