From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96031 invoked by alias); 31 Oct 2019 20:13:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 95841 invoked by uid 89); 31 Oct 2019 20:13:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy= X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 Oct 2019 20:12:59 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id A06CC2053D; Thu, 31 Oct 2019 16:12:57 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 4BABC2031F; Thu, 31 Oct 2019 16:12:56 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 3BDBB20AF6; Thu, 31 Oct 2019 16:12:56 -0400 (EDT) X-Gerrit-PatchSet: 3 Date: Thu, 31 Oct 2019 20:13:00 -0000 From: "Tankut Baris Aktemur (Code Review)" To: gdb-patches@sourceware.org Cc: Simon Marchi , Tom Tromey , Andrew Burgess Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review v3] gdb: recognize new DWARF attributes: defaulted, deleted, calling conv. X-Gerrit-Change-Id: I54192f363115b78ec7435a8563b73fcace420765 X-Gerrit-Change-Number: 135 X-Gerrit-ChangeURL: X-Gerrit-Commit: a825c03a63dd439218f06f9cfbf3a3abaa291357 In-Reply-To: References: X-Gerrit-Comment-Date: Thu, 31 Oct 2019 16:12:56 -0400 Reply-To: gnutoolchain-gerrit@osci.io MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3-75-g9005159e5d Content-Type: text/plain; charset=UTF-8 Message-Id: <20191031201256.3BDBB20AF6@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-10/txt/msg01202.txt.bz2 Tankut Baris Aktemur has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/135 ...................................................................... Patch Set 3: (3 comments) https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/135/2/gdb/dwarf2read.c File gdb/dwarf2read.c: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/135/2/gdb/dwarf2read.c@15831 PS2, Line 15831: 15822 | is_valid_DW_AT_calling_convention (ULONGEST value) | ... 15826 | case DW_CC_normal: 15827 | case DW_CC_program: 15828 | case DW_CC_nocall: 15829 | case DW_CC_pass_by_reference: 15830 | case DW_CC_pass_by_value: 15831 > case DW_CC_lo_user: 15832 > case DW_CC_hi_user: 15833 | /* case DW_CC_GNU_renesas_sh: Duplicate of DW_CC_lo_user. */ 15834 | case DW_CC_GNU_borland_fastcall_i386: 15835 | /* case DW_CC_GDB_IBM_OpenCL: Duplicate of DW_CC_hi_user. */ 15836 | return true; 15837 | } > I don' think we should include lo_user and hi_user in the switch, since they are not "real" values. […] Ack https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/135/2/gdb/dwarf2read.c@15928 PS2, Line 15928: 15857 | read_structure_type (struct die_info *die, struct dwarf2_cu *cu) | ... 15923 | TYPE_DECLARED_CLASS (type) = 1; 15924 | 15925 | /* Store the calling convention in the type if it's available in 15926 | the die. Otherwise the calling convention remains set to 15927 | the default value DW_CC_normal. */ 15928 > attr = dwarf2_attr (die, DW_AT_calling_convention, cu); 15929 | if (attr != nullptr 15930 | && is_valid_DW_AT_calling_convention (DW_UNSND (attr))) 15931 | { 15932 | ALLOCATE_CPLUS_STRUCT_TYPE (type); 15933 | TYPE_CPLUS_CALLING_CONVENTION (type) > According to table 5. […] Yes, makes much sense. https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/135/3/gdb/dwarf2read.c File gdb/dwarf2read.c: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/135/3/gdb/dwarf2read.c@15452 PS3, Line 15452: 15444 | is_valid_DW_AT_defaulted (ULONGEST value) | ... 15447 | { 15448 | case DW_DEFAULTED_no: 15449 | case DW_DEFAULTED_in_class: 15450 | case DW_DEFAULTED_out_of_class: 15451 | return true; 15452 > } 15453 | 15454 | complaint (_("unrecognized DW_AT_defaulted value (%lu)"), value); 15455 | return false; 15456 | } 15457 | I did not put a "default" case here whereas in 'is_valid_DW_AT_calling_convention_for_type' there is one. This is intentional. In case a new enum constant is added to 'dwarf_defaulted_attribute', a friendly compiler may warn about an uncaught case here. This was not possible in 'is_valid_DW_AT_calling_convention_for_type' as some values are already not valid. -- Gerrit-Project: binutils-gdb Gerrit-Branch: master Gerrit-Change-Id: I54192f363115b78ec7435a8563b73fcace420765 Gerrit-Change-Number: 135 Gerrit-PatchSet: 3 Gerrit-Owner: Tankut Baris Aktemur Gerrit-Reviewer: Andrew Burgess Gerrit-Reviewer: Simon Marchi Gerrit-Reviewer: Tankut Baris Aktemur Gerrit-CC: Tom Tromey Gerrit-Comment-Date: Thu, 31 Oct 2019 20:12:56 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: Simon Marchi Gerrit-MessageType: comment