This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Execution pipeline (2nd)
- To: "Pierre Saucourt-Harmel (r54698)" <pierre dot saucourt-harmel at motorola dot com>
- Subject: Re: Execution pipeline (2nd)
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Mon, 19 Feb 2001 22:03:02 +0000
- Cc: gdb-patches at sourceware dot cygnus dot com
- Organization: Red Hat UK Ltd.
- References: <3A896A68.3414D006@motorola.com> <3A8CF11F.2E4EE510@motorola.com>
"Pierre Saucourt-Harmel (r54698)" wrote:
>
> > Moreover, tracing the gdb-5.0 code, I probably found two bugs in the
> > arm-tdep.c file, when code loops across tables of NUM_REGS registers.
> > In two cases (check_prologue_cache () and save_prologue_cache ()), the
> > loops go after the last element of the register tables. As I don't have
> > a more recent version of gdb-5.0, I don't know if they were fixed yet.
Well spotted. I'm checking the attached patch in under the "obviously
correct" rule.
Jifl
2001-02-19 Jonathan Larmour <jlarmour@redhat.com>
* arm-tdep.c (check_prologue_cache): Fix off by 1 error.
(save_prologue_cache): Ditto.
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.9
diff -u -5 -p -r1.9 arm-tdep.c
--- arm-tdep.c 2000/09/06 23:39:15 1.9
+++ arm-tdep.c 2001/02/19 22:00:42
@@ -633,11 +633,11 @@ check_prologue_cache (struct frame_info
if (fi->pc == prologue_cache.pc)
{
fi->framereg = prologue_cache.framereg;
fi->framesize = prologue_cache.framesize;
fi->frameoffset = prologue_cache.frameoffset;
- for (i = 0; i <= NUM_REGS; i++)
+ for (i = 0; i < NUM_REGS; i++)
fi->fsr.regs[i] = prologue_cache.fsr.regs[i];
return 1;
}
else
return 0;
@@ -654,11 +654,11 @@ save_prologue_cache (struct frame_info *
prologue_cache.pc = fi->pc;
prologue_cache.framereg = fi->framereg;
prologue_cache.framesize = fi->framesize;
prologue_cache.frameoffset = fi->frameoffset;
- for (i = 0; i <= NUM_REGS; i++)
+ for (i = 0; i < NUM_REGS; i++)
prologue_cache.fsr.regs[i] = fi->fsr.regs[i];
}
/* This function decodes an ARM function prologue to determine: