Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Corinna Vinschen <vinschen@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] gdbtypes.h: Add "calling_convention" field to struct main_type
Date: Thu, 07 Oct 2004 09:46:00 -0000	[thread overview]
Message-ID: <20041007094727.GM6702@cygbert.vinschen.de> (raw)

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.


             reply	other threads:[~2004-10-07  9:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-07  9:46 Corinna Vinschen [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041007094727.GM6702@cygbert.vinschen.de \
    --to=vinschen@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox