This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH/RFC/RFA] remoute-e7000.c start h8300 multi-arching
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: Andrew Volkov <Andrew dot Volkov at transas dot com>
- Cc: gdb-patches at sources dot redhat dot com, Elena Zannoni <ezannoni at redhat dot com>
- Date: Tue, 21 May 2002 11:22:34 -0400
- Subject: Re: [PATCH/RFC/RFA] remoute-e7000.c start h8300 multi-arching
- References: <2E74F312D6980D459F3A05492BA40F8DDA498C@clue.transas.com>
Andrew Volkov writes:
> Hi,
>
> In this patch nearly all h8300 parts are multiarhing.
> Also removed use of depricated NUM_REALREGS and change
> literal reg. no. to REGNUMS
>
Thanks for starting this process. Removing NUM_REALREGS is a very good
move, since it is one of the few things left in tm-sh.h.
However, can I suggest reversing your sequence, i.e. start with making
multiarch changes to h8300-tdep.c, defining GDB_MULTI_ARCH and
then following up with the remote-e7000.c changes. (See the recent
patches to multiarch the v850 target as a good sequence of steps).
If you do that, you will not need to add these ifdef's.
I realize this is not trivial, given the dependencies between this
target and the h8500 and the sh.
Elena
> Andrey
>
> 2002-05-16 Andrey Volkov <avolkov@sources.redhat.com>
> * gdb/remote-e7000.c: multi-arched h8300 part
> remove depricated NUM_REALREGS
>
> --- gdb.old/gdb/remote-e7000.c Mon Apr 15 05:50:45 2002
> +++ gdb/gdb/remote-e7000.c Thu May 16 20:54:52 2002
> @@ -660,7 +660,9 @@
> serial_raw (e7000_desc);
>
> #ifdef GDB_TARGET_IS_H8300
> - h8300hmode = 1;
> + #if GDB_MULTI_ARCH == 0
> + h8300hmode = 1;
> + #endif
> #endif
>
> /* Start the remote connection; if error (0), discard this target.
> @@ -914,7 +916,11 @@
> #ifdef GDB_TARGET_IS_H8300
> if (TARGET_ARCHITECTURE->arch == bfd_arch_h8300)
> {
> +#if GDB_MULTI_ARCH == 0
> if (h8300smode)
> +#else
> + if (TARGET_ARCHITECTURE->mach == bfd_mach_h8300s)
> +#endif
> wanted = want_h8300s;
> else
> wanted = want_h8300h;
> @@ -924,7 +930,11 @@
> fetch_regs_from_dump (gch, wanted);
>
> /* And supply the extra ones the simulator uses */
> +#if GDB_MULTI_ARCH != 0
> + for (regno = NUM_REGS; regno < NUM_REGS + NUM_PSEUDO_REGS; regno++)
> +#else
> for (regno = NUM_REALREGS; regno < NUM_REGS; regno++)
> +#endif
> {
> int buf = 0;
>
> @@ -948,7 +958,11 @@
> {
> int regno;
>
> +#if GDB_MULTI_ARCH != 0
> + for (regno = 0; regno < NUM_REGS; regno++)
> +#else
> for (regno = 0; regno < NUM_REALREGS; regno++)
> +#endif
> e7000_store_register (regno);
>
> registers_changed ();
> @@ -969,7 +983,11 @@
>
> if (TARGET_ARCHITECTURE->arch == bfd_arch_h8300)
> {
> +#if GDB_MULTI_ARCH != 0
> + if (regno >= R0_REGNUM && regno <= R7_REGNUM)
> +#else
> if (regno <= 7)
> +#endif
> {
> sprintf (buf, ".ER%d %s\r", regno, phex_nz (read_register (regno),
> 0));
> puts_e7000debug (buf);
> @@ -2051,7 +2069,11 @@
> #ifdef GDB_TARGET_IS_H8300
> if (TARGET_ARCHITECTURE->arch == bfd_arch_h8300)
> {
> + #if GDB_MULTI_ARCH == 0
> if (h8300smode)
> + #else
> + if (TARGET_ARCHITECTURE->mach == bfd_mach_h8300s)
> + #endif
> wanted_nopc = want_nopc_h8300s;
> else
> wanted_nopc = want_nopc_h8300h;
> @@ -2060,7 +2082,11 @@
> fetch_regs_from_dump (gch, wanted_nopc);
>
> /* And supply the extra ones the simulator uses */
> +#if GDB_MULTI_ARCH != 0
> + for (regno = NUM_REGS; regno < NUM_REGS + NUM_PSEUDO_REGS; regno++)
> +#else
> for (regno = NUM_REALREGS; regno < NUM_REGS; regno++)
> +#endif
> {
> int buf = 0;
> supply_register (regno, (char *) &buf);