This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
RE: Adding MAC registers on H8300 Simulator [H8S/2600]
- From: Andrew Volkov <Andrew dot Volkov at transas dot com>
- To: "D.Venkatasubramanian, Noida" <dvenkat at noida dot hcltech dot com>,Kazu Hirata <kazu at cs dot umass dot edu>, Petr Ledvina <ledvinap at n dot cz>
- Cc: gnuh8 at gnuh8 dot org dot uk, gdb at sources dot redhat dot com
- Date: Thu, 20 Feb 2003 21:27:58 +0300
- Subject: RE: Adding MAC registers on H8300 Simulator [H8S/2600]
Hi, all
Peoples, at first, please look in file include/gdb/sim-h8300.h, This file
(more then half year ago old) ALREADY contain MACH and MACL numbers.
And also contain some useful constants too, i.e. SIM_H8300_NUM_COMMON_REGS,
SIM_H8300_S_NUM_REGS, SIM_H8300_NUM_REGS.
> > As the H8S/2600 CPU has MAC registers, specifically
> > MACH and MACL, I added them to the H8300 Simulator. How
> > do I make GDB recognize these registers, more
> > specifically, what are the files that need to be
> > modified?
sim/h8300/compile.c (IMHO, better rewrite it from scratch ;) and
gdb/h8300-tdep.c
Also look at multiarch patch from 2002-08-06 in gdb-patches archive
(It was not accepted and replaced by Corina's multiarch patch). Also,
if you have much time, very best way is write model for cgen.
> in target definition, NUM_REGS specifies how many registers gdb uses.
> REGISTER_NAME return name of given register.
> This vector already contains special registers (cycles, inst,
> .. ), so it
> should be possible to add new registers.
> gdbstub needs to only know register index mapping, so adding
> new registers
> to end of this list should be compatible.
>
> Also check cvs log, someone (Andrew Volkov?) added exr
> register recently
> to simulator, so he could know better.
>
> > Also, how do I make these registers conditionally
> > displayed on GDB when the CPU is H8S/2600.
> IIRC gdb knows only h8s target, so this could be quite difficult.
Kazu, this question to you, remember our chat about new BFD target for
h8s/2600?
I dont't add real MAC support to simulator, 'cause bumped same problem,
only one solution I found - command to enable/disable MAC directly :(.
Andrey Volkov