Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] gdbtypes.h: Add "calling_convention" field to struct main_type
@ 2004-10-07  9:46 Corinna Vinschen
  2004-10-08 11:19 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2004-10-07  9:46 UTC (permalink / raw)
  To: gdb-patches

Hi,

the below patch prepares the grounds for the bigger calling convention
patch still to follow.

The basic idea and the bigger picture of that patch has been published
on the GDB mailing list on 2003-08-22:

  http://sources.redhat.com/ml/gdb/2003-08/msg00252.html

Several changes to GDB have outdated parts of the proposal, namely Andrew
Cagney's invention of EXTRACT_RETURN_VALUE and Randolf Chung's change to
give a struct value * to PUSH_DUMMY_CALL instead of just the function
address, but the general approach is still valid and has to be implemented
to get multiple ABIs working in an automated fashion.  The necessary changes
to gcc are also WIP.


This tiny little patch attached to this posting just adds the
calling_convention field to struct main_type and an appropriate macro
to access it.

Ok to apply?


Corinna

	* gdbtypes.h (struct_main_type): Add member calling_convention.
	(TYPE_CALLING_CONVENTION): New macro.

Index: gdbtypes.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.h,v
retrieving revision 1.60
diff -u -p -r1.60 gdbtypes.h
--- gdbtypes.h	1 Oct 2004 10:23:09 -0000	1.60
+++ gdbtypes.h	7 Oct 2004 09:12:02 -0000
@@ -377,6 +377,13 @@ struct main_type
 
   int flags;
 
+  /* For a function type, contains a value which ABI is used for this
+     function call.  This is meaningful for targets which allow to mix
+     multiple calling conventions within the same executable.  The
+     content of this field is written and evaluated by target specific
+     code only.  */
+  int calling_convention;
+
   /* Number of fields described for this type */
 
   short nfields;
@@ -804,6 +811,7 @@ extern void allocate_cplus_struct_type (
 #define TYPE_LENGTH(thistype) (thistype)->length
 #define TYPE_OBJFILE(thistype) TYPE_MAIN_TYPE(thistype)->objfile
 #define TYPE_FLAGS(thistype) TYPE_MAIN_TYPE(thistype)->flags
+#define TYPE_CALLING_CONVENTION(thistype) TYPE_MAIN_TYPE(thistype)->calling_convention
 /* Note that TYPE_CODE can be TYPE_CODE_TYPEDEF, so if you want the real
    type, you need to do TYPE_CODE (check_type (this_type)). */
 #define TYPE_CODE(thistype) TYPE_MAIN_TYPE(thistype)->code

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat, Inc.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-10-08 20:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-07  9:46 [RFA] gdbtypes.h: Add "calling_convention" field to struct main_type Corinna Vinschen
2004-10-08 11:19 ` Eli Zaretskii
2004-10-08 16:18   ` Corinna Vinschen
2004-10-08 18:37     ` Eli Zaretskii
2004-10-08 20:18       ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox