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 640A93857025 for ; Tue, 25 Oct 2022 13:51:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 640A93857025 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=1666705888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+RGq8TLzFFNQWCPIavHPVMdIKPls/Ii1OiE9fMA7DrU=; b=CbPSyx7npq4Rc4WUUJSs4w6jyrrgBF2Xn1D3W/WHOKo5Zv96OlDiclSXkBTscE8OSs3Mks TiToYHIDQTdwO35FJ8v5iEOaG57Hs/G9nihcWrMh1yQfqLbSEPEsp9RQS2WyGmDqx6LkMT CW9I8RvDzvZ/MReYBX8EQLRuYzA1scw= 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> From: Bruno Larsen 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-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no 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 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 >