From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-oln040092074108.outbound.protection.outlook.com [40.92.74.108]) by sourceware.org (Postfix) with ESMTPS id 985E5385BF83 for ; Sun, 12 Apr 2020 17:13:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 985E5385BF83 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=hotmail.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bernd.edlinger@hotmail.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TSpJsBaoe/0tFQJQlNLLa08u58e+M5dowphaL0LwafqAvgTSMZNersMHzTC9f5dFWyPvV9rCRnw1Zd0ewElKfI03qVc2vbIdjjDKoBUAPsB0f6MelPyOubGRVL8TSTeJ4nfqNyMSf28D44I22pdNiFbS6P4BJ3jZ9nzcWalzMpaqg4oULQv8EU8BdbdCfIhtuSENr6BxWbvTDdBYr0L1RNI4hLLuZTWM5ZXiEicjAHg075+lLQ8PJSSC/7Osj3J3Cv9ClCIFpDlsGYrG9O6oGKhyv/SPWpsaLoCBZWWQIFtwFoOTvC8sigW1ohzZ4LXUP3yjBc88/jaXyKIdxFa66g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H+i5tv2YA7EYRI8MrBk9v2BuRXBiZEUi3PTR7eSI1pA=; b=eQws/mBlbYtI2ZuRBf4JCaoR9zGH8kHsGzZfkScMD2DNe1EsqJDfL9Xw0/rI5g1zuj0nLrtEXnYB3s6isWlqfifWhvXldVhSaW3NthrfzeEzErHFzROTRsv/SC8SzvGtDuYO+iYtbP+tDNjsi8iVNPeBduTStamITABoKBQDlKW18RuFsrbRQAckrdDWsy/3NMj18afkIq9fKoSa4KfBgph1PtWXd0RIbjmwgGOn//YRw6/POoSDGLquR+C+W8Ckq5wByBs/7TaSmNc1JBMyl1lSziF9PeHNEyHHhbjTmhp3mP1Mh0j46n20sbkNAxtKKoZOOoZZd41SRF1TM9WFsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hotmail.de; dmarc=pass action=none header.from=hotmail.de; dkim=pass header.d=hotmail.de; arc=none Received: from VI1EUR04FT028.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::4d) by VI1EUR04HT018.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::428) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.18; Sun, 12 Apr 2020 17:13:15 +0000 Received: from AM6PR03MB5170.eurprd03.prod.outlook.com (2a01:111:e400:7e0e::40) by VI1EUR04FT028.mail.protection.outlook.com (2a01:111:e400:7e0e::316) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15 via Frontend Transport; Sun, 12 Apr 2020 17:13:15 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:1EFB846ECD1DCFACC57BC084675A5EBEDE56F2AD983B021A1F9077DD14D694A8; UpperCasedChecksum:DCD5828F8CFEF8C36EFF46AB800A41593D64D91D3A21E4B767923F25A2828777; SizeAsReceived:8257; Count:50 Received: from AM6PR03MB5170.eurprd03.prod.outlook.com ([fe80::d57:5853:a396:969d]) by AM6PR03MB5170.eurprd03.prod.outlook.com ([fe80::d57:5853:a396:969d%7]) with mapi id 15.20.2900.028; Sun, 12 Apr 2020 17:13:14 +0000 Subject: Re: [PATCH 2/2] gdb: Preserve is-stmt lines when switch between files From: Bernd Edlinger To: Andrew Burgess , gdb-patches@sourceware.org Cc: Tom Tromey References: <6e9b21a0002164cec014dfe4d94d816a376989b4.1585952198.git.andrew.burgess@embecosm.com> Message-ID: Date: Sun, 12 Apr 2020 19:13:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AM0PR04CA0026.eurprd04.prod.outlook.com (2603:10a6:208:122::39) To AM6PR03MB5170.eurprd03.prod.outlook.com (2603:10a6:20b:ca::23) X-Microsoft-Original-Message-ID: <6ab2557f-3350-cfae-e68b-e78bdda9cf10@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (92.77.140.102) by AM0PR04CA0026.eurprd04.prod.outlook.com (2603:10a6:208:122::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.17 via Frontend Transport; Sun, 12 Apr 2020 17:13:13 +0000 X-Microsoft-Original-Message-ID: <6ab2557f-3350-cfae-e68b-e78bdda9cf10@hotmail.de> X-TMN: [ihefaeD5C3zQSzWhTHt8xfbgdNz9cPgo] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: d192da72-918f-4825-5a0c-08d7df04c909 X-MS-TrafficTypeDiagnostic: VI1EUR04HT018: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tG0dX75foeR+0qR0RaT5SF//S3YZ9zcdjAPy9bgQeo3tR0HJhajFx3l1KOpM8dPAmxXhKejKUOxGdhR+LFEgs1lagDTo4I7GaMkjvYGeBhL+OpVzS4S/fWk9PRenkZcqXMHjcuOyMBkpbBqqDDB5AaODgL91G9aF8hY2nheg8LX4vtJaCVMts5WlqROOUOljJWWvrgNgCatNX0ogsqrEbPPleXSRTIjKwlR+kAjdyOY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:0; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR03MB5170.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:; DIR:OUT; SFP:1901; X-MS-Exchange-AntiSpam-MessageData: MWtu/nDuQR0sjtLJlUxQHyqh3aW/AUa3Dq5k2/gDco809fXPqcKsUWqwqLUfNkFdykUWBCujjQYCA0N4X4lAh/XROGPTA1v7RtzawR3yIIn/h9vA4C+3Vr5Op0y8RJKmkrAA9cUEzvB2T/RlbKHHTg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d192da72-918f-4825-5a0c-08d7df04c909 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2020 17:13:14.7787 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR04HT018 X-Spam-Status: No, score=-17.2 required=5.0 tests=BAYES_00, FORGED_MUA_MOZILLA, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, KAM_SHORT, MSGID_FROM_MTA_HEADER, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Sun, 12 Apr 2020 17:13:19 -0000 On 4/11/20 5:52 AM, Bernd Edlinger wrote: > Andrew, > > Just, a minor nit: > > /home/ed/gnu/binutils-gdb/.git/rebase-apply/patch:665: new blank line at EOF. Hmm, I hope you did not think that is me beginning to be insane, that was just the incomprehensible output of "git am" on your patch part 2/2, funny isn't it? I think that means: diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp index c683dc4..161a1fc 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp @@ -188,5 +188,3 @@ for { set i 0 } { $i < 100 && $keep_going } { incr i } { gdb_assert { $found_line_19 && $found_line_20 } \ "found line 19 and 20" - - -- Another bit I had to fix in order to make it compile diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index a146ed1..36e8b24 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -19786,7 +19786,7 @@ class lnp_state_machine m_discriminator = 0; m_last_address = m_address; - m_stmt_at_addr = false; + m_stmt_at_address = false; } void Which makes me wonder if you compiled that at all, what you sent to me. Or if that was actually a different version than intended, so please double-check that. If that is the case, please re-submit your test case patches as extra patch files, and the code change also extra, since I intend to use your test cases in my patch, and not having to dissect the patches would be great. And in order to compare the test results better, I restored the step-and-next-inline.exp test: diff --git a/gdb/testsuite/gdb.cp/step-and-next-inline.exp b/gdb/testsuite/gdb.cp/step-and-next-inline.exp index a95e211..e3a5793 100644 --- a/gdb/testsuite/gdb.cp/step-and-next-inline.exp +++ b/gdb/testsuite/gdb.cp/step-and-next-inline.exp @@ -24,13 +24,6 @@ if { ![supports_statement_frontiers] } { proc do_test { use_header } { global srcfile testfile - if { $use_header } { - # This test will not pass due to poor debug information - # generated by GCC (at least upto 10.x). See - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94474 - return - } - set options {c++ debug nowarnings optimize=-O2\ -gstatement-frontiers} if { $use_header } { lappend options additional_flags=-DUSE_NEXT_INLINE_H @@ -59,37 +52,20 @@ proc do_test { use_header } { gdb_test "step" ".*" "step into get_alias_set" gdb_test "bt" "\\s*\\#0\\s+get_alias_set\[^\r\]*${srcfile}:.*" \ "not in inline 1" - # It's possible that this first failure (when not using a header - # file) is GCC's fault, though the remaining failures would best - # be fixed by adding location views support (though it could be - # that some easier heuristic could be figured out). Still, it is - # not certain that the first failure wouldn't also be fixed by - # having location view support, so for now it is tagged as such. - if {!$use_header} { setup_kfail "*-*-*" symtab/25507 } gdb_test "next" ".*TREE_TYPE.*" "next step 1" gdb_test "bt" "\\s*\\#0\\s+get_alias_set\[^\r\]*${srcfile}:.*" \ "not in inline 2" gdb_test "next" ".*TREE_TYPE.*" "next step 2" gdb_test "bt" "\\s*\\#0\\s+get_alias_set\[^\r\]*${srcfile}:.*" \ "not in inline 3" - if {!$use_header} { setup_kfail "*-*-*" symtab/25507 } gdb_test "next" ".*TREE_TYPE.*" "next step 3" gdb_test "bt" "\\s*\\#0\\s+get_alias_set\[^\r\]*${srcfile}:.*" \ "not in inline 4" - if {!$use_header} { setup_kfail "*-*-*" symtab/25507 } gdb_test "next" "return 0.*" "next step 4" gdb_test "bt" \ "\\s*\\#0\\s+(main|get_alias_set)\[^\r\]*${srcfile}:.*" \ "not in inline 5" - if {!$use_header} { - # With the debug from GCC 10.x (and earlier) GDB is currently - # unable to successfully complete the following tests when we - # are not using a header file. - kfail symtab/25507 "stepping tests" - return - } - clean_restart ${executable} if ![runto_main] { > > I am trying to find out which patch is better. > So I applied your patch, an try to see where the differences are. > > > Please be patient.. > Hmm, okay, I compared the two patches now. First please don't take that personally :-) but I think mine is a tiny bit better, because it fixes the step-and-next-inline test case entirely. And fixes your test case also almost completely: /gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/step-and-next-inline.exp ... PASS: gdb.cp/step-and-next-inline.exp: no_header: in get_alias_set pass 2 -PASS: gdb.cp/step-and-next-inline.exp: no_header: in inline 1 pass 2 -PASS: gdb.cp/step-and-next-inline.exp: no_header: in inline 2 pass 2 +FAIL: gdb.cp/step-and-next-inline.exp: no_header: in inline 1 pass 2 +FAIL: gdb.cp/step-and-next-inline.exp: no_header: in inline 2 pass 2 PASS: gdb.cp/step-and-next-inline.exp: no_header: in inline 3 pass 2 PASS: gdb.cp/step-and-next-inline.exp: no_header: in main PASS: gdb.cp/step-and-next-inline.exp: no_header: in main pass 2 -PASS: gdb.cp/step-and-next-inline.exp: no_header: next step 1 +FAIL: gdb.cp/step-and-next-inline.exp: no_header: next step 1 PASS: gdb.cp/step-and-next-inline.exp: no_header: next step 2 -PASS: gdb.cp/step-and-next-inline.exp: no_header: next step 3 -PASS: gdb.cp/step-and-next-inline.exp: no_header: next step 4 +FAIL: gdb.cp/step-and-next-inline.exp: no_header: next step 3 +FAIL: gdb.cp/step-and-next-inline.exp: no_header: next step 4 PASS: gdb.cp/step-and-next-inline.exp: no_header: not in inline 1 PASS: gdb.cp/step-and-next-inline.exp: no_header: not in inline 1 pass 2 PASS: gdb.cp/step-and-next-inline.exp: no_header: not in inline 2 -PASS: gdb.cp/step-and-next-inline.exp: no_header: not in inline 2 pass 2 +FAIL: gdb.cp/step-and-next-inline.exp: no_header: not in inline 2 pass 2 PASS: gdb.cp/step-and-next-inline.exp: no_header: not in inline 3 PASS: gdb.cp/step-and-next-inline.exp: no_header: not in inline 3 pass 2 PASS: gdb.cp/step-and-next-inline.exp: no_header: not in inline 4 PASS: gdb.cp/step-and-next-inline.exp: no_header: not in inline 4 pass 2 PASS: gdb.cp/step-and-next-inline.exp: no_header: not in inline 5 -PASS: gdb.cp/step-and-next-inline.exp: no_header: step 1 -PASS: gdb.cp/step-and-next-inline.exp: no_header: step 2 -PASS: gdb.cp/step-and-next-inline.exp: no_header: step 3 -PASS: gdb.cp/step-and-next-inline.exp: no_header: step 4 +FAIL: gdb.cp/step-and-next-inline.exp: no_header: step 1 +FAIL: gdb.cp/step-and-next-inline.exp: no_header: step 2 +FAIL: gdb.cp/step-and-next-inline.exp: no_header: step 3 +FAIL: gdb.cp/step-and-next-inline.exp: no_header: step 4 PASS: gdb.cp/step-and-next-inline.exp: no_header: step 5 PASS: gdb.cp/step-and-next-inline.exp: no_header: step 6 -PASS: gdb.cp/step-and-next-inline.exp: no_header: step 7 +FAIL: gdb.cp/step-and-next-inline.exp: no_header: step 7 PASS: gdb.cp/step-and-next-inline.exp: no_header: step into get_alias_set PASS: gdb.cp/step-and-next-inline.exp: no_header: step into get_alias_set pass 2 PASS: gdb.cp/step-and-next-inline.exp: use_header: in get_alias_set pass 2 -PASS: gdb.cp/step-and-next-inline.exp: use_header: in inline 1 pass 2 -PASS: gdb.cp/step-and-next-inline.exp: use_header: in inline 2 pass 2 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: in inline 1 pass 2 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: in inline 2 pass 2 PASS: gdb.cp/step-and-next-inline.exp: use_header: in inline 3 pass 2 PASS: gdb.cp/step-and-next-inline.exp: use_header: in main PASS: gdb.cp/step-and-next-inline.exp: use_header: in main pass 2 -PASS: gdb.cp/step-and-next-inline.exp: use_header: next step 1 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: next step 1 PASS: gdb.cp/step-and-next-inline.exp: use_header: next step 2 -PASS: gdb.cp/step-and-next-inline.exp: use_header: next step 3 -PASS: gdb.cp/step-and-next-inline.exp: use_header: next step 4 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: next step 3 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: next step 4 PASS: gdb.cp/step-and-next-inline.exp: use_header: not in inline 1 -PASS: gdb.cp/step-and-next-inline.exp: use_header: not in inline 1 pass 2 -PASS: gdb.cp/step-and-next-inline.exp: use_header: not in inline 2 -PASS: gdb.cp/step-and-next-inline.exp: use_header: not in inline 2 pass 2 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: not in inline 1 pass 2 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: not in inline 2 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: not in inline 2 pass 2 PASS: gdb.cp/step-and-next-inline.exp: use_header: not in inline 3 PASS: gdb.cp/step-and-next-inline.exp: use_header: not in inline 3 pass 2 -PASS: gdb.cp/step-and-next-inline.exp: use_header: not in inline 4 -PASS: gdb.cp/step-and-next-inline.exp: use_header: not in inline 4 pass 2 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: not in inline 4 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: not in inline 4 pass 2 PASS: gdb.cp/step-and-next-inline.exp: use_header: not in inline 5 -PASS: gdb.cp/step-and-next-inline.exp: use_header: step 1 -PASS: gdb.cp/step-and-next-inline.exp: use_header: step 2 -PASS: gdb.cp/step-and-next-inline.exp: use_header: step 3 -PASS: gdb.cp/step-and-next-inline.exp: use_header: step 4 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: step 1 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: step 2 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: step 3 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: step 4 PASS: gdb.cp/step-and-next-inline.exp: use_header: step 5 PASS: gdb.cp/step-and-next-inline.exp: use_header: step 6 -PASS: gdb.cp/step-and-next-inline.exp: use_header: step 7 +FAIL: gdb.cp/step-and-next-inline.exp: use_header: step 7 PASS: gdb.cp/step-and-next-inline.exp: use_header: step into get_alias_set PASS: gdb.cp/step-and-next-inline.exp: use_header: step into get_alias_set pass 2 /gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.cp/subtypes.exp ... @@ -52391,7 +52381,7 @@ PASS: gdb.dwarf2/dw2-inline-header-2.exp: check for breakpoint at dw2-inline-header.c PASS: gdb.dwarf2/dw2-inline-header-2.exp: check for breakpoint at dw2-inline-header.h /gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.dwarf2/dw2-inline-header-3.exp ... -FAIL: gdb.dwarf2/dw2-inline-header-3.exp: continue to breakpoint: dw2-inline-header.h:22 +PASS: gdb.dwarf2/dw2-inline-header-3.exp: continue to breakpoint: dw2-inline-header.h:22 PASS: gdb.dwarf2/dw2-inline-header-3.exp: found line 19 and 20 PASS: gdb.dwarf2/dw2-inline-header-3.exp: info breakpoints So if it would be a socker game that would be 26:1 :-/ Regarding the one test where my patch is still able to be improved, gdb.dwarf2/dw2-inline-header-3.exp: continue to breakpoint: dw2-inline-header.h:22 I think the issue there is that dw2-inline-header.h:22 and dw2-inline-header.c:18 is at the same adress. To me it appears a bit arbitrary, which of the two lines the stack trace shows, but on the other hand, if there is a breakpoint on dw2-inline-header.h:22 that is a clear indication that the user want to see dw2-inline-header.h:22 while if there is a breakpoint on dw2-inline-header.c:18 the user would certainly want to see dw2-inline-header.c:18 even if both are only different views of the same address. Yes. I wonder if we can choose the SAL entry which is presented, in a was that prefers SAL where there is a breakpoint. That can't be impossible given all we alread achieved in this cursade ;-) for better debug experience, don't you agree? Looking at the debug info in the test case, I see a wrong subroutine range here: <2><52>: Abbrev Number: 5 (DW_TAG_inlined_subroutine) <53> DW_AT_abstract_origin: <0x31> <57> DW_AT_low_pc : 0x401122 <5f> DW_AT_high_pc : 0x40115e <67> DW_AT_call_file : 1 <68> DW_AT_call_line : 18 See the line table the subroutine is from 0x401136 to 0x401140: [0x000000ba] Set File Name to entry 2 in the File Name Table [0x000000bc] Extended opcode 2: set Address to 0x401136 [0x000000c7] Advance Line by 4 to 21 [0x000000c9] Copy [0x000000ca] Extended opcode 2: set Address to 0x401140 [0x000000d5] Advance Line by 1 to 22 [0x000000d7] Copy [0x000000d8] Advance Line by -4 to 18 [0x000000da] Set File Name to entry 1 in the File Name Table with that wrong subroutine table I think my patch cas not a chance to give correct results. Could you please fix the subroutine table, and then we see what I have to fix on my patch in order to make it pass? Also please check the subroutine entries on the other dw2-inline-header tests, if the subroutine range info have similar problems, I need correct ranges, otherwise my patch is unable to produce correct output. Thanks Bernd.