From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 3478E3875DCB for ; Thu, 11 Jan 2024 12:55:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3478E3875DCB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3478E3875DCB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704977718; cv=none; b=Vs4I8m51h3S3pCz+R5KK7mHCv6cgES5h0FMZhs9WXEHcTbl8IGkNYgTvnNeR+OdZTZGVYR+SSVKGliDtoLSXYCizWazZbn/Rvoqff3roqHGi6ytAiNuXm5+G+zNNo8084nl0sbHmtmpuFPVWxnNyFdZCBnz7Dq6LmsYS4qRQaWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704977718; c=relaxed/simple; bh=9tGY7/smDVEUw7r6DBS0vEI3MfhxAo4MhvrihoRYKFo=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Ss6d199KKL73al8v4oZGR8HaQx1P/uf2FOoiu/OCJo6MfsbpUXAIFi4NXQ2vgi8hE42tw4OagFDB6To2h3omVN/3QIPp8jKaCepQHljf8upNVL6Kk+cwb2ZBVei5ZMWWfzAit3doE6PTxkNG6qToGZC7+YqoR5c9orgYpXYzrPY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704977715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+dXedyrpYDc4XON5lu/w9NxYLrRGg+8Vq5FrEhYJVhI=; b=MugTrhUcipnKa53MY5gVlnDhN086IbkbjXWha7hF3SMYs8HMRS5u3tCyPBQHqsrKXUjoI3 onZkc5U1vy4w8OEy/jyUe30dhzAYKKU8oWYvK5LTwdcKAzGHh28qmjxWhigLp14wGIWBYf 6nWXMDnNOV0ajZr7NAMdQdLTequhjLE= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-500-DaCzkE3oPQ651sEMsMJVZA-1; Thu, 11 Jan 2024 07:55:14 -0500 X-MC-Unique: DaCzkE3oPQ651sEMsMJVZA-1 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-555bda8b4a1so3023363a12.3 for ; Thu, 11 Jan 2024 04:55:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704977713; x=1705582513; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+dXedyrpYDc4XON5lu/w9NxYLrRGg+8Vq5FrEhYJVhI=; b=udRRNe1zHkVZuPo+wApfMXHWZpfcXRWiYN5VP/gvyrJ3lEYskeYBqxVLTc1Iw5uaLd naQqm00RklvMJHrK5vnjC6DvGtPM3F82EXD2wNpSMu+0tuXdkHw8gyDkMSJ6WvOoI7pI nH/OpZQZRj5MgbJhMTKkpcgJHLmbbEjSv6EgTzMtV+qy69h78JZiXCQxTQnnYOdLOFzC nsftEu/Vr05bUXXFD6k0X1z69FpW6r57AO5Gw1t6Cv//7qYocgjeUoDW+VzW+S3YEE2X rHz4/lO4RwSJ8hy9yOkTC8V1R4wh+PxIrE1So5f3pK0TrSyH8gMYEwh+YwLC/xVN2/5j WZpg== X-Gm-Message-State: AOJu0Yx7SI03qyI3V+StIUaW7NESgebIaeCqqk1dpoCOp34ccBTNjso8 yWxKpRpE5/6hba1FaLqwmAf0SMOVv/DnEk21mRQUcdg4hRWpAEqaWNdSnY56XvEvPEo78LEm1jh Y5yuTkmk6ULd+lbiwbzusm69ynDGPAQ== X-Received: by 2002:aa7:c482:0:b0:558:b07d:e80d with SMTP id m2-20020aa7c482000000b00558b07de80dmr159987edq.19.1704977713579; Thu, 11 Jan 2024 04:55:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IG87pWwKPYagcgoyw/S6tG3N5R4fMSTi3/zVHKw81dMbm6gopxOiO9JCeVGbUgxxmmdrNAkKg== X-Received: by 2002:aa7:c482:0:b0:558:b07d:e80d with SMTP id m2-20020aa7c482000000b00558b07de80dmr159982edq.19.1704977713296; Thu, 11 Jan 2024 04:55:13 -0800 (PST) Received: from [192.168.0.129] (ip-94-112-227-180.bb.vodafone.cz. [94.112.227.180]) by smtp.gmail.com with ESMTPSA id ig3-20020a056402458300b00558afede90csm174993edb.80.2024.01.11.04.55.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Jan 2024 04:55:12 -0800 (PST) Message-ID: Date: Thu, 11 Jan 2024 13:55:11 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/testsuite] Fix gdb.dwarf2/dw2-entry-points.exp on ppc64le To: Tom de Vries , gdb-patches@sourceware.org Cc: Ulrich Weigand , Carl Love References: <20240111124211.19244-1-tdevries@suse.de> From: Guinevere Larsen In-Reply-To: <20240111124211.19244-1-tdevries@suse.de> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: On 11/01/2024 13:42, Tom de Vries wrote: > On ppc64le-linux, I run into: > ... > (gdb) bt^M > #0 0x00000000100006dc in foobar (J=2)^M > #1 0x000000001000070c in prog ()^M > (gdb) FAIL: gdb.dwarf2/dw2-entry-points.exp: bt foo > ... > > The test-case attemps to emulate additional entry points of a function, with > function bar having entry points foo and foobar: > ... > (gdb) p bar > $1 = {void (int, int)} 0x1000064c > (gdb) p foo > $2 = {void (int, int)} 0x10000698 > (gdb) p foobar > $3 = {void (int)} 0x100006d0 > ... > > However, when setting a breakpoint on the entry point foo: > ... > (gdb) b foo > Breakpoint 1 at 0x100006dc > ... > it ends up in foobar instead of in foo, due to prologue skipping, and > consequently the backtrace show foobar instead foo. > > The problem is that the test-case does not emulate an actual prologue at each > entry point. > > Fix this by disabling the prologue skipping when setting a breakpoint, using > "break *foo". Sorry if my question doesn't make sense, but wouldn't we also want to verify that prologue skipping works correctly in a function with multiple entrypoints? I agree that this looks like a testsuite fail rather than a real GDB bug, but I feel like we'll be losing a valuable test if we don't try it at any point, especially now that it is easy to explicitly mark an instruction as EPILOGUE_END in the dwarf assembler. -- Cheers, Guinevere Larsen She/Her/Hers > > Tested on ppc64le-linux and x86_64-linux. > > PR testsuite/31232 > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31232 > --- > gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp b/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp > index f361820f72f..035b15ee087 100644 > --- a/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp > +++ b/gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp > @@ -180,8 +180,8 @@ if ![runto_main] { > } > > # Try whether we can set and hit breakpoints at the entry_points. > -gdb_breakpoint "foo" > -gdb_breakpoint "foobar" > +gdb_breakpoint "*foo" > +gdb_breakpoint "*foobar" > > # Now hit the entry_point break point and check their call-stack. > gdb_continue_to_breakpoint "foo" > @@ -204,7 +204,7 @@ if ![runto_main] { > return -1 > } > > -gdb_breakpoint "fooso" > +gdb_breakpoint "*fooso" > gdb_continue_to_breakpoint "foo_so" > > gdb_test "bt" [multi_line \ > > base-commit: 4ece39c56cfdd5647d4061f3c084b9de6f9e443c