From patchwork Tue Dec 17 14:56:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Edlinger X-Patchwork-Id: 36908 Received: (qmail 48865 invoked by alias); 17 Dec 2019 14:56:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 48857 invoked by uid 89); 17 Dec 2019 14:56:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=am, UD:a.m, a.m, gcc7 X-HELO: EUR05-AM6-obe.outbound.protection.outlook.com Received: from mail-am6eur05olkn2020.outbound.protection.outlook.com (HELO EUR05-AM6-obe.outbound.protection.outlook.com) (40.92.91.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Dec 2019 14:56:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TP3J0iQ13VuSP55IbF4X/BSI2rZpoaWiXGNpqKAo5N0EN4s53O6OTzazupX6zcoP/n03NAD88ri9e1k4adh8nNvr+IUguLPKiVHZhA5HnDHUQQ7vEJBH3WUMeD90ovzTnTBb28kyKOVcFPNiLCxR5wgg+SlbSxppmmwn3KbKvrTMXW/ccPcG1ZhXM02hr5axQ1RK1Ua1472OAIb5RVhgEESsjFf4UeOugr9825ylJyEOrPhYMjN16wxolSq8eXOoKyqwV0B+3/BLwK0G/XTPWerrvB9vQEUNlQ0aQiI/WaZvw2RwhFwduCP9QQ2rxmSNNP3HlUmiHsHbtFnPTnnX1g== 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=XYU3uUWGsa5nN13avr1JlPEgGZlntfhS5hgO9uXomHs=; b=Kttt3+0frZwWsL+MJ88tALkbF3ICxkBU7Sp8hDwSImibb+54G5mo4shi2+1kil961z5ywLenRF3Wgw2vz+OaWpSo9D3AHIHirevNO3V2GFygy3KJy6AU4zmLZz+OmwARu/GnKiIerErX/L12teNX4d3+iPyk/Xb4fHsxDrcxmrC1Xyj3EAwtpRp5soSh2ipPs8oYxtwyMtb9jlxBxckSkZatxRnjeIg3RD3oYlTw+gRBZJVU5422uP4IzzJejoib512Trd0/kJr6mejl3gy50qEkP4SLVPixQ64fOXBDqwxOzSU1ombw42mGFeO5wLWrfV+/ksW0ckwo2vnvEDwQsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from VI1EUR05FT062.eop-eur05.prod.protection.outlook.com (10.233.242.51) by VI1EUR05HT015.eop-eur05.prod.protection.outlook.com (10.233.243.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.14; Tue, 17 Dec 2019 14:56:24 +0000 Received: from AM0PR08MB3714.eurprd08.prod.outlook.com (10.233.242.53) by VI1EUR05FT062.mail.protection.outlook.com (10.233.243.189) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.14 via Frontend Transport; Tue, 17 Dec 2019 14:56:24 +0000 Received: from AM0PR08MB3714.eurprd08.prod.outlook.com ([fe80::8dd1:fb18:6271:f769]) by AM0PR08MB3714.eurprd08.prod.outlook.com ([fe80::8dd1:fb18:6271:f769%7]) with mapi id 15.20.2538.019; Tue, 17 Dec 2019 14:56:24 +0000 From: Bernd Edlinger To: Simon Marchi , "gdb-patches@sourceware.org" Subject: [PATCHv2] Fix skip.exp test failure observed with gcc-9.2.0 Date: Tue, 17 Dec 2019 14:56:24 +0000 Message-ID: References: <505a3a3a-37e8-bdae-cd4e-3ab691270d59@simark.ca> In-Reply-To: <505a3a3a-37e8-bdae-cd4e-3ab691270d59@simark.ca> x-microsoft-original-message-id: <4155c8e5-738b-676e-bddd-1355b8db4980@hotmail.de> x-ms-exchange-transport-forked: True MIME-Version: 1.0 On 12/17/19 3:44 AM, Simon Marchi wrote: > On 2019-12-15 1:12 p.m., Bernd Edlinger wrote: >> On 12/15/19 2:05 PM, Simon Marchi wrote: >>> On 2019-12-15 6:30 a.m., Bernd Edlinger wrote: >>>> Hi, >>>> >>>> this is the split out patch on skip.exp which fixes a pre-existing >>>> compatibilty issue with that test case and gcc-9.2.0 (and gcc-10 from >>>> trunk of a few weeks ago at least, likely other versions too). >>>> >>>> >>>> Is it OK for trunk? >>>> >>>> >>>> Thanks >>>> Bernd. >>>> >>>> >>> >>> Hi Bernd, >>> >>> Just wondering, were you able to figure out which change in debug info lead >>> to this behavior change? The behavior with gcc 9.2.0 seems better to be me, >>> I think your patch is ok. >>> >> >> Yes indeed. The change started with gcc-8.1.0 when -gcolumn-info was enabled >> by default. -gcolumn-info was first implemented in gcc-7.1.0 but default-disabled, >> so you can get the altered behavior already with gcc-7 if you manually enable >> -gcolumn-info. >> >> So previously there was just one point where line line 30 (of skip.c) started: >> >> [0x00000032] Advance Line by 27 to 28 >> [0x00000034] Copy >> [0x00000035] Special opcode 63: advance Address by 4 to 0x4004cb and Line by 2 to 30 >> [0x00000036] Advance PC by constant 17 to 0x4004dc >> [0x00000037] Special opcode 7: advance Address by 0 to 0x4004dc and Line by 2 to 32 >> >> with column-info we have line 30 three times with different column: >> >> [0x00000034] Advance Line by 27 to 28 >> [0x00000036] Copy >> [0x00000037] Set column to 9 >> [0x00000039] Special opcode 63: advance Address by 4 to 0x4004c6 and Line by 2 to 30 >> [0x0000003a] Set column to 17 >> [0x0000003c] Special opcode 75: advance Address by 5 to 0x4004cb and Line by 0 to 30 >> [0x0000003d] Set column to 3 >> [0x0000003f] Special opcode 75: advance Address by 5 to 0x4004d0 and Line by 0 to 30 >> [0x00000040] Special opcode 105: advance Address by 7 to 0x4004d7 and Line by 2 to 32 >> >> >> That could probably be filtered in dwarf2read.c to keep the old behavior, but I agree >> that the new behavior makes still sense, even if we cannot really use the column info >> in the line number info. > > That is actually some very good info for anyone wondering why this change was introduced! > > Could you please put it in the commit message for posterity? > Sure, good point. Attached is the new, reworded version of the patch. When I looked at it again, I stumbled over two wrong comments nearby, telling "# Return from foo()" when we actually return from bar(), and "# Return from bar()" when we actually return from foo()... :) >>> I would just remove the unrelated whitespace fix before merging. >>> >> >> Okay, I just replicated you advice regarding 8-space tab columns on >> skip-inline.exp in the other patch. Exactly those 2 lines were copied >> where the tabs were not used correctly. > > Great thanks. Note that we can also fix skip.exp, just in another, obvious patch. > Okay, will send a separate patch for the whitespace. Thanks Bernd. gdb/testsuite: 2019-12-15 Bernd Edlinger * gdb.base/skip.exp: Fix test failure observed with gcc-9.2.0. From 5884713ee87992c4011ae9b2d45fbe1bd29b9140 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Sun, 15 Dec 2019 11:05:47 +0100 Subject: [PATCH] Fix skip.exp test failure observed with gcc-9.2.0 We need to step a second time with this gcc version. The first step jumps back to main before entering foo. Previously the control flow was from bar directly to foo. Further ananlysis suggests, that this change in behavior started with gcc-8.1.0 when -gcolumn-info was enabled by default. The option -gcolumn-info was first implemented in gcc-7.1.0 but default-disabled, so you can get the altered behavior already with gcc-7 if you manually enable -gcolumn-info. Previously there was just one point where line 30 (of skip.c) started: [0x00000032] Advance Line by 27 to 28 [0x00000034] Copy [0x00000035] Special opcode 63: advance Address by 4 to 0x4004cb and Line by 2 to 30 [0x00000036] Advance PC by constant 17 to 0x4004dc [0x00000037] Special opcode 7: advance Address by 0 to 0x4004dc and Line by 2 to 32 But with -gcolumn-info enabled, we have line 30 three times with different column: [0x00000034] Advance Line by 27 to 28 [0x00000036] Copy [0x00000037] Set column to 9 [0x00000039] Special opcode 63: advance Address by 4 to 0x4004c6 and Line by 2 to 30 [0x0000003a] Set column to 17 [0x0000003c] Special opcode 75: advance Address by 5 to 0x4004cb and Line by 0 to 30 [0x0000003d] Set column to 3 [0x0000003f] Special opcode 75: advance Address by 5 to 0x4004d0 and Line by 0 to 30 [0x00000040] Special opcode 105: advance Address by 7 to 0x4004d7 and Line by 2 to 32 That could probably be filtered in dwarf2read.c to keep the old behavior, but the new behavior makes still sense, even if we cannot really make use of the column in the line number info for now. --- gdb/testsuite/gdb.base/skip.exp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.base/skip.exp b/gdb/testsuite/gdb.base/skip.exp index d763194..cf27d5b 100644 --- a/gdb/testsuite/gdb.base/skip.exp +++ b/gdb/testsuite/gdb.base/skip.exp @@ -141,9 +141,11 @@ with_test_prefix "step after disabling 3" { } gdb_test "step" "bar \\(\\) at.*" "step 1" - gdb_test "step" ".*" "step 2"; # Return from foo() - gdb_test "step" "foo \\(\\) at.*" "step 3" - gdb_test "step" ".*" "step 4"; # Return from bar() + gdb_test "step" ".*" "step 2"; # Return from bar() + # With gcc 9.2.0 we jump once back to main before entering foo here. + # If that happens try to step a second time. + gdb_test "step" "foo \\(\\) at.*" "step 3" "main \\(\\) at .*" "step" + gdb_test "step" ".*" "step 4"; # Return from foo() gdb_test "step" "main \\(\\) at.*" "step 5" } @@ -261,7 +263,9 @@ with_test_prefix "step using -fu for baz" { gdb_test_no_output "skip enable 7" gdb_test "step" "bar \\(\\) at.*" "step 1" gdb_test "step" ".*" "step 2"; # Return from bar() - gdb_test "step" "foo \\(\\) at.*" "step 3" + # With gcc 9.2.0 we jump once back to main before entering foo here. + # If that happens try to step a second time. + gdb_test "step" "foo \\(\\) at.*" "step 3" "main \\(\\) at.*" "step" gdb_test "step" ".*" "step 4"; # Return from foo() gdb_test "step" "main \\(\\) at.*" "step 5" } @@ -276,7 +280,9 @@ with_test_prefix "step using -rfu for baz" { gdb_test_no_output "skip enable 8" gdb_test "step" "bar \\(\\) at.*" "step 1" gdb_test "step" ".*" "step 2"; # Return from bar() - gdb_test "step" "foo \\(\\) at.*" "step 3" + # With gcc 9.2.0 we jump once back to main before entering foo here. + # If that happens try to step a second time. + gdb_test "step" "foo \\(\\) at.*" "step 3" "main \\(\\) at.*" "step" gdb_test "step" ".*" "step 4"; # Return from foo() gdb_test "step" "main \\(\\) at.*" "step 5" } -- 1.9.1