From 35f5825a72aa7f4fcddc06f6505f3ab3f39951ff Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Sun, 27 Feb 2011 21:18:14 +0000 Subject: [PATCH] 2011-02-26 Michael Snyder * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error in comparison. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/linux-amd64-ipa.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index ed1bf12..29b175f 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2011-02-27 Michael Snyder + + * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error + in comparison. + 2011-02-26 Michael Snyder * utils.c (decimal2str): Eliminate dead code and dead param. diff --git a/gdb/gdbserver/linux-amd64-ipa.c b/gdb/gdbserver/linux-amd64-ipa.c index 359a689..60665a7 100644 --- a/gdb/gdbserver/linux-amd64-ipa.c +++ b/gdb/gdbserver/linux-amd64-ipa.c @@ -69,7 +69,7 @@ supply_fast_tracepoint_registers (struct regcache *regcache, ULONGEST __attribute__ ((visibility("default"), used)) gdb_agent_get_raw_reg (const unsigned char *raw_regs, int regnum) { - if (regnum > X86_64_NUM_FT_COLLECT_GREGS) + if (regnum >= X86_64_NUM_FT_COLLECT_GREGS) return 0; return *(ULONGEST *) (raw_regs + x86_64_ft_collect_regmap[regnum]); -- 2.7.4