From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WtIZE7OqsmCyBAAAWB0awg (envelope-from ) for ; Sat, 29 May 2021 16:57:23 -0400 Received: by simark.ca (Postfix, from userid 112) id 3944A1F11C; Sat, 29 May 2021 16:57:23 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,RDNS_DYNAMIC,T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 2B9581E813 for ; Sat, 29 May 2021 16:57:22 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9D0F03886C5D; Sat, 29 May 2021 20:57:21 +0000 (GMT) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id 303BA385802D for ; Sat, 29 May 2021 20:57:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 303BA385802D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wm1-x32b.google.com with SMTP id s5-20020a7bc0c50000b0290147d0c21c51so4246825wmh.4 for ; Sat, 29 May 2021 13:57:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=72j4pFzm2xHCn8Y3G3SRWiAqaNh575ExRootCG8+WWU=; b=I7dAtGATMRlSkw+sHSuRsRLomJy7vP78wRMJtuDOhJjpUBmkh+ev1ozo3gVqFlUlJM pnTzGHszdvK/BKnmi3416FqrF025qpZ339reiXs9bI6Y/BfxkATo/rfL4NSFV+ivFUwa Q385fTSfyN3A/umx+SpQ060xiU3YzPAXd5NGi1s4hhJkvn8LJnYWlY9z3DHzO6fpWogy Ks3E5OGuZwPdatNFGVSxEEgYnSvAa5rqFKvI/HqUMjkHquuGT7zd7dk7tTB1yYgq7bMS wlewCFNf1ZuTfKPZR3LjNXxeFzG06S1DhVD+T+kY1cHPQIDI6g02DFm5llkVHZzN9R3X f67g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=72j4pFzm2xHCn8Y3G3SRWiAqaNh575ExRootCG8+WWU=; b=gsDrbX/mj1vEerqxfuTrECAiVtsQvZkOoVb70FUbxIqjy30Q4l3datfZsGnq3GZacQ pKrKBrT8f3KKaMIqngfjBQGCY6jypFP8L4kvNUnZd6SxM1c8N08WICYnWQR+jTUyizqV /ytXToqo5NtZZaqFiMkUH4Qi0ZUN+Cr7sDv2o6O62WeV3qT3b/2FKdoES8BuGMldRZw7 f+ypYa4hzYTGWtp+VtO8DCki2WOVvxnWLuF3qhLPxwAyRhRtdHiSxqbLa4+dT2MPfx8w KvH/OCbTiSz+UzkX+e75UHZo3HHFe09YSRj5spn2TiRRisri29lqS71mqVBZ07qPW9rF ckmQ== X-Gm-Message-State: AOAM533gyOeS29ZaZWgPZAZlSfVrPNDHxYhftmj+bzCii8yTgN68TCYH r+sMv/Bxj4S2/BG9o40Iv67qONfrAmTOew== X-Google-Smtp-Source: ABdhPJyAp4t7rIlJHBDairywRYaCSqaVE4m9UEuZH6hjUywtlmtRlxMGsRKZcGrvHHm7aDC8FhxBFA== X-Received: by 2002:a7b:c30f:: with SMTP id k15mr19454365wmj.128.1622321837557; Sat, 29 May 2021 13:57:17 -0700 (PDT) Received: from localhost (host109-151-46-70.range109-151.btcentralplus.com. [109.151.46.70]) by smtp.gmail.com with ESMTPSA id p5sm13161367wrd.25.2021.05.29.13.57.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 May 2021 13:57:17 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: [PATCH 0/5] Fix for an assertion when unwinding with inline frames Date: Sat, 29 May 2021 21:57:09 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" This series fixes an assertion I ran into when unwinding a stack containing inline frames (patch #4). I also fix an assertion from the 'set debug frame 1' code when I ran into when trying to debug the first assertion (patch #5). I also fix an assertion in the Python unwinder API that I ran into while trying to write a test for the first assertion, this ended up with me extending the functionality of the unwinder API a little, which is nice (patch #1). Then I needed to add some additional methods to the Python Frame/PendingFrame API so I could write the test for the first assertion (patch #3). Finally, there was a small drive by clean up which related to the new Frame/PendingFrame API extension (patch #2). Thoughts welcome, thanks, Andrew --- Andrew Burgess (5): gdb/python: handle saving user registers in a frame unwinder gdb/python: move PyLong_From* calls into py-utils.c gdb/python: add PendingFrame.level and Frame.level methods gdb: prevent an assertion when computing the frame_id for an inline frame gdb: remove VALUE_FRAME_ID gdb/ChangeLog | 34 +++++ gdb/doc/ChangeLog | 6 + gdb/doc/python.texi | 9 ++ gdb/frame.c | 61 +++++--- gdb/frame.h | 4 - gdb/python/py-frame.c | 23 +++ gdb/python/py-inferior.c | 2 +- gdb/python/py-unwind.c | 40 +++++ gdb/python/py-utils.c | 12 ++ gdb/python/python-internal.h | 2 + gdb/testsuite/ChangeLog | 23 +++ .../gdb.base/inline-frame-bad-unwind.c | 58 ++++++++ .../gdb.base/inline-frame-bad-unwind.exp | 139 ++++++++++++++++++ .../gdb.base/inline-frame-bad-unwind.py | 85 +++++++++++ gdb/testsuite/gdb.python/py-frame.exp | 11 ++ .../gdb.python/py-pending-frame-level.c | 49 ++++++ .../gdb.python/py-pending-frame-level.exp | 65 ++++++++ .../gdb.python/py-pending-frame-level.py | 55 +++++++ .../gdb.python/py-unwind-user-regs.c | 37 +++++ .../gdb.python/py-unwind-user-regs.exp | 98 ++++++++++++ .../gdb.python/py-unwind-user-regs.py | 72 +++++++++ gdb/valops.c | 17 ++- gdb/value.c | 5 +- gdb/value.h | 6 - 24 files changed, 874 insertions(+), 39 deletions(-) create mode 100644 gdb/testsuite/gdb.base/inline-frame-bad-unwind.c create mode 100644 gdb/testsuite/gdb.base/inline-frame-bad-unwind.exp create mode 100644 gdb/testsuite/gdb.base/inline-frame-bad-unwind.py create mode 100644 gdb/testsuite/gdb.python/py-pending-frame-level.c create mode 100644 gdb/testsuite/gdb.python/py-pending-frame-level.exp create mode 100644 gdb/testsuite/gdb.python/py-pending-frame-level.py create mode 100644 gdb/testsuite/gdb.python/py-unwind-user-regs.c create mode 100644 gdb/testsuite/gdb.python/py-unwind-user-regs.exp create mode 100644 gdb/testsuite/gdb.python/py-unwind-user-regs.py -- 2.25.4