This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] off by one error in gdbserver/linux-amd64-ipa.c
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Pedro Alves <pedro at codesourcery dot com>
- Date: Sat, 26 Feb 2011 14:31:13 -0800
- Subject: [RFA] off by one error in gdbserver/linux-amd64-ipa.c
Pretty sure this should be greater than or equal.
Michael
2011-02-26 Michael Snyder <msnyder@vmware.com>
* linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error
in comparison.
Index: linux-amd64-ipa.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-amd64-ipa.c,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 linux-amd64-ipa.c
--- linux-amd64-ipa.c 1 Jan 2011 15:33:24 -0000 1.4
+++ linux-amd64-ipa.c 26 Feb 2011 22:28:15 -0000
@@ -69,7 +69,7 @@ supply_fast_tracepoint_registers (struct
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]);