[RFA] gdbtypes.h: Add "calling_convention" field to struct main_type

Corinna Vinschen vinschen@redhat.com
Thu Oct 7 09:46:00 GMT 2004


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.



More information about the Gdb-patches mailing list