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 2E40438555A0 for ; Thu, 12 Oct 2023 13:02:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E40438555A0 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697115777; 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: in-reply-to:in-reply-to:references:references; bh=YysTOhgCR8BrQCtF7gUcXEybHoceRw8ALzn9sItfetQ=; b=YvWo61Q1+41Ax/xlgOvwr3NLbyFpWYF+9AJ0yS5NEyy6kddo6g3Z0qHdjv6r609+CP9rk+ QvjSv4GipabykqcCWfId6A8z4SMHmvU+2HT5nrgRShiTYMtUq8j5PLPzYdfKjRZNlzjzuz uM9QIgd2aadpLR351HF9ScyUi3DrHsU= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-586-okXQs8z2M1W-ca1XtEZHcg-1; Thu, 12 Oct 2023 09:02:56 -0400 X-MC-Unique: okXQs8z2M1W-ca1XtEZHcg-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-993eeb3a950so61380166b.2 for ; Thu, 12 Oct 2023 06:02:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697115775; x=1697720575; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YysTOhgCR8BrQCtF7gUcXEybHoceRw8ALzn9sItfetQ=; b=ug8YKQahcnY4zps5sLfA3UIEdWyhy9PfCmRNMyp7YxLmQe5JblyfXLyf6L5Fmo7AMb CXVk8kEs+O7r0BIRRKzFDxzaJIIjgsnMaXTHpv0hCHbi2tJaBsSNzPeieHL55Cvgl3A+ EDIGzmeRWfy9OrruQ+NBwXl6inyJIBgzou5wM8yOKnodYNBmsNbLeAM2w79YffJCCbZW GtgrB8uxvQNYY0t0vBopGePVMO9tHRhPislDDqedotqqflm1XS9lASqy9RHT/5imSeNu KVbNTOek52psJ+2UqGJWo3pQRvzT0cFTmc7TFif/41KUlF+M6ODwmACumQ6Jg2jtLMQh sa8w== X-Gm-Message-State: AOJu0Yx/d/f80TbXAwxnP3JLBKYhvv214YTfedDipmGdX9OTnq1WOQXG 3lOdtZdaH0lVa4NSCVSrTHbag5Mq4/Etovufi/+NFDRW1G2eWx4LKiOoPk6gxAE1TQelH2xAnFB TkS3DcvDenAePS81H7MI= X-Received: by 2002:a17:907:75f7:b0:9bd:804c:69ee with SMTP id jz23-20020a17090775f700b009bd804c69eemr3855833ejc.48.1697115775033; Thu, 12 Oct 2023 06:02:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmFTT/ikM+e5Pvk1/SkJf9CCqBBJGli82SQ77Z65ok84fTi9f6QdcjQ5RBvwFZxUyK26IoaA== X-Received: by 2002:a17:907:75f7:b0:9bd:804c:69ee with SMTP id jz23-20020a17090775f700b009bd804c69eemr3855816ejc.48.1697115774660; Thu, 12 Oct 2023 06:02:54 -0700 (PDT) Received: from localhost ([31.111.84.209]) by smtp.gmail.com with ESMTPSA id j24-20020a170906051800b00993470682e5sm11007167eja.32.2023.10.12.06.02.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 06:02:54 -0700 (PDT) From: Andrew Burgess To: Luis Machado Cc: gdb@sourceware.org Subject: Re: Thread Specific Architectures And Python Unwinder API In-Reply-To: <29fefb89-9934-4e9d-9ea0-adf40789e921@arm.com> References: <87bkd5czqr.fsf@redhat.com> <05568109-8df9-4a48-af04-9f784bf0e4d8@arm.com> <29fefb89-9934-4e9d-9ea0-adf40789e921@arm.com> Date: Thu, 12 Oct 2023 14:02:53 +0100 Message-ID: <87wmvsat8i.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: Luis Machado writes: > On 10/11/23 11:06, Luis Machado wrote: >> Hi Andrew, >> >> On 10/11/23 09:47, Andrew Burgess wrote: >>> >>> Hi Luis, >>> >>> While working on something else I was looking at the Python Unwinder API >>> code, and I suspect that the thread-specific architectures support might >>> (currently) break the Python Unwinder support. >>> >>> If it is, then I think the fix is pretty simple, but before I posted it, >>> I wondered if you could confirm that things are indeed, currently >>> broken. >>> >>> Attached at the end of this email is a Python unwinder. You'll need to >>> supply your own test program that makes use of sve/sme, and thus uses >>> thread-specific architectures. >>> >>> What you'll need to do is: >>> >>> $ gdb -q test_file_that_uses_sve_sme >>> Reading symbols from .... etc ... >>> (gdb) source ./unwinder.py >>> (gdb) break function_where_a_thread_specific_arch_will_be_in_use >>> Breakpoint 1 at ... etc ... >>> (gdb) run >>> Starting program: ... etc ... >>> >>> Now at this point, when you stop, you should see at least one instance >>> of the banner: >>> >>> *********************************** >>> * Have executed the test unwinder * >>> *********************************** >>> >>> being printed, probably more. As you step though the function you >>> should see more instances of the banner being printed. >>> >>> To reveal the bug then it is important that when GDB stops in >>> function_where_a_thread_specific_arch_will_be_in_use, the per-thread >>> gdbarch that it creates _must_ be different from the inferior wide, >>> top-level gdbarch. >>> >>> If you don't see the banner then my suspicion is correct, and the Python >>> Unwinder API was broken when the thread-specific architecture support >>> was added. > > I've confirmed I don't see the banner. So this seems to be broken. > > Is the fix to set the python unwinder hook elsewhere? Or maybe save that > information when we're trying to pick a different gdbarch? I'll post my patch for this later today. But I'm going to propose changing the 'architecture_changed' observable into a 'new_architecture' observable (which is called in a different place). As such, every new architecture will have the Python unwinder registered correctly. I just need to update the commit message with some details of this issue as justification for the change, and I'll post it -- it's a pretty small change. I'll CC you on the new thread. Thanks, Andrew