From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70070.outbound.protection.outlook.com [40.107.7.70]) by sourceware.org (Postfix) with ESMTPS id 578153858C52 for ; Fri, 23 Sep 2022 10:48:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 578153858C52 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=B8AJkY8er4woGsK+mVTdh/mle4VMhZFIAO6DBhXMp8oqovwXxWtkKOkRj566YIpVhECcetaaja5cxtf/U8rOoLBJXEs6kLvcLQo8+9EXvcCkzyhIwDmmOU4L4kEeePzT8O7jpH3nTOWgK/ShlTjbuaVreFRze5++BEpPSRWOjccwRoaZ/glA1xEIonhudvi2wlBA2sOEeGBa56vo0M1CvekiKdY2AgnNSw6AOsIZrNxVNm1YO3UKhKmU7vEQVaYehCLFShChrDsa/ktJ7+3NTMRsKaNhildP7T4O9wb80qfUxlk5wjKlGlsUMqRLSDPPrvDwTV6RjxchjYxlK3h+yA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Tk6qH6BNyk+K/ecgEwrDtSNbwVNmzQujtjxYmDlWMPU=; b=NUXmg5qdh1Pl3RZEA8nMte4bo6i256zEB1wpZoO6ju0gOsdPPSBI3sqpTH7/iX3bjBUA78p7Lx+BKkCJ+kGY+HVO1A1cOMq3aq7mkUWZDT6q0f71mouO5kVfXH+q6dYw7JU9OXEy34ga7tbCwPynwJ2TRZSTVimMsT7fIhkI3rohZrX7hKRhFZvGMTEm4wPjk5MZ0nWhZxjLLnrCckEP5Ne5p1c4qVZP5M4Q95b8V/6uy9ohDegYWRpqgUtJZ23rql3eedkpn6er3ehkL6x4lVDc81zxhPlD0NxqgGuTJfRZqXqq/NDgJo1FuKnU4j0Oi4O3p5bRh72NQ2M1wWDOPA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from AS9PR04CA0170.eurprd04.prod.outlook.com (2603:10a6:20b:530::14) by AS4PR08MB7630.eurprd08.prod.outlook.com (2603:10a6:20b:4cd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.20; Fri, 23 Sep 2022 10:48:15 +0000 Received: from AM7EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:530:cafe::fb) by AS9PR04CA0170.outlook.office365.com (2603:10a6:20b:530::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.20 via Frontend Transport; Fri, 23 Sep 2022 10:48:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT058.mail.protection.outlook.com (100.127.140.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Fri, 23 Sep 2022 10:48:15 +0000 Received: ("Tessian outbound ee41cdb23966:v124"); Fri, 23 Sep 2022 10:48:15 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c65a923f9a1c7bbd X-CR-MTA-TID: 64aa7808 Received: from a6a4d7a3d430.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6E5A41F1-3EAA-4E70-99C1-936CB70611EE.1; Fri, 23 Sep 2022 10:48:08 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a6a4d7a3d430.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 23 Sep 2022 10:48:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D7rp+7uBMlqdBCpbGsOiOeeZzsEKG6xCIEIFo0EWu4nqJBYyQZoZPhGvgKo34wJF43D53ZqJ4i9MbQvB9wLIi6FqWK4omR/l7feQ7odKNq7swFabKzSyHwXwkHb9swD+HVRKmeq2VZSSEm5q6rbEF1m2QvHbvkkcbavntQoeidghkXCx0HtziZ3bFiof9k6wRxL9LnGYTAIn2uj+gZe9YeNUlc1ltHWSGPEZw8jr9AMVGdJRSvHVgbtBXDiNqvFNFe4rrZhpWYUjd+e8CL6u9NkPsLaJCZyJHp1CNAw6E4Uc1JhCyKkQ//inWyn7gHBs/hZBd3Xh8pzRIQ8aZD83Qg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Tk6qH6BNyk+K/ecgEwrDtSNbwVNmzQujtjxYmDlWMPU=; b=OQm4wxCMm3KFN7kYeJIOo5sMgg/Kya7s7KsA5oILAXeDlcXA6sw9cE0kj87xRzMslSeJSST4uXmo2PizexqA6QiG7Rsgl7dYdIYPqL6noY7ULhLshp7hQwnAmE3cjGf5CiOdl7KPCkn3N9f3CIjPR0VKxLltl5PKOroMBhOxzMmx9lsXjE9XIrwDwgrRabW95hvfqXkJtaaMgS7qC5wp6z1w9n9p0lpqsM0aorT9rJacGvJxHSxf7ptAJtoBueNMj6ZR2drFWpXE8PlNH2ItRhdQUCBWvMaAmixEthPN7G5PuT1SuMl2j0jVxWXkLX4V3O6blgggn07pqQUe/QzyLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by GV1PR08MB8425.eurprd08.prod.outlook.com (2603:10a6:150:a7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16; Fri, 23 Sep 2022 10:48:05 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::c5f9:a25b:a5f2:6094]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::c5f9:a25b:a5f2:6094%5]) with mapi id 15.20.5654.016; Fri, 23 Sep 2022 10:48:05 +0000 Message-ID: <1398bb10-2ed9-c074-0627-43d7e2feddea@arm.com> Date: Fri, 23 Sep 2022 11:48:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: Questions on how best to fix two gdb tests gdb.reverse/finish-reverse-bkpt.exp and gdb.reverse/next-reverse-bkpt-over-sr.exp Content-Language: en-US To: Carl Love , "gdb-patches@sourceware.org" Cc: Ulrich Weigand , Pedro Alves , Pedro Alves References: From: Luis Machado In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0393.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18f::20) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|GV1PR08MB8425:EE_|AM7EUR03FT058:EE_|AS4PR08MB7630:EE_ X-MS-Office365-Filtering-Correlation-Id: d9b99d6f-dfe6-4785-ee86-08da9d511e61 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: cS6rsRWnYUp6kdjMXTedZAGpNsFYku6OwF3u0VN65TQdbGrirJmN0SI5m7CT3MJ0nbtEXPDYV6clJTa+WHTvbLU/YFAAuzKuNer+9cEFOPjBZreRYghtkUepwSpAIrimAiLcVoETGGQKq7ICpoy13dFNkDFPcaA5r88SRifQEuylXF5e8aQGliqXwuu9eVHV8CitVnB9uEDdP7kHpBcY2+QQIIG4mORA8EPsDrd4NFL0YcdoFoE5hQRGdgUS/MN0wR17CpXn5XafJRS3bvVsmivO6tvNB9pNIwHF+BdIIKTQEn7X0zXM6GzyIG8URX9TFmXtPVvcpJgBdJEtGI5GCHmOndNMrUtgPd0bZTZGG0+p76SPt9XjQukl8o4Yt6RJZckqxmhPJ3jbB5a/cFQOu/Vf7FrH/6uHyuM9lnd3fifGg9L95qMIQOV/3MjqFy1TcQJD5akS9souVfMig1CU/HL+mnPHQmQ0by8GXcZXn3yfhvk730fyOyMY6N4S6bY9Mpsedh874qNnDDRfqD+KDQaDRT+0aCExobAi1+gwFpC+CBNzq/QZaoquRdhYfEMOlh2UFEhdhswKdXP6yrc6uV8ZFIGMM3WJ9XrEm+pjvKUzAka4RzybqpbV0rRLd4OmcQBN4EHbeLsCxN2BP8h3UptqJRnqS/i82ejAgibccEodtgu9Q1RcxwYDBJWWiBqfAt3zPR3BoNepmQqabL4S9yNurihAjMBBHe8Vmf+jREmrAMuTBlSLUNUkubWacN6DCPsNznWV/h+fGJuUAN0r3d9N12XvYEY+vHJe9WloL8IJDiVCe04XvlYXea5xedIZk/PyFn7XC8OmhZBQ4a1Hig== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB3919.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(396003)(366004)(346002)(376002)(136003)(451199015)(66946007)(83380400001)(6666004)(2616005)(31696002)(8936002)(38100700002)(186003)(44832011)(4326008)(2906002)(66476007)(66556008)(110136005)(54906003)(26005)(5660300002)(6506007)(316002)(478600001)(86362001)(41300700001)(53546011)(6512007)(6486002)(8676002)(84970400001)(36756003)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8425 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3a13d47a-3366-4d1e-9079-08da9d51185f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1XJ+qpnPqTBkxdOI1Us1n5PNTBFDjBpj96PAcQwbhqi20FvmUwHf/vZvbgyIonVjlnyCF2DS31oU+hKFIyOgkUIPSG/TnrSoys7cOMQjYB+5ipl65YEKhZMJS+Pnwy6PEqB5ai1lZdTNKHMLWoOf/JdsiUXypleZs1QIRdl5fIpnW1rytOMzgSSxhslhB66IsJhmhLbKAI9GuMvIL0AjFmaO9PFWDHUG2FWa+dPOMmf7EGIFDnNOTAuylKyxFUeAH6MoWdzTFhwEELb1Yg7LseXOKSSnxqUdzX83tPk90D+YKOtCXKDeN2xMYpGpucSzn6hoa8ov0E4X4sq67aDonEk5xxkat69u7aWrMl+UkqpSAABX8TgHESaadoCeMXTit5PFtYzcPYKUUz4Hdvh2ay6xTLTjYz6XtEZTyA02UQ4NIGy4Z537E4fAHV04m/aW/+mgQCTichjAujdm2wQelYJOE3ca6HoZ5aoeswxhCfKFGoEdgvKSdqEqIPQHtpC611EqzB1q0ezqCuBsIFZJUggJKIO9GAL7t5u2I4eiEFQQjkw4Cw7wg7qgN0kIAyC+pWegC4+Iy3sJBpOSEXCSpoPAjzn1azzPB3QFNwTb9HLqacD07ZKfDYeBtbOKKCZTFq+k4zWFqhwSxkd1PSwiT0P0MkdSe7gMMCQlygWJsx/f+nGsr8Ky8dkgkozIgn7fnm6DwY5AvMdwJ5lXjYRPTJUHXcd0semNpvdQMmhg2O6eI0OwyYgXvYEmp+2XMqJWnFucm/or4cn1N+bUgjfCm88VD3hSCtDF6XVDfVm80/U6Yl1SQWLN/r8CbUFcrahbfqE1G2AQ7x+yoxPi8GuARg== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230022)(4636009)(346002)(396003)(376002)(136003)(39860400002)(451199015)(46966006)(40470700004)(36840700001)(47076005)(31696002)(2616005)(40480700001)(336012)(86362001)(186003)(316002)(54906003)(110136005)(107886003)(83380400001)(5660300002)(6666004)(44832011)(53546011)(4326008)(8676002)(6506007)(8936002)(6512007)(26005)(82740400003)(40460700003)(36756003)(41300700001)(70206006)(70586007)(2906002)(36860700001)(6486002)(81166007)(356005)(82310400005)(84970400001)(31686004)(478600001)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 10:48:15.3367 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d9b99d6f-dfe6-4785-ee86-08da9d511e61 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7630 X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, KAM_DMARC_NONE, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY autolearn=no 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2022 10:48:20 -0000 Hi Carl, gdbarch has a hook to adjust the breakpoint address (gdbarch_adjust_breakpoint_address). Can this be used to bend commands like "b *func" so they behave the same as other architectures? Alternatively, you may need to conditionally (for powerpc) walk through instructions and locate the correct address for the breakpoint. On 9/22/22 19:23, Carl Love via Gdb-patches wrote: > GDB community: > > There are two gdb tests gdb.reverse/finish-reverse-bkpt.exp and > gdb.reverse/next-reverse-bkpt-over-sr.exp which fail for similar > reasons on PowerPC. It appears to me that the issues are with the > tests and not with gdb itself. Both tests set breakpoints on *func > where func is a function in the source file. This is the fundamental > issue with both tests. > > The test gdb.reverse/finish-reverse-bkpt.exp has the comment: > > gdb_test "tbreak void_func" \ > "Temporary breakpoint $decimal at .*$srcfile, line $breakloc\." \ > "set breakpoint on void_func" > gdb_continue_to_breakpoint "void_func" ".*$srcfile:$breakloc.*" > > # We stop at the brekapoint on void_func, but breakpoint on > # *void_func will be set at the same place if function void_func doesn't > # have prologue. One step forward to avoid this. > gdb_test "si" > > gdb_test "break \*void_func" \ > "Breakpoint $decimal at .*" \ > "set breakpoint at void_func's entry" > > The comment about break point on void_func and breakpoint on *void_func > being the same if there is no prolong is not true for all > architectures. Specifically PowerPC uses local and global entry > points. The statement "break *foo" sets the breakpoint at the address > of the first instruction in the function where as "break foo" sets the > breakpoint at the beginning of the function, i.e. after the prolog > following the local entry point. Specifically for this test the > PowerPC assembly code is as follows: > > void void_func () > { > 1000068c: 02 10 40 3c lis r2,4098 <-global entry point, > location of break *void_func > 10000690: 00 7f 42 38 addi r2,r2,32512 > 10000694: f8 ff e1 fb std r31,-8(r1) <-local entry point > 10000698: d1 ff 21 f8 stdu r1,-48(r1) <-prolog > 1000069c: 78 0b 3f 7c mr r31,r1 <-prolog > void_test = 1; /* VOID FUNC */ > 100006a0: 00 00 00 60 nop <- location of break void_func > 100006a4: 58 81 22 39 addi r9,r2,-32424 > 100006a8: 01 00 40 39 li r10,1 > .... > > The test fails on PowerPC because the reverse execution never hits the > breakpoint at *void_func because the function is called using the local > entry point. Thus gdb returns to the caller after it reaches the local > entry point at address 10000694. It does not continue executing back > to the global entry point. The global entry point is only used in > special cases when the Table of Contents (TOC) pointer is not already > setup in r2. > > The question is how to fix the test in general? > > 1) Changing the breakpoint on *void_func to void_func will cause both > breakpoints to be the same regardless if there is a prolog. That > change would seem to invalidate the point of the test? > > 2) Disable the test for architectures where the assumption breakpoint > on foo and breakpoint on *foo is the same except for a prolog. The > downside is we are missing testing of some gdb functionality. > > Is there another way to fix this test to run correctly on PowerPC? > > > The test gdb.reverse/next-reverse-bkpt-over-sr.exp also fails because > it does a break on *callee. Specifically, > > set lineno [gdb_get_line_number "STEP INTO THIS CALL"] > gdb_test "advance $lineno" ".*STEP INTO THIS CALL.*" "get past callee call" > > gdb_test "b \*callee" "" "set breakpoint at callee's entry" > > set bpnum [get_integer_valueof "\$bpnum" 0] > gdb_test "reverse-next" \ > "Breakpoint $bpnum, callee.*" \ > "reverse-next over call trips user breakpoint at function entry" > > gdb_test "up" \ > ".*NEXT OVER THIS CALL.*" \ > "stopped at the right callee call" > > In this case, it looks to me like changing the gdb_test to callee > instead of *callee doesn't break the point of the test. Making the > change on PowerPC fixes the test. > > Does anyone see any issues with changing the breakpoint from *callee to > calle for this test? > > Thanks for the input and help fixing these tests on PowerPC. > > Carl Love >