From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15998 invoked by alias); 7 Oct 2004 09:46:38 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15952 invoked from network); 7 Oct 2004 09:46:34 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 7 Oct 2004 09:46:34 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i979kTxT003014 for ; Thu, 7 Oct 2004 05:46:29 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i979kTr26604 for ; Thu, 7 Oct 2004 05:46:29 -0400 Received: from cygbert.vinschen.de (vpn50-15.rdu.redhat.com [172.16.50.15]) by potter.sfbay.redhat.com (8.12.8/8.12.8) with ESMTP id i979kQVb023315 for ; Thu, 7 Oct 2004 05:46:27 -0400 Received: by cygbert.vinschen.de (Postfix, from userid 500) id DCBA658092; Thu, 7 Oct 2004 11:47:27 +0200 (CEST) Date: Thu, 07 Oct 2004 09:46:00 -0000 From: Corinna Vinschen To: gdb-patches@sources.redhat.com Subject: [RFA] gdbtypes.h: Add "calling_convention" field to struct main_type Message-ID: <20041007094727.GM6702@cygbert.vinschen.de> Reply-To: gdb-patches@sources.redhat.com Mail-Followup-To: gdb-patches@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2i X-SW-Source: 2004-10/txt/msg00129.txt.bz2 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.