From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qNvqIrDO6GQ38QoAWB0awg (envelope-from ) for ; Fri, 25 Aug 2023 11:54:24 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=cycjbAfE; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8B66E1E0C2; Fri, 25 Aug 2023 11:54:24 -0400 (EDT) Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 79A2F1E092 for ; Fri, 25 Aug 2023 11:54:22 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0F2973858417 for ; Fri, 25 Aug 2023 15:54:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F2973858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1692978862; bh=/k0ND+3W8tSIf/W15/Sc9FgSGe14ijRoO0zU+PpJqjU=; h=Subject:To:Cc:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=cycjbAfEa6ii9sk+Ndl5geHMygjdyd9mm9CLSQJXOrYx9NKmOH6lQV02+J1fM5Nn6 bYRCdYh+IA6gK9C5cvnNgUfVEaekTPJ1Hm9D3dBpv4XGMVgxTgWQwLTnyX/OSLSMH0 1LqKGOzoZrY0IHQT7PuunwTIRDTEQ0VmEr8aiEHc= Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 831E43858C53 for ; Fri, 25 Aug 2023 15:53:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 831E43858C53 Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37PFPix5002667; Fri, 25 Aug 2023 15:53:55 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3spxtj8tj4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Aug 2023 15:53:54 +0000 Received: from m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 37PFJL49011228; Fri, 25 Aug 2023 15:53:54 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3spxtj8th6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Aug 2023 15:53:53 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 37PEoYdP026095; Fri, 25 Aug 2023 15:53:53 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([172.16.1.68]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3snqgtg41m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Aug 2023 15:53:53 +0000 Received: from smtpav05.dal12v.mail.ibm.com (smtpav05.dal12v.mail.ibm.com [10.241.53.104]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 37PFrqem36110990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Aug 2023 15:53:52 GMT Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1490658065; Fri, 25 Aug 2023 15:53:52 +0000 (GMT) Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 24BD158056; Fri, 25 Aug 2023 15:53:51 +0000 (GMT) Received: from wecm-9-67-137-54.wecm.ibm.com (unknown [9.67.137.54]) by smtpav05.dal12v.mail.ibm.com (Postfix) with ESMTP; Fri, 25 Aug 2023 15:53:50 +0000 (GMT) Message-ID: <6236dcd25a41dbc3ef970206383360aafa3321dd.camel@us.ibm.com> Subject: [PATCH 1/2] Add gdb_compile options column-info and no-column-info To: Simon Marchi , blarsen@redhat.com, gdb-patches@sourceware.org, UlrichWeigand , pedro@palves.net Cc: luis.machado@arm.com Date: Fri, 25 Aug 2023 08:53:50 -0700 In-Reply-To: <6d10baef346804f88821dd36cd8ab1aac3bf210a.camel@us.ibm.com> References: <6d10baef346804f88821dd36cd8ab1aac3bf210a.camel@us.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-22.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: uAy7vO3-FoLWCliqxL9HEzHHKHz2aE34 X-Proofpoint-ORIG-GUID: _FQ0Mhg86QyES2btypgDRZDIU1dURjKs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-25_13,2023-08-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxlogscore=999 phishscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 adultscore=0 spamscore=0 impostorscore=0 clxscore=1015 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2308250138 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Carl Love via Gdb-patches Reply-To: Carl Love Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Simon, GDB maintainers: Version 2, updated the compiler check and handling for gcc version 6 and earlier. Retested on Power 10. Per the comments on version 4 for the gdb.reverse/func-map-to-same- line.exp, I have added support to proc gdb_compile to enable or disable generating line information as part of the debug information. The two new options are column-info and no-column-info. This patch implements the new options for gdb_compile. These options have been tested with patch 2 of 2 on PowerPC with the GCC and clang compilers. Please let me know if the patch is acceptable for mainline. Thanks. Carl ------------------------------------------------------ Add gdb_compile options column-info and no-column-info This patch adds two new options to gdb_compile to specify if the compile should or should not generate the line table information. The options are supported on clang and gcc version 7 and newer. Patch has been tested on PowerPC with both gcc and clang. --- gdb/testsuite/lib/gdb.exp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 8432e636ecc..e321e4e5ecc 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4896,6 +4896,8 @@ proc quote_for_host { args } { # debug information # - text_segment=addr: Tell the linker to place the text segment at ADDR. # - build-id: Ensure the final binary includes a build-id. +# - no-column-info: Disable generation of column table information. +# - column-info: Enable generation of column table information. # # And here are some of the not too obscure options understood by DejaGnu that # influence the compilation: @@ -5105,6 +5107,38 @@ proc gdb_compile {source dest type options} { } else { error "Don't know how to handle text_segment option." } + } elseif { $opt == "column-info" } { + # If GCC or clang does not support column-info, compilation + # will fail and the usupported column-info option will be + # reported as such. + if {[test_compiler_info {gcc-*}]} { + lappend new_options "additional_flags=-gcolumn-info" + + } elseif {[test_compiler_info {clang-*}]} { + lappend new_options "additional_flags=-gcolumn-info" + + } else { + error "Don't know how to handle gcolumn-info option." + } + + } elseif { $opt == "no-column-info" } { + if {[test_compiler_info {gcc-*}]} { + if {[test_compiler_info {gcc-[1-6]-*}]} { + # In this case, don't add the compile line option and + # the result will be the same as using no-column-info + # on a version that supports the option. + warning "gdb_compile option no-column-info not supported, ignoring." + } else { + lappend new_options "additional_flags=-gno-column-info" + } + + } elseif {[test_compiler_info {clang-*}]} { + lappend new_options "additional_flags=-gno-column-info" + + } else { + error "Don't know how to handle gno-column-info option." + } + } else { lappend new_options $opt } -- 2.37.2