This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] mips-n32 reg_struct_has_addr
- From: Andrew Cagney <ac131313 at ges dot redhat dot com>
- To: Michael Snyder <msnyder at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 06 Aug 2002 18:02:43 -0400
- Subject: Re: [RFA] mips-n32 reg_struct_has_addr
- References: <3D49EC2D.86CF5517@redhat.com>
+ static int
+ mips_newabi_reg_struct_has_addr (int gcc_p, struct type *type)
+ {
+ enum type_code typecode = TYPE_CODE (check_typedef (type));
+ int len = TYPE_LENGTH (check_typedef (type));
+
+ if (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)
+ return (len > MIPS_SAVED_REGSIZE && len % MIPS_SAVED_REGSIZE != 0);
+
+ return 0;
+ }
No, I don't think this is right. As best I can tell, there is no cap on
the size of a struct that is passed by register.
http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi/srch3@o32/0650/bks/SGI_Developer/books/Mpro_n32_ABI/sgi_html/ch02.html#id80931
I.e., o32 and n32/n64 are the same -> never pass structures by reference.
*************** mips_push_arguments (int nargs,
*** 2428,2448 ****
"mips_push_arguments: %d len=%d type=%d",
argnum + 1, len, (int) typecode);
! /* The EABI passes structures that do not fit in a register by
Per other e-mail, rather than modify the existing mips_push_argument()
can you please created a dedicated mips_n32n64_push-arguments() function
and hack on that. That way, I don't have to worry about the other ABIs.
+ /* Set up reg_struct_has_addr. */
+ set_gdbarch_reg_struct_has_addr (gdbarch,
BTW, the comment here is redundant.
enjoy,
Andrew