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 DB8CF385840D for ; Wed, 24 Apr 2024 18:07:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DB8CF385840D 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 DB8CF385840D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713982056; cv=none; b=l5AB1iW93GGslhriOSDgUKYueqtXrN4A6R7xb1ni/ufYH/6g46ee41X6TYRZJqf/KFgTwc0Uvo/+wmZhysYNFlLolb0XKxQgZH6Ixrfxgq4gVZYh4gSBcZDRQqfBWUnMrtvZd4XQHQqN+2qOMqgtThg0xIv9PCKxEeZgqe7GmeA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713982056; c=relaxed/simple; bh=eotxpvFwbDEJ+1e9MiPRX6EsarEBK4jwPEYX530vLGY=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=OFlUfiFOVNIHxuECs8Hw2/9EoS7A2IwIq0JwF9UhLvyi7HPDPphsFgTQbWHAkiNlNKltOrowi4MMjf5tuIcLmIOscGekCBVd3q6V734WOwOL8keH6Tt0clAttldVDK5Vi25mpKH8pstX7lg7ZRPSH+pDese0aFHo/3G53aWRxj4= ARC-Authentication-Results: i=1; server2.sourceware.org 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 43OHlVsh010501; Wed, 24 Apr 2024 18:07:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=phl+4CIeFEBPORmxk6/Qk4MRFI/ni4/KhQnkFbva5Mg=; b=s3si0GqXrhTgy0FXWjvaPsPbPrxV9u/9s6z0Ng5sVlB7sCHrkeWignOvJkutbxrb5/UU bdz6d6qnccZVYiTAUuZ1LEDXIZLhieB8xnwhV4G1Vod18WAp+PLszBnBC6fMTY9GeBrq z+gquwrovMGmf+M4Qg4U8cH7hM9w7EuonVJKDSxIzztOkoDLi3ijakrgQD6szmZn3tc9 nuVSm2Ejb4X/jPIzxyFNDwRgaU0BV0taxBzS7DWCx2Zju5sKNpV1HvgX9qexkwLiNUky /kgt3eEbmLyLeqpWWkRbaidBMqHFHNpAmiy+uHtFD1o1PaTv0yG5d4hY2GYo0APpmexR ZA== 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 3xq6sng1na-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Apr 2024 18:07:24 +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 43OFdtAO015354; Wed, 24 Apr 2024 18:07:23 GMT Received: from smtprelay04.wdc07v.mail.ibm.com ([172.16.1.71]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3xmshmd120-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Apr 2024 18:07:23 +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 43OI7KbA37552792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Apr 2024 18:07:22 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 43F1858056; Wed, 24 Apr 2024 18:07:20 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 905AE58052; Wed, 24 Apr 2024 18:07:19 +0000 (GMT) Received: from [9.67.133.93] (unknown [9.67.133.93]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 24 Apr 2024 18:07:19 +0000 (GMT) Message-ID: Date: Wed, 24 Apr 2024 11:07:18 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/4] [gdb/testsuite] Fix end_sequence addresses Content-Language: en-US To: gdb-patches@sourceware.org, Tom de Vries , Carl Love References: <20240408120445.12544-1-tdevries@suse.de> <20240408120445.12544-3-tdevries@suse.de> <7d515dd6-f327-4587-89c6-ed7e93b7efdd@linux.ibm.com> From: Carl Love In-Reply-To: <7d515dd6-f327-4587-89c6-ed7e93b7efdd@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: MLqCMsrChdVjgSP4FO0cJKPCJnOcFegT X-Proofpoint-GUID: MLqCMsrChdVjgSP4FO0cJKPCJnOcFegT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-24_15,2024-04-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 adultscore=0 clxscore=1015 phishscore=0 mlxlogscore=999 priorityscore=1501 malwarescore=0 bulkscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404240082 X-Spam-Status: No, score=-9.8 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 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: Tom: I think I see the issue. bar_label_5 is a label in function bar. But "$main_start + $main_len" this will give us an address in main, not bar. So, we need to set the address relative to the beginning of function bar? Carl On 4/24/24 10:45, Carl Love wrote: > Tom: > > I am seeing a regression on Power 10 with this patch. Specifically the change to file dw2-lines.exp. > > --- a/gdb/testsuite/gdb.dwarf2/dw2-lines.exp > +++ b/gdb/testsuite/gdb.dwarf2/dw2-lines.exp > @@ -104,7 +104,7 @@ proc test_1 { _cv _cdw64 _lv _ldw64 {_string_form ""}} { > line [line_for bar_label_4] > DW_LNS_copy > > - DW_LNE_set_address bar_label_5 > + DW_LNE_set_address "$main_start + $main_len" > DW_LNE_end_sequence > } > } > > The change results in the test failing on PowerPC. > > Running /home/carll/GDB/build-current/gdb/testsuite/../../../binutils-gdb-current/gdb/testsuite/gdb.dwarf2/dw2-lines.exp ... > FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=32: lv=2: ldw=32: continue to breakpoint: foo \(1\) (the program exited) > FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=32: lv=2: ldw=32: next to foo (2) (the program is no longer running) > FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=32: lv=2: ldw=32: next to foo (3) (the program is no longer running) > FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=32: lv=2: ldw=32: next to foo (4) (the program is no longer running) > FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=32: lv=2: ldw=64: continue to breakpoint: foo \(1\) (the program exited) > FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=32: lv=2: ldw=64: next to foo (2) (the program is no longer running) > FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=32: lv=2: ldw=64: next to foo (3) (the program is no longer running) > FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=32: lv=2: ldw=64: next to foo (4) (the program is no longer running) > FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=64: lv=2: ldw=32: continue to breakpoint: foo \(1\) (the program exited) > FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=64: lv=2: ldw=32: next to foo (2) (the program is no longer running) > FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=64: lv=2: ldw=32: next to foo (3) (the program is no longer running) > FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=64: lv=2: ldw=32: next to foo (4) (the program is no longer running) > etc. > > If I edit the file and change the line back to bar_label_5 the test passes. I am only seeing an issue with the change to in this file. I specifically tested dw2-inline-header-2.exp and the change seems to work just fine there. I am really puzzled as to why it doesn't work in file dw2-lines.exp. > > I put the print statement in: > > puts "CARLL, main_start = $main_start, main_len = $main_len" > DW_LNE_set_address "$main_start + $main_len" > > I get > > CARLL, main_start = main_label - 28, main_len = 76 > > I tried printing main_label but it doesn't seem to be defined. > > ERROR: in testcase /../binutils-gdb-current/gdb/testsuite/gdb.dwarf2/dw2-lines.exp > ERROR: can't read "main_label": no such variable > ERROR: tcl error code TCL LOOKUP VARNAME main_label > ERROR: tcl error info: > can't read "main_label": no such variable > > I was hoping to be able to verify that bar_label_5 and "$main_start + $main_len" are the same but no luck. > Anyway, any thoughts as to why this is failing on PowerPC? I assume it works fine on X86. > > At the moment, I am a little puzzled as to what the right fix is. > > Carl > > On 4/8/24 05:04, Tom de Vries wrote: >> I noticed in test-case gdb.reverse/map-to-same-line.exp, that the end of main: >> ... >> 00000000004102c4 : >> 4102c4: 52800000 mov w0, #0x0 // #0 >> 4102c8: 9100c3ff add sp, sp, #0x30 >> 4102cc: d65f03c0 ret >> ... >> is not described by the line table: >> ... >> File name Line number Starting address View Stmt >> ... >> map-to-same-line.c 54 0x4102ac x >> map-to-same-line.c - 0x4102c4 >> ... >> >> Fix this by ending the line table at $main_end. >> >> Likewise in a few other test-cases, found using: >> ... >> $ find gdb/testsuite/ -type f \ >> | xargs grep -B1 DW_LNE_end_sequence \ >> | grep set_address \ >> | egrep -v "_end|_len" >> ... >> >> Tested on aarch64-linux. >> --- >> gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp | 2 +- >> gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp | 2 +- >> gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp | 2 +- >> gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp | 2 +- >> gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp | 7 +++++-- >> gdb/testsuite/gdb.dwarf2/dw2-lines.exp | 2 +- >> gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp | 4 +++- >> gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl | 2 +- >> gdb/testsuite/gdb.reverse/map-to-same-line.c | 1 - >> gdb/testsuite/gdb.reverse/map-to-same-line.exp | 3 ++- >> 10 files changed, 16 insertions(+), 11 deletions(-) >> >> diff --git a/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp b/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp >> index 1880f4cb7fb..5d6e13a9ae0 100644 >> --- a/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp >> +++ b/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp >> @@ -70,7 +70,7 @@ Dwarf::assemble $asm_file { >> line [line_for bar_label] >> DW_LNS_copy >> >> - DW_LNE_set_address bar_label_2 >> + DW_LNE_set_address $bar_end >> DW_LNE_end_sequence >> } >> } >> diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp >> index 6d12e968f41..1f30c5c3316 100644 >> --- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp >> +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-1.exp >> @@ -146,7 +146,7 @@ proc do_test { start_label func_name tag } { >> DW_LNS_advance_line 1 >> DW_LNS_copy >> >> - DW_LNE_set_address line_label_7 >> + DW_LNE_set_address "$main_start + $main_len" >> DW_LNE_end_sequence >> } >> } >> diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp >> index 6a5f7d6dd76..68f1fc83859 100644 >> --- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp >> +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-2.exp >> @@ -134,7 +134,7 @@ Dwarf::assemble $asm_file { >> DW_LNS_advance_line 1 >> DW_LNS_copy >> >> - DW_LNE_set_address line_label_7 >> + DW_LNE_set_address "$main_start + $main_len" >> DW_LNE_end_sequence >> } >> } >> diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp >> index b3db154db25..1b8d136e70e 100644 >> --- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp >> +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp >> @@ -123,7 +123,7 @@ Dwarf::assemble $asm_file { >> DW_LNS_negate_stmt >> DW_LNS_copy >> >> - DW_LNE_set_address line_label_7 >> + DW_LNE_set_address "$main_start + $main_len" >> DW_LNE_end_sequence >> } >> } >> diff --git a/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp b/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp >> index 603a616930a..c510de42037 100644 >> --- a/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp >> +++ b/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp >> @@ -27,6 +27,9 @@ Dwarf::assemble $asm_file { >> declare_labels Llines >> global srcdir subdir srcfile >> >> + get_func_info bar1 >> + get_func_info bar2 >> + >> cu {} { >> compile_unit { >> {language @DW_LANG_C} >> @@ -69,7 +72,7 @@ Dwarf::assemble $asm_file { >> line 33 >> DW_LNS_copy >> >> - DW_LNE_set_address bar1_label_5 >> + DW_LNE_set_address $bar1_end >> DW_LNE_end_sequence >> >> >> @@ -91,7 +94,7 @@ Dwarf::assemble $asm_file { >> line 47 >> DW_LNS_copy >> >> - DW_LNE_set_address bar2_label_5 >> + DW_LNE_set_address $bar2_end >> DW_LNE_end_sequence >> } >> } >> diff --git a/gdb/testsuite/gdb.dwarf2/dw2-lines.exp b/gdb/testsuite/gdb.dwarf2/dw2-lines.exp >> index 5fd6ae04d38..85d5e9c8afb 100644 >> --- a/gdb/testsuite/gdb.dwarf2/dw2-lines.exp >> +++ b/gdb/testsuite/gdb.dwarf2/dw2-lines.exp >> @@ -104,7 +104,7 @@ proc test_1 { _cv _cdw64 _lv _ldw64 {_string_form ""}} { >> line [line_for bar_label_4] >> DW_LNS_copy >> >> - DW_LNE_set_address bar_label_5 >> + DW_LNE_set_address "$main_start + $main_len" >> DW_LNE_end_sequence >> } >> } >> diff --git a/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp b/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp >> index 671e3e634ac..5a0705fc613 100644 >> --- a/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp >> +++ b/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp >> @@ -30,6 +30,8 @@ Dwarf::assemble $asm_file { >> set DW_LNE_lo_usr 0x80 >> set DW_LNE_hi_usr 0xff >> >> + get_func_info main >> + >> cu {} { >> compile_unit { >> {language @DW_LANG_C} >> @@ -54,7 +56,7 @@ Dwarf::assemble $asm_file { >> DW_LNE_user 2 $DW_LNE_hi_usr >> DW_LNS_copy >> >> - DW_LNE_set_address main_label_2 >> + DW_LNE_set_address $main_end >> DW_LNE_end_sequence >> } >> } >> diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl b/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl >> index 968378620a0..5817b2b0f53 100644 >> --- a/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl >> +++ b/gdb/testsuite/gdb.dwarf2/imported-unit-bp.exp.tcl >> @@ -110,7 +110,7 @@ Dwarf::assemble $asm_file { >> DW_LNS_negate_stmt >> DW_LNS_copy >> >> - DW_LNE_set_address line_label_7 >> + DW_LNE_set_address "$func_start + $func_len" >> DW_LNE_end_sequence >> } >> } >> diff --git a/gdb/testsuite/gdb.reverse/map-to-same-line.c b/gdb/testsuite/gdb.reverse/map-to-same-line.c >> index 45e7ffb0f06..7185955f40a 100644 >> --- a/gdb/testsuite/gdb.reverse/map-to-same-line.c >> +++ b/gdb/testsuite/gdb.reverse/map-to-same-line.c >> @@ -53,6 +53,5 @@ main (void) >> asm ("main_return: .globl main_return"); >> k = j; f3 = f2; str_3 = str_2; /* TAG: main return */ >> >> - asm ("end_of_sequence: .globl end_of_sequence"); >> return 0; /* TAG: main return */ >> } >> diff --git a/gdb/testsuite/gdb.reverse/map-to-same-line.exp b/gdb/testsuite/gdb.reverse/map-to-same-line.exp >> index b556e7cb676..067fe012702 100644 >> --- a/gdb/testsuite/gdb.reverse/map-to-same-line.exp >> +++ b/gdb/testsuite/gdb.reverse/map-to-same-line.exp >> @@ -100,7 +100,8 @@ Dwarf::assemble $asm_file { >> DW_LNE_set_address main_return >> line [gdb_get_line_number "TAG: main return"] >> DW_LNS_copy >> - DW_LNE_set_address end_of_sequence >> + >> + DW_LNE_set_address $main_end >> DW_LNE_end_sequence >> } >> }