From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 755183858D32 for ; Thu, 10 Aug 2023 19:26:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 755183858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=us.ibm.com Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37AJN6IY001926; Thu, 10 Aug 2023 19:26:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : content-type : mime-version : content-transfer-encoding; s=pp1; bh=vbfBRpqKjdUPPT6llGcy2jQe3sN5lL3hg9NXXKJDmxA=; b=W2tg283QJS4BSvd37ivnQt/cb9Ke3f5rnsUFNjedoXO5/BYOjpXwR4Yf7TJwYMSLYpo7 RcsMoBzFLN4RFymIKeOyN/NW51FVNjnIPqqMABKX3EywAEiFGAkwChq+482ljneeSzzY yXFsHvtGLrFosisZ1iYTCtLn9JL6InXEVWZyFd42P5U3f5M0o7VO3jcv/D+t55fyOHF0 /8NAd9xoA2LP3a/HmI8qX7ev0L7KjcOiFeonrYNUvwFtxTJhne8KGeMWGU7LKH9Sn0l0 CJs2KQvfdLUr7wbMu4MpKARxuhv9zvxFKqcwlNakUoiOBlEuVZgJLA2BugRYpaKBbcuL MQ== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3sd60p01g5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Aug 2023 19:26:14 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 37AHK2Ih006403; Thu, 10 Aug 2023 19:26:12 GMT Received: from smtprelay05.wdc07v.mail.ibm.com ([172.16.1.72]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3sd2ev9qc9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Aug 2023 19:26:12 +0000 Received: from smtpav05.dal12v.mail.ibm.com (smtpav05.dal12v.mail.ibm.com [10.241.53.104]) by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 37AJQBgh4850300 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Aug 2023 19:26:11 GMT Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5467E58052; Thu, 10 Aug 2023 19:26:11 +0000 (GMT) Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DFFE658069; Thu, 10 Aug 2023 19:26:10 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.61.62.89]) by smtpav05.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 10 Aug 2023 19:26:10 +0000 (GMT) Message-ID: Subject: [PATCH] gdb.ada/mi_var_access.exp From: Carl Love To: Ulrich.Weigand@de.ibm.com, "gdb-patches@sourceware.org" , Tom Tromey Cc: cel@us.ibm.com Date: Thu, 10 Aug 2023 12:26:10 -0700 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: eQRzapSmsovQQpi-vnrAhQ1CDquV7Ae7 X-Proofpoint-ORIG-GUID: eQRzapSmsovQQpi-vnrAhQ1CDquV7Ae7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-10_15,2023-08-10_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 phishscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 impostorscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308100164 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H5,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 List-Id: GDB maintainers: The following patch fixes two failures on PowerPC. The test expects the value of NUMCHILD to always be 1 but on PowerPC it is 2. The other issue is i the var-update test where there are additional values printed that the test is not expecting. The additional fields are printed based on the value in VAROBJ_UPDATE_RESULT.TYPE_CHANGED. On PowerPC the value is true causing the additional fields to print. On X86-86 the field is false. The patch updates the test to accept a decimal for the value of NUMCHILD and adds an alternate result string for the var-update test if the additional fields are printed. The patch has been tested on Power10 with no regression failures. Please let me know if this patch is acceptable for mainline. Thnaks. Carl ------------------------------------------------ gdb.ada/mi_var_access.exp The NUMCHILD value for the "A_String_Access" test differs for X86 and PowerPC. The patch substitutes $decimal instead of "1" to match the value of NUMCHILD. The test "-var-update A_String_Access" generates different output depending on the value of VAROBJ_UPDATE_RESULT.TYPE_CHANGED. If the value is true, the strings "new_type" and "new_num_children" are printed along with their values. The VAROBJ_UPDATE_RESULT.TYPE_CHANGED value is true on PowerPC which produces the output: Expecting: ^(-var-update A_String_Access[ ]+)?(\^done,changelist=\[\{name="A_String_Access",in_scope="true",type_changed="false",has_more="0"\}\][ ]+[(]gdb[)] [ ]*) -var-update A_String_Access ^done,changelist=[{name="A_String_Access",in_scope="true",type_changed="true",new_type="pck.string_access",new_num_children="1",has_more="0"}] (gdb) FAIL: gdb.ada/mi_var_access.exp: update at stop 2 (unexpected output) The patch adds a second possible result string for the test $re_varobj_update_result_type to match the case when type_changed is true. Currently for the mi_var_access.exp test VAROBJ_UPDATE_RESULT.TYPE_CHANGED is true on PowerPC and false on X86-64. Fixes 2 failures on PowerPC. --- gdb/testsuite/gdb.ada/mi_var_access.exp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.ada/mi_var_access.exp b/gdb/testsuite/gdb.ada/mi_var_access.exp index e16dc184658..6abad65a6d4 100644 --- a/gdb/testsuite/gdb.ada/mi_var_access.exp +++ b/gdb/testsuite/gdb.ada/mi_var_access.exp @@ -38,7 +38,9 @@ mi_continue_to_line \ "stop at start of mi_access" # The bug was that creating a varobj for A_String_Access would crash. -set re_ok "\\^done,name=\"A_String_Access\",numchild=\"1\",.*" +# The value of NUMCHILD may vary on different systems. Use generic $decimal +# to match possible values. +set re_ok "\\^done,name=\"A_String_Access\",numchild=\"$decimal\",.*" set re_error "\\^error,msg=\"Value out of range\.\".*" mi_gdb_test "-var-create A_String_Access * A_String_Access" \ "($re_ok|$re_error)" \ @@ -49,8 +51,13 @@ mi_continue_to_line \ "mi_access.adb:$bp_location" \ "stop at stop 2" +# If the VAROBJ_UPDATE_RESULT.TYPE is true, the new_type and new_num_children +# strings and values will be printed. This currently happens on PowerPC but +# not X86-64. +set re_default [string_to_regexp {^done,changelist=[{name="A_String_Access",in_scope="true",type_changed="false",has_more="0"}]}] +set re_varobj_update_result_type [string_to_regexp {^done,changelist=[{name="A_String_Access",in_scope="true",type_changed="true",new_type="pck.string_access",new_num_children="1",has_more="0"}]}] mi_gdb_test "-var-update A_String_Access" \ - [string_to_regexp {^done,changelist=[{name="A_String_Access",in_scope="true",type_changed="false",has_more="0"}]}] \ + "($re_default|$re_varobj_update_result_type)" \ "update at stop 2" mi_gdb_test "-var-list-children A_String_Access" \ -- 2.37.2