From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id lRQpIYFNVWUpTwcAWB0awg (envelope-from ) for ; Wed, 15 Nov 2023 18:00:17 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=KgY8994h; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 790C11E0D2; Wed, 15 Nov 2023 18:00:17 -0500 (EST) Received: from server2.sourceware.org (server2.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 0E2B51E00F for ; Wed, 15 Nov 2023 18:00:15 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5A411385841F for ; Wed, 15 Nov 2023 23:00:14 +0000 (GMT) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id BF3EB3858D20 for ; Wed, 15 Nov 2023 23:00:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF3EB3858D20 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 BF3EB3858D20 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=1700089202; cv=none; b=CxLiFlANcIYKpWGo+cg6fhEYK0GaeAULg4IRbUqeruohPgW4Iputh4OgUa5ACr7nZnxxE9lY5LUn7SNIQhF/leRyBPT5jDxI+jGzp66F96dTvKEX9u4KUlL5eS5qAAJvsVWoziffBhMqyicCLqUCaO5B8eqeZySsWOSZEHW8Z30= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700089202; c=relaxed/simple; bh=Wk5+m0gMwwBZNfUJAXP2hP1HFQvg0JE+/3hQBiag/94=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:Mime-Version; b=LllJKRRspLZ1+FBboVpVTqJKVzJ8sMvD5Sb/I2iccyb1hL1Sb5KQjT4tnqLB5NlF9nq7fqRv6vc8nOVMtSDki8I//8zozbhhhQ5EEX6N6thBhzjxNK1ZruNrZ+67AO3ULRMeG7/k7vtRjyzn29m1EvUjfreSFpVHemLNruqZ7/4= ARC-Authentication-Results: i=1; server2.sourceware.org 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 3AFMdcHQ005586; Wed, 15 Nov 2023 22:59:59 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=ikUTXH0ep/PsLVqbJm6yKtSy6fRYGz06wxdNRkJpCoQ=; b=KgY8994hxXerYO271rNc0v3jJb+Trp+bpBo55lsBH8cpcYl2ZvOZKaKL4+Sy56oRDXVQ XOG1jaeqoz363Rq+P69oL3aJ3f/A0csSxYOVeb2RaF7Ec9RvFEi3NB+06ZKLkfEOPnJk TY22PZ/O8ucn7/U+D3fN8AKeJDIXKUjI4vN+EeF9EUPITFEx1PmkozLwPQO8pBzJMKIE FkwYi3WMbyxqA/zMYvqnCIHIkI+YoSpRqFWycs3JKMthrGGUf6sanvpDmlcljfcyjzq2 9kWSysC9jLGICLiQ/JXJrf62/GyFV8aAfkask18vxOBEli3Re9BRXL3qIksoLOu6LaKq cg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ud6ykgdh4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 22:59:59 +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 3AFMeekM009392; Wed, 15 Nov 2023 22:59:58 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ud6ykgdgv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 22:59:58 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3AFKJ08S015505; Wed, 15 Nov 2023 22:59:58 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([172.16.1.8]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uamxnjps9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Nov 2023 22:59:58 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3AFMxvP918744026 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Nov 2023 22:59:57 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6FB795805A; Wed, 15 Nov 2023 22:59:57 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B4BAB58051; Wed, 15 Nov 2023 22:59:56 +0000 (GMT) Received: from wecm-9-67-110-146.wecm.ibm.com (unknown [9.67.110.146]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 15 Nov 2023 22:59:56 +0000 (GMT) Message-ID: Subject: Re: Ada compile with -fvar-tracking From: Carl Love To: Keith Seitz , tromey@adacore.com, cel@us.ibm.com Cc: gdb-patches@sourceware.org Date: Wed, 15 Nov 2023 14:59:56 -0800 In-Reply-To: <6eed52fac162f4082974fb71580a938059bdc4ef.camel@linux.ibm.com> References: <871qcsp1h9.fsf@tromey.com> <87ttpongbg.fsf@tromey.com> <1d5e5408487d26a90cded2f599cba75ee60c2c6b.camel@linux.ibm.com> <87a5rfnjl2.fsf@tromey.com> <504ba270f8a70484ea6135dea17a59fa74e94de8.camel@linux.ibm.com> <87ttpnlzl1.fsf@tromey.com> <4a7949f073a8e758f6e7e9591277f2cc9a99de4e.camel@linux.ibm.com> <4a88dca4-1020-461a-ad7a-616541e58064@redhat.com> <6eed52fac162f4082974fb71580a938059bdc4ef.camel@linux.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: FpcweT61bk3U9kI6AgFUwOzaPZEmKYop X-Proofpoint-ORIG-GUID: cCGKitc_sEi-2ofC2bWp-3kaedUzlSz6 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-15_20,2023-11-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 bulkscore=0 clxscore=1015 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311150181 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Keith, Tom: Well, fortunately debugging the expect script went fairly fast. I did find the error. There are a million ways to shoot yourself in the foot and I found yet another way... :-) This is actually rather educational. Starting with the patch... --- a/gdb/testsuite/gdb.ada/finish-large.exp +++ b/gdb/testsuite/gdb.ada/finish-large.exp @@ -19,7 +19,9 @@ require allow_ada_tests standard_ada_testfile p -if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} { +set flags {debug additional_flags=-cargs additional_flags=-fvar- tracking additional_flags=-margs} + +if {[gdb_compile_ada "${srcfile}" "${binfile} " executable $flags] != ""} { return -1 } If you notice in the new line we have "${binfile} ", notice the space before the closing quote. That is the root cause of the compilation failing!! So looking at gdb/testsuite/lib/ada.exp we have proc gdb_compile_ada {source dest type options} { set result [gdb_compile_ada_1 $source $dest $type $options] gdb_compile_test $source $result return $result } Note, gdb_compile_test expects $result to be empty. If not it will be interpreted as a compile failure. So the second argument "${binfile} " is passed in as dest which is passed to gdb_compile_ada_1. There is a very interesting comment at the bottom of proc gdb_compile_ada_1. proc gdb_compile_ada_1 {source dest type options} { set srcdir [file dirname $source] set gprdir [file dirname $srcdir] set objdir [file dirname $dest] file delete $dest # Although strictly not necessary, we force the recompilation # of all units (additional_flags=-f). This is what is done # when using GCC to build programs in the other languages, # and it avoids using a stray objfile file from a long-past # run, for instance. append options " ada" if {[lsearch -exact $options no-force] == -1} { append options " additional_flags=-f" } append options " additional_flags=-I$srcdir" set result [target_compile_ada_from_dir \ $objdir [file tail $source] $dest $type $options] # The Ada build always produces some output, even when the build # succeeds. Thus, we can not use the output the same way we do in # gdb_compile to determine whether the build has succeeded or not. # We therefore simply check whether the dest file has been created # or not. Unless not present, the build has succeeded. puts "CARLL, dest = $dest.\n" ##Carl added this for debugging if [file exists $dest] { set result "" } return $result } So we have a test to see if file $dest exists or not. Well initially with out my patch the value of $dest is printed by my debugging statemet as CARLL, dest = /home/carll/GDB/build-ada/gdb/testsuite/outputs/gdb.ada/finish-large/p. The file exists so $result is cleared and gdb_compile_test sees and empty and thus the compile succeeds. However, that extra space in my patch file argument "${binfile} " results in the value of $dest being: CARLL, dest = /home/carll/GDB/build-ada/gdb/testsuite/outputs/gdb.ada/finish-large/p . Again, note the space after p and before the period. Well the if [file exists $dest] fails for this file name. Apparently it thinks the extra space is a valid file name character so result is not cleared and gdb_compile_test reports the compile failed. So by removing that extra space in my original patch, the test now compiles and passes since the DW_TAG_call_site information is available so gdb can determine what the value of r3 was on entry to the test program function. Thanks to Tom for helping get the correct options passed to the ada compiler to get the -fvar-tracking option to work. I am sure I didn't have the additional arguments when I initially worked on this. So, with the fixed patch test finish-large.exp works. There are a couple other tests that I think will need the same fix to enable the -fvar-tracking since the functions return a structure. Will have to look at them next. Thanks to both of you for your help with this. Carl