From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 703B43858C50 for ; Thu, 23 Nov 2023 05:45:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 703B43858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 703B43858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700718323; cv=none; b=H4rqVhlGF6cKDk2/vUaX5wua8qGqUBrSnVTjCbJNWWmZHjwICMdER7biqHOA62G9jT5M+Gif7V/jaAozvQUfU5zSSoo5seFIS6WKb0u71+CPABoQnFx7LSyWIPb0E2bfri6xVpFy9GsP8xSgn96c9taIr+I8bqMN327XoF+zBOk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700718323; c=relaxed/simple; bh=GwdB+3JJXjGuz8FeyunX5lklSp2Z4Fu+8orZ3Bo14Do=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:Mime-Version; b=twAeY13NNp2Hv8YkH6i98e4tiDXOu9P241PlBAMSQlwCydr0BbwHATlAMfksYUCUifPNnV5JrVKEyHinb/lBuM1g7KBdhCnghUx85y3XyDxDPxr/7eIgtcoGAwQtIg06MTGYRKQkJ4C4AF/fuqy3gggn46Fzaqnh64uft9LXq2c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AMMu0N8013577; Wed, 22 Nov 2023 23:33:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=x5/rXF9wRXVWSURTrdIJqm5R3eF5F7oTPUIEAr3SObs=; b=VCLbu6xq/IIGwAhsVvH2O9dwDHvm0Mygt6l5NTFq3CpHRrKetHL0aCc6y8GcoKQHE21m lOdHas+RvveNNAbEsDxzBLUEs/h3Pm4q5L18Yp5rb5mv/qjiN0sFC7endRQqYtx+na0p 9I2rqP6kJ59/tVyzj2PWauM01YBQ7JM8e+iptIXbT2pu+Rhfzy6Zhan0ZvYpsF9cj79U M9/ptCEWe/qwk2QK8WGBCjOKHVGWV40+DATCqezloztqmn+1582PR5nlfyc4xAHuMNZD zXDiTnUUATQtsTgJC1rGnQREgdESuvPzIjFbrB3S7jYsIMYTuRokKrI6kgmAve0H69vy UA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uhtv48nk9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Nov 2023 23:33:11 +0000 Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3AMNLqIc011480; Wed, 22 Nov 2023 23:33:11 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3uhtv48njw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Nov 2023 23:33:11 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3AML4IUV030413; Wed, 22 Nov 2023 23:33:10 GMT Received: from smtprelay04.wdc07v.mail.ibm.com ([172.16.1.71]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3uf7ktbv55-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Nov 2023 23:33:10 +0000 Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay04.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AMNX9QS43254378 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Nov 2023 23:33:09 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 52B3B58045; Wed, 22 Nov 2023 23:33:09 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E93A458050; Wed, 22 Nov 2023 23:33:07 +0000 (GMT) Received: from wecm-9-67-78-200.wecm.ibm.com (unknown [9.67.78.200]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 22 Nov 2023 23:33:07 +0000 (GMT) Message-ID: <0743198c95396b679bd2215a6518d9e97ffa80f5.camel@linux.ibm.com> Subject: [ PATCH 1/3] Fix GDB reverse execution behavior From: Carl Love To: Luis Machado , blarsen@redhat.com, Ulrich Weigand , gdb-patches@sourceware.org Cc: Carl Love , Pedro Alves , Tom Tromey , Simon Marchi Date: Wed, 22 Nov 2023 15:33:07 -0800 In-Reply-To: References: <890101c23dd5fa60fcbf9d4b299cb2a533c260b7.camel@linux.ibm.com> <1e702d8f-e5b4-4719-b1e7-42210f350305@arm.com> <643afce1-ab9b-4e8b-bcbb-5738dc409a28@arm.com> <9e17008084c34f953f5318933436ec703250120a.camel@linux.ibm.com> <92a751d1-a4b9-4c21-821e-a1dc67207516@arm.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-ORIG-GUID: n8Hy-ey6I3rlTjUJSBq-04daYl8m5wEr X-Proofpoint-GUID: nODLQCfmU9FLvJ_QwUfkzCdqo4d6hWp_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-22_18,2023-11-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=682 mlxscore=0 phishscore=0 clxscore=1015 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311220173 X-Spam-Status: No, score=-11.2 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_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: GDB maintainers: This patch in the series is unchanged from the previously posted version 2 patch of patch 1 in the previous patch series. 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 and patch 3 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 63885860795..a63394d5cc0 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -5150,6 +5150,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. +# - column-info/no-column-info: Enable/Disable generation of column table +# information. # # And here are some of the not too obscure options understood by DejaGnu that # influence the compilation: @@ -5359,6 +5361,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 "Option gcolumn-info option not supported by compiler." + } + + } 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 "Option gno-column-info option not supported by compiler." + } + } else { lappend new_options $opt } -- 2.41.0