This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: MIPS simulator initializes LSI pmon vector table with code
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: cgd at broadcom dot com
- Cc: gdb-patches at sources dot redhat dot com, fche at redhat dot com, echristo at redhat dot com
- Date: 19 Apr 2002 18:06:34 -0300
- Subject: Re: MIPS simulator initializes LSI pmon vector table with code
- Organization: GCC Team, Red Hat
- References: <orlmbkre4n.fsf@free.redhat.lsd.ic.unicamp.br><mailpost.1019159224.1687@news-sj1-1> <yov5vgaor5ky.fsf@broadcom.com>
On Apr 18, 2002, cgd@broadcom.com wrote:
> The code at 0xbfc00200, etc., _ARE_ supposed to be code; in MIPS
> they're various exception entry points. If they are data which is
> invalid code, the wrong thing will almost certainly happen.
Ok, so could you please explain to me how these two chunks of code can
possibly be correct:
if (lsipmon_monitor_base != 0)
{
address_word vaddr = (lsipmon_monitor_base + (loop * 4));
sim_write (sd, vaddr, (char *)&value, sizeof (value));
}
(where lsipmon_monitor_base is 0xBFC00200, and loop varies from 0 to
23. I read that as writing pointers into lsipmon_monitor_base)
sim_write (sd, 0xBFC00200, (char *) halt, sizeof (halt));
sim_write (sd, 0xBFC00380, (char *) halt, sizeof (halt));
sim_write (sd, 0xBFC00400, (char *) halt, sizeof (halt));
(where halt is 64-byte long chunk of code, which means that one of
these halts overwrites not only its own entry in lsipmon_monitor_base,
but also the following entry.)
> I cannot believe that any monitor does what you describe (puts a table
> of addresses here), as doing so (instead of putting vectors there)
> would be fundamentally incompatible with the MIPS architecture.
I stand corrected. It doesn't write pointers into chose chunks. I
misremembered what I had seen. The values of `value' that are written
in the first chunk of code as numbers that range from 6 to 28, except
for the printf service. However, I don't see how a code sequence that
halts the machine could possibly fit there as an entry in the vector
table.
Enlightenment would be appreciated.
Thanks,
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer