From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ODuBH80JZGQ2KwwAWB0awg (envelope-from ) for ; Tue, 16 May 2023 18:55:09 -0400 Received: by simark.ca (Postfix, from userid 112) id 7D9111E11E; Tue, 16 May 2023 18:55:09 -0400 (EDT) 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=n9GVg1EH; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 17FF11E0D4 for ; Tue, 16 May 2023 18:55:09 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EC1703857733 for ; Tue, 16 May 2023 22:55:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC1703857733 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684277708; bh=BHXLbYgfKoriL5OoRDRP8NFji8L9I7Dr6niPC6nhK6A=; h=To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=n9GVg1EHc/2SnF/C07q5fuXmsm7RmKBN+nv3KoYqBhkRHW2gQ69B/nQnA+iikk5dT +emuVJ+46B0sm82SDWujUHsnUzt90KAzDTx2OIfIMZYfk+1N5YwzEX6kIroe8xXYcD Sn0SILCN4RkT9k84MuWQf7uRphyHcQ7e3xK+q0/Y= Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id D0FE03856261 for ; Tue, 16 May 2023 22:54:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D0FE03856261 Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34GMfXgH002337; Tue, 16 May 2023 22:54:32 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qmhauapcc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 22:54:31 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34GMfoEw002947; Tue, 16 May 2023 22:54:31 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qmhauapc7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 22:54:31 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34GKl48W025394; Tue, 16 May 2023 22:54:30 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([9.208.129.113]) by ppma02dal.us.ibm.com (PPS) with ESMTPS id 3qj265ycj4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 22:54:30 +0000 Received: from smtpav06.wdc07v.mail.ibm.com (smtpav06.wdc07v.mail.ibm.com [10.39.53.233]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34GMsS9V64946508 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 May 2023 22:54:29 GMT Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D899E58054; Tue, 16 May 2023 22:54:28 +0000 (GMT) Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 14C535804E; Tue, 16 May 2023 22:54:28 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.163.31.184]) by smtpav06.wdc07v.mail.ibm.com (Postfix) with ESMTP; Tue, 16 May 2023 22:54:27 +0000 (GMT) Message-ID: To: Simon Marchi , Bruno Larsen , gdb-patches@sourceware.org, UlrichWeigand , pedro@palves.net Cc: luis.machado@arm.com, cel@us.ibm.com Date: Tue, 16 May 2023 15:54:27 -0700 In-Reply-To: <0943e12c-049d-f8b0-c4c5-8816b1be1e45@simark.ca> References: <74630f1ccb6e9258ae60682105ee5490726fb255.camel@us.ibm.com> <46d73c69-9168-44c6-b515-23dd893fc0eb@redhat.com> <86c65f2ad74caffc162f100e4e9c5be9062a7f59.camel@us.ibm.com> <0a2c4ebd-f01d-4b96-1b13-25d7276056a5@redhat.com> <956b8c3c9a7bdc3aa6f9a040619ec4778edc9c94.camel@us.ibm.com> <89b2fb027024f7e97de7196ee091a0ca11c0c2b3.camel@us.ibm.com> <0943e12c-049d-f8b0-c4c5-8816b1be1e45@simark.ca> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: m9RZhiSxrcwiLyAef1oz-oSXo56doiIu X-Proofpoint-ORIG-GUID: -1Ds1xXEEg_Ec5UiiHL4To25F-V1brYw Subject: RE: [PATCH v4] Fix reverse stepping multiple contiguous PC ranges over the line table. X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-16_12,2023-05-16_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 clxscore=1011 spamscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305160191 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: On Thu, 2023-05-11 at 12:01 -0400, Simon Marchi wrote: > > > I'd like to help reviewing this, but I don't have much time at the > moment, so just a few comments on one test to start with. > > > + This test is used to test the reverse-step and reverse-next > > instruction > > + execution for a source line that contains multiple function > > calls. */ > > + > > +void > > +func1 () > > +{ > > +} // END FUNC1 > > Use /* */ for comments, for consistency with the rest of the code > base. > OK, changed all instances of // comment. > > + > > +void > > +func2 () > > +{ > > +} // END FUNC2 > > + > > +int main () > > +{ > > + int a, b; > > + a = 1; > > + b = 2; > > + func1 (); func2 (); > > + a = a + b; // START REVERSE TEST > > +} > > > > + > > +require supports_reverse > > + > > +# This test uses the gcc no-column-info command which was added in > > gcc 7.1. > > +if {![test_compiler_info {gcc-*}] > > + || [test_compiler_info {gcc-[1-6]-*}]} { > > + return > > +} > > I would prefer not to filter out by compiler explicitly like that. > It would be useful for the test to run with other compilers too. OK, implemented the gdb_compile options. Moved the specific gcc version test there. > > > + > > +proc run_tests {} { > > + global srcfile > > + > > +set srcfile func-map-to-same-line.c > > +set executable func-map-to-same-line > > + > > +# test with gcc column info enabled > > +set options [list debug additional_flags=] > > + > > +if {[build_executable "failed to prepare" $executable $srcfile > > $options] == -1}\ > > + { > > + return -1 > > +} > > + > > +clean_restart $executable > > + > > +with_test_prefix "with-column-info" { > > + run_tests > > +} > > So, the above assumes that the compiler generates column-info by > default, which has not historically been the case for GCC (it started > to > emit columns by default with version 8, according to my > tests). Other > compilers may choose to not emit them by default. > > I think it would make sense to make gdb_compile recognize the new > "column-info" and "no-column-info" options, which would translate to > the > right flags for the given compiler. gdb_compile already handles the > nitty gritty details of choosing compiler flags for specific compiler > versions. This way, individual tests don't contain compiler flags > that > are possibly compiler-specific. OK, I think I have this implemented as suggested. It does seem to work. I added both gcc and clang support. Per the link to clang which does have line info options. I put the new gdb_compile option support in a separate patch, followed by the updated "Fix reverse stepping multiple.... " patch. I tested the test case with: make check RUNTESTFLAGS='CC_FOR_TARGET=clang GDB=.../gdb gdb.reverse/func-map-to-same-line.exp' > out and make check RUNTESTFLAGS='GDB=.../gdb gdb.reverse/func-map-to-same-line.exp' > out I looked in the gdb/testsuite/gdb.log file to verify that the compiler line (gcc or clang) explicitly has the -gcolumn-info for the first test and -gno-column-info for the second test. The expected number of success were seen for the test with gcc and clang. It all looks like it works. > > > + > > +#test with gcc column info disabled > > +set options [list debug additional_flags=-gno-column-info] > > + > > +if {[build_executable "failed to prepare" $executable $srcfile > > $options] == -1}\ > > + { > > + return -1 > > +} > > + > > +set $executable executable_without_column_info > > +clean_restart $executable > > + > > +with_test_prefix "no-column-info" { > > + run_tests > > +} > > This would probably be a good use for foreach_with_prefix (if you can > make it work), to make things more compact: > > foreach_with_prefix with_column_info {yes no} { > } > > ... or something like that. Changed to the foreach_with_prefix. Thanks for the review. Will post version 5 as a series of two patches. Carl