This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]