From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EKcOCPXpV2M5gBAAWB0awg (envelope-from ) for ; Tue, 25 Oct 2022 09:51:49 -0400 Received: by simark.ca (Postfix, from userid 112) id 1D9FD1E112; Tue, 25 Oct 2022 09:51:49 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=mngDh8Ka; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id CE28E1E0D5 for ; Tue, 25 Oct 2022 09:51:48 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 793753857036 for ; Tue, 25 Oct 2022 13:51:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 793753857036 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666705908; bh=+RGq8TLzFFNQWCPIavHPVMdIKPls/Ii1OiE9fMA7DrU=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=mngDh8KaSeVnrstl5T8fWxaEWbFdl2WxhweoVIoL1KdX8Do42PW2JJRWI1xc+LvOO mlXiT9JKA6+hzUYj1CB8TfgAzNK/zvl63sHp6TnVf9cGiXq6eduipz3FWDoCKvdcLM 1NGZ+eP4xmbQ1N2aLpoL6f37ATy1qQVtYxpKRGHY= 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 640A93857025 for ; Tue, 25 Oct 2022 13:51:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 640A93857025 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-280-Aap70MCoNm2QDyuKoGF8Yg-1; Tue, 25 Oct 2022 09:51:26 -0400 X-MC-Unique: Aap70MCoNm2QDyuKoGF8Yg-1 Received: by mail-wr1-f71.google.com with SMTP id d10-20020adfa34a000000b00236616a168bso3409941wrb.18 for ; Tue, 25 Oct 2022 06:51:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+RGq8TLzFFNQWCPIavHPVMdIKPls/Ii1OiE9fMA7DrU=; b=7dClVn2kKbxrLfGsVv9WPTtCjAePAxGhXLhlw9j1f0w4u57HGi7H600UM4R7EeiTYI jZ8GKN5yn4poGnLpzeE2iboh8RyzMNd3vQfVwpGTtGk+hc2HiDRdDaPVifNS4JrcNLlb Lb3FjYihU8kyIuYFEtI5RsDwJ2aY5t0vhNPeSHEDnPe3zNzTLozqC3D/mnYIeSakJn4a KbybLaPGCp+WN/KcT66+muscfhdEWteT8cSmJZ2EAC2utSqXNdYjMxHM1GcURCOaR3lm DuUbUWjuHxEImD8xzn1+IG95hZmuIIswAEyW8N9qf5GnvYN9EeYzz7SfcVY/8mIxFXIo XuHw== X-Gm-Message-State: ACrzQf1jzmSURnc0tr7ierfSAnrN6oH5CdnVCEZCU4mYDjCRdWZUiiK1 m5e6cgW6OZY6SoaFN8gb4rDe/ormsMs5PGOGxpJCvdEXeXqvF5ctJt1J5IIlNYX5DPP86EGrpUm 35tJU9LNKFscVcll5OwR9xQ== X-Received: by 2002:a5d:64c3:0:b0:236:695d:39f7 with SMTP id f3-20020a5d64c3000000b00236695d39f7mr9830697wri.614.1666705885074; Tue, 25 Oct 2022 06:51:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7a9873RF5z1rksOCS0fsS5FBke5IyWCFw2sx5VLSs6fku/p1cAKNMGeqE+LW+6X9WHv3Gl/g== X-Received: by 2002:a5d:64c3:0:b0:236:695d:39f7 with SMTP id f3-20020a5d64c3000000b00236695d39f7mr9830675wri.614.1666705884775; Tue, 25 Oct 2022 06:51:24 -0700 (PDT) Received: from [192.168.0.45] (ip-62-245-66-121.bb.vodafone.cz. [62.245.66.121]) by smtp.gmail.com with ESMTPSA id n4-20020a05600c3b8400b003b4a699ce8esm11775690wms.6.2022.10.25.06.51.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Oct 2022 06:51:24 -0700 (PDT) Message-ID: Date: Tue, 25 Oct 2022 15:51:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH v4 1/2] Change calculation of frame_id by amd64 epilogue unwinder To: Simon Marchi , gdb-patches@sourceware.org References: <20221005103832.3163424-1-blarsen@redhat.com> <20221005103832.3163424-2-blarsen@redhat.com> In-Reply-To: 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-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: , From: Bruno Larsen via Gdb-patches Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 25/10/2022 15:44, Simon Marchi wrote: > On 10/5/22 06:38, Bruno Larsen via Gdb-patches wrote: >> When GDB is stopped at a ret instruction and no debug information is >> available for unwinding, GDB defaults to the amd64 epilogue unwinder, to >> be able to generate a decent backtrace. However, when calculating the >> frame id, the epilogue unwinder generates information as if the return >> instruction was the whole frame. >> >> This was an issue especially when attempting to reverse debug, as GDB >> would place a step_resume_breakpoint from the epilogue of a function if >> we were to attempt to skip that function, and this breakpoint should >> ideally have the current function's frame_id to avoid other problems >> such as PR record/16678. >> >> This commit changes the frame_id calculation for the amd64 epilogue, >> so that it is always the same as the dwarf2 unwinder's frame_id. >> >> It also adds a test to confirm that the frame_id will be the same, >> regardless of using the epilogue unwinder or not, thanks to Andrew >> Burgess. >> >> Co-Authored-By: Andrew Burgess >> --- >> gdb/amd64-tdep.c | 10 +- >> .../gdb.base/unwind-on-each-insn-foo.c | 22 +++ >> gdb/testsuite/gdb.base/unwind-on-each-insn.c | 25 +++ >> .../gdb.base/unwind-on-each-insn.exp | 154 ++++++++++++++++++ >> 4 files changed, 206 insertions(+), 5 deletions(-) >> create mode 100644 gdb/testsuite/gdb.base/unwind-on-each-insn-foo.c >> create mode 100644 gdb/testsuite/gdb.base/unwind-on-each-insn.c >> create mode 100644 gdb/testsuite/gdb.base/unwind-on-each-insn.exp > Hi Bruno, > > On Ubuntu 22.04, I can get this new test to fail quite reliably with: > > $ taskset -c 1 make check TESTS="gdb.base/unwind-on-each-insn.exp" RUNTESTFLAGS="--target_board=native-gdbserver" > > Can you give it a try? Hi Simon, I'll take a look, thanks for bringing this to my attention! Cheers, Bruno > > Simon >