Article View: gnu.gdb.bug
Article #2786Bug found in gdb-4.16 for target h8300.
From: Magdalena Raltcheva
Date: Tue, 22 Jan 2002 04:59
Date: Tue, 22 Jan 2002 04:59
45 lines
2874 bytes
2874 bytes
Hi,
There is a bug in file h8300-tdep.c function 'examine_prologue',
when is checking for push multiple instructions as follows:
/* Now check for push multiple insns. */
if (insn_word == 0x0110 || insn_word == 0x0120 || insn_word ==
0x0130)
{
int count = ((insn_word >> 4) & 0xf) + 1;
int start, i;
ip = next_ip;
next_ip = NEXT_PROLOGUE_INSN (ip, limit, &insn_word);
start = insn_word & 0x7;
for (i = start; i <= start + count; i++)
{
fsr->regs[i] = after_prolog_fp + auto_depth;
auto_depth += 4;
}
}
The 'for' statement should be :
for (i = start; i < start + count; i++)
This bug will cause frame registers to be wrong and 'backtrace'
and show registers in gdb will be wrong.
I've tested the fix for Hitachi HS2000 series microcontrollers
and it works.
For Hitachi H8300 series it is not a problem as they don't have
multiple pop/push instructions.
Regards,
Magda Raltcheva
--------------------------------------------------------------------
This e-mail message has been scanned and cleared for delivery to its intended recipients. Only the intended recipient may access or use it. Any distribution, use, dissemination, reproduction, copying of this e-mail without prior written consent is prohibited. If you are not the intended recipient, please notify us immediately by return e-mail and then delete this e-mail.
Visit our website at http://www.codan.com.au
--------------------------------------------------------------------
Technical Details
Message-ID:
<3C4CF1BB.58C39927@codan.com.au>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdbShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,d62f17b12886199b,start X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 2002-01-21 21:01:59 PST x-uunet-gateway: chi6sosrv11.alter.net from bug-gdb to gnu.gdb.bug; Tue, 22 Jan 2002 05:01:58 GMT Sender: magdar@codan.com.au Message-ID: <3C4CF1BB.58C39927@codan.com.au> Date: Tue, 22 Jan 2002 15:29:39 +1030 From: magdar@codan.com.au (Magdalena Raltcheva) X-Mailer: Mozilla 4.76 [en] (X11; U; SunOS 5.6 sun4u) X-Accept-Language: en MIME-Version: 1.0 Subject: Bug found in gdb-4.16 for target h8300. X-MIMETrack: Itemize by SMTP Server on AUADLLNT01/Codan(Release 5.0.2c (Intl)|2 February 2000) at 22/01/2002 15:30:16, Serialize by Router on AUADLLNT01/Codan(Release 5.0.2c (Intl)|2 February 2000) at 22/01/2002 15:30:17, Serialize complete at 22/01/2002 15:30:17 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Approved: bug-gdb-request@mail.gnu.org Newsgroups: gnu.gdb.bug Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb Lines: 45