This is the mail archive of the gdb-patches@sourceware.cygnus.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]

Re: [PATCH] Allow mips64 code compiled with -mgp32 to be debuggable


Jonathan Larmour wrote:
> 
> The attached patch allows users to debug programs built for 64-bit MIPS
> processors but with the processor set to 32-bit mode. With gcc this would be
> specified with -mgp32. The thing that separates such programs from "normal"
> 32-bit programs is that they still have full use of the 64-bit floating
> point registers.
> 
> This cannot be handled with the multi-arch code in GDB, as there is nothing
> in the elf header that is set to indicate -mgp32 - it isn't an existing ABI.
> With this patch, users can just do "set mips-force-32bit-saved-gpregs" and
> everything works.
> 
> FYI, no current targets set MIPS_SAVED_REGSIZE right now, so changing the
> name should be okay.
> 
> Let me know if this is okay. Thanks,
> 
> Jifl
> 
> 2000-03-24  Jonathan Larmour  <jlarmour@redhat.co.uk>
> 
>         * mips-tdep.c (MIPS_SAVED_REGSIZE): Replace with
>         MIPS_DEFAULT_SAVED_REGSIZE
>         (MIPS_SAVED_REGSIZE): Allow overriding to 32bits if global
>         mips_force_32bit_saved_regsize is set
>         (mips_gdbarch_init): Default to MIPS_DEFAULT_SAVED_REGSIZE
>         (_initialize_mips_tdep): Add new boolean set command
>         mips-force-32bit-saved-gpregs

I think the patch is still only part way there.


Is GDB able to determine this specific setting of ``saved regsize'' from
just the executable?  Some ELF flag?  If GDB can't then things should be
put into play so that GDB can.  Perhaphs it already is?


I think the command is to specific.  It should instead allow the user to
specify any of:

	auto	GDB determine value from
		executable and other information

	32	GDB push 32 bit integer registers

	64	GDB push 64 bit integer registers

That way, we don't end up with a random collection of commands that all
twiddle the same knob.  Eventually other knobs to control other aspects
of the MIPS abi will be needed this is just the first one.
(Check how enums are handled by GDB - remote.c and the protocol packet).


Regarding the specific code:

> +#define MIPS_SAVED_REGSIZE (mips_force_32bit_saved_regsize != 0 ? 4 : \
> +                           MIPS_DEFAULT_SAVED_REGSIZE)

once the above is changed, this would be much better implemented as a
function.


Regarding the name, I'm eventually going to have to deprecate the
command as it currently stands and replace it with one with the form:

	(gdb) set mips ....

(This bit isn't your problem, however :-).


What are the testsuite results like with your change applied and
enabled?

	Andrew

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