Re: [RFC/m32r] Add gdbserver support to m32r-linux

Daniel Jacobowitz
2005-04-12T12:16:39Z

On Tue, Apr 12, 2005 at 02:06:17PM +0900, Kei Sakamoto wrote:
> +linux-m32r-low.o: linux-m32r-low.c $(linux_low_h) $(server_h) ../m32r-tdep.h

This doesn't seem to be necessary.

> +#define m32r_num_regs 25
> +
> +static int m32r_regmap[] = {
> +#ifdef PT_R0
> + PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5, PT_R6, PT_R7,
> + PT_R8, PT_R9, PT_R10, PT_R11, PT_R12, PT_FP, PT_LR, PT_SPU,
> + PT_PSW, PT_CBR, PT_SPI, PT_SPU, PT_BPC, PT_PC, PT_ACCL, PT_ACCH, PT_EVB
> +#else
> + 4 * 4, 4 * 5, 4 * 6, 4 * 7, 4 * 0, 4 * 1, 4 * 2, 4 * 8,
> + 4 * 9, 4 * 10, 4 * 11, 4 * 12, 4 * 13, 4 * 24, 4 * 25, 4 * 23,
> + 4 * 19, 4 * 31, 4 * 26, 4 * 23, 4 * 20, 4 * 30, 4 * 16, 4 * 15, 4 * 32
> +#endif
> +};

You've got 25 regs here...

> +static int
> +m32r_cannot_store_register (int regno)
> +{
> + return (regno >= m32r_num_regs);
> +}
> +
> +static int
> +m32r_cannot_fetch_register (int regno)
> +{
> + return (regno >= m32r_num_regs);
> +}

And you allow storing to registers 0-24 here...

> Index: regformats/reg-m32r.dat
> ===================================================================
> RCS file: regformats/reg-m32r.dat
> diff -N regformats/reg-m32r.dat
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ regformats/reg-m32r.dat 12 Apr 2005 04:27:26 -0000
> @@ -0,0 +1,45 @@
> +name:m32r
> +expedite:pc,lr,sp
> +32:r0
> +32:r1
> +32:r2
> +32:r3
> +32:r4
> +32:r5
> +32:r6
> +32:r7
> +32:r8
> +32:r9
> +32:r10
> +32:r11
> +32:r12
> +32:fp
> +32:lr
> +32:sp
> +32:psw
> +32:cbr
> +32:spi
> +32:spu
> +32:bpc
> +32:pc
> +32:accl
> +32:acch

... but this is only 24; what about evb?

> +
> +32:
> +32:
> +32:
> +32:
> +32:
> +32:
> +32:
> +32:
> +32:
> +32:
> +32:
> +32:
> +32:
> +32:
> +32:
> +32:
> +32:
> +32:

Did you test without this padding? If nothing follows it, I don't
believe the trailing padding is necessary.

--
Daniel Jacobowitz
CodeSourcery, LLC