This is the mail archive of the gdb-patches@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: [RFA] mips_push_arguments gdbarch-ified


Andrew Cagney wrote:



> These changes fix 16 testsuite failures, based in the Irix native
> compiler running with -n32 (and produce no regressions for -o32).

Yes, with tweaks.

General comment.  You may want to consider restructuring the function to
read:

for (argument in arguments)
   for (argument broken down in to 8 byte chunks)
     if (fp argument && fnpreg <= num fp arg regs)
       write argument chunk to fp register
     else if (!fp argument && reg <= num arg regs)
       write chunk (carefully aligned) to gp register
     else
       write chunk to (carefully aligned) memory

OK, I've checked in, with all of your tweaks except for the above.
Come on, you can't ask me to restructure the whole function  just
to get what was originally a 5-line change in!!!    ;-)
If you haven't already, look through the document:
http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=bks&srch=&fname=/SGI_Developer/Mpro_n32_ABI/sgi_html/ch02.html
which Kevin cited. The above was based on that. With the introduction of a new mips_n32n64_push_arguments() unction there is an oportunity to start with a clean slate. To be honest, I think taking that oportunity will make getting this working much easier! :-)

As it is, I've fixed a bunch of bugs that weren't mine, just to get this in. Diffs that went in attached below.
Oops, I didn't mean for you to touch the old mips_push_arguments() code. That can be left to rot.

2002-08-09  Michael Snyder  <msnyder@redhat.com>

	* mips-tdep.c (ROUND_DOWN, ROUND_UP): Move to global scope.
	(mips_push_arguments): Correct some comments.  Use paddr_nz
	for printing addresses in debug output.  Replace static
	allocation using MAX_REGISTER_RAW_SIZE with alloca.
	(mips_n32n64_push_arguments): New function, cloned from
	mips_push_arguments and tuned for the n32/n64 ABI.
	(mips_push_register): Buffer needs dynamic allocation.
	(mips_print_register): Ditto.
	(do_gp_register_row): Ditto.
	(mips_store_return_value): Ditto.
	(mips_gdbarch_init): Set gdbarch_push_arguments per ABI.
ok, thanks
Andrew



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