From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21520 invoked by alias); 7 Oct 2004 09:53:10 -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 21456 invoked from network); 7 Oct 2004 09:53:04 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 7 Oct 2004 09:53:04 -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 i979r3GP004297 for ; Thu, 7 Oct 2004 05:53:03 -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 i979r3r27722 for ; Thu, 7 Oct 2004 05:53:03 -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 i979r0Vb023549 for ; Thu, 7 Oct 2004 05:53:01 -0400 Received: by cygbert.vinschen.de (Postfix, from userid 500) id 0B8E458092; Thu, 7 Oct 2004 11:54:01 +0200 (CEST) Date: Thu, 07 Oct 2004 09:53:00 -0000 From: Corinna Vinschen To: gdb-patches@sources.redhat.com Subject: [RFA] Add parse_dwarf2_calling_convention functionality Message-ID: <20041007095401.GN6702@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/msg00130.txt.bz2 Hi, the second patch to prepare the calling convention stuff. It just adds the parse_dwarf2_calling_convention functionality to gdbarch. The below patch contains only the patch to gdbarch.sh (not the auto-generated gdbarch.[ch]) and the new default_parse_dwarf2_calling_convention function in arch-utils. Ok to apply? Corinna * gdbarch.sh (parse_dwarf2_calling_convention): New method. * gdbarch.h, gdbarch.c: Re-generate. * arch-utils.c (default_parse_dwarf2_calling_convention): New function. * arch-utils.h (default_parse_dwarf2_calling_convention): New extern declaration. Index: gdbarch.sh =================================================================== RCS file: /cvs/src/src/gdb/gdbarch.sh,v retrieving revision 1.348 diff -u -p -r1.348 gdbarch.sh --- gdbarch.sh 2 Sep 2004 17:22:08 -0000 1.348 +++ gdbarch.sh 7 Oct 2004 09:46:56 -0000 @@ -664,6 +664,10 @@ F:=:CORE_ADDR:fetch_pointer_argument:str # Return the appropriate register set for a core file section with # name SECT_NAME and size SECT_SIZE. M::const struct regset *:regset_from_core_section:const char *sect_name, size_t sect_size:sect_name, sect_size + +# Evaluate DW_AT_calling_convention value and convert in a calling_convention +# value in the functions main type. +m::void:parse_dwarf2_calling_convention:int has_attr, unsigned long attr_val, unsigned char gcc_compiled, struct type *func_type:has_attr, attr_val, gcc_compiled, func_type:0:default_parse_dwarf2_calling_convention::0 EOF } Index: arch-utils.c =================================================================== RCS file: /cvs/src/src/gdb/arch-utils.c,v retrieving revision 1.122 diff -u -p -r1.122 arch-utils.c --- arch-utils.c 5 Aug 2004 14:12:38 -0000 1.122 +++ arch-utils.c 7 Oct 2004 09:46:56 -0000 @@ -331,6 +331,15 @@ default_stabs_argument_has_addr (struct return 0; } +void +default_parse_dwarf2_calling_convention (struct gdbarch *gdbarch, + int has_attr, unsigned long attr_val, + unsigned char gcc_compiled, + struct type *func_type) +{ + TYPE_CALLING_CONVENTION (func_type) = attr_val; +} + /* Functions to manipulate the endianness of the target. */ Index: arch-utils.h =================================================================== RCS file: /cvs/src/src/gdb/arch-utils.h,v retrieving revision 1.75 diff -u -p -r1.75 arch-utils.h --- arch-utils.h 5 Aug 2004 14:12:38 -0000 1.75 +++ arch-utils.h 7 Oct 2004 09:46:56 -0000 @@ -119,6 +119,13 @@ extern int generic_convert_register_p (i extern int default_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type); +/* By default, just use the dwarf2 val for the type's calling_convention. */ +extern void default_parse_dwarf2_calling_convention (struct gdbarch *gdbarch, + int has_attr, + unsigned long attr_val, + unsigned char gcc_compiled, + struct type *func_type); + /* For compatibility with older architectures, returns (LEGACY_SIM_REGNO_IGNORE) when the register doesn't have a valid name. */ -- Corinna Vinschen Cygwin Project Co-Leader Red Hat, Inc.