Re: [RFC] Correct gdbserver register packets

Daniel Jacobowitz
2002-12-02T01:14:39Z

On Tue, Nov 26, 2002 at 06:27:36PM +0100, Pierre Muller wrote:
> Currently the cvs sources of gdbserver
> for m68k linux have a problem.
>
> The problem comes from the fact that the
> register packet is build from the data in regformats
> directory. But the m68k cpu file contains two
> registers that are apparently not accessible
> (or at least not fetched by current gdb).
>
> This causes connection to remote server to
> stay stucked affect
> that warning.
> reading register 29: Input/output error
>
> My patch is a liitle bit more genral because I
> read that there are similar problems for other configuration.
>
> The main idea is to add a new function
> int
> register_present( int regno)
>
> that by default allways returns one but
> that can be implmented by the target that do
> no supply all the regsiters
> that are in the regformats dir.
>
> The final patches can be separated probably, but I would first like to
> get comments on the general direction.

I don't think there's a point yet. Eventually, once we have a way to
express it properly in the remote protocol, we can handle returning
not-available for registers. For now all we should need is:

> ChangeLog entry
>
> 2002-11-26 Pierre Muller <muller@ics.u-strasbg.fr>
>
> * linux-m68k-low.c (m68k_regmap): Add missing -1.

> Index: linux-m68k-low.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbserver/linux-m68k-low.c,v
> retrieving revision 1.3
> diff -u -p -r1.3 linux-m68k-low.c
> --- linux-m68k-low.c 9 Apr 2002 22:44:43 -0000 1.3
> +++ linux-m68k-low.c 26 Nov 2002 15:26:47 -0000
> @@ -45,24 +45,36 @@ static int m68k_regmap[] =
> #ifdef PT_FP0
> PT_FP0 * 4, PT_FP1 * 4, PT_FP2 * 4, PT_FP3 * 4,
> PT_FP4 * 4, PT_FP5 * 4, PT_FP6 * 4, PT_FP7 * 4,
> - PT_FPCR * 4, PT_FPSR * 4, PT_FPIAR * 4
> + PT_FPCR * 4, PT_FPSR * 4, PT_FPIAR * 4,
> #else
> 21 * 4, 24 * 4, 27 * 4, 30 * 4, 33 * 4, 36 * 4,
> - 39 * 4, 42 * 4, 45 * 4, 46 * 4, 47 * 4
> + 39 * 4, 42 * 4, 45 * 4, 46 * 4, 47 * 4,
> #endif
> + -1, -1
> };
>

Or else Andreas's patch to decrease the number of registers. Hmm,
probably doing it Andreas's way is better. I'll take care of this in
the morning.