From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id NGY5IJSixmbk0A8AWB0awg (envelope-from ) for ; Wed, 21 Aug 2024 22:29:40 -0400 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=lbs0fjYj; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 6EB211E0D0; Wed, 21 Aug 2024 22:29:40 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 591DA1E0AC for ; Wed, 21 Aug 2024 22:29:38 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C41C838708F2 for ; Thu, 22 Aug 2024 02:29:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C41C838708F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1724293777; bh=eXWAiUCoWcMS3A8UOw1eQhxHwj5LpkIq+Rv/OJWuQ/s=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=lbs0fjYjDyb8YzLxDbECO9izEyD9ZR0Sh5kKXsumCZBr0AbJfqQmIJ+90Kg7Fn1sQ Muw8pqKvaQnb2En9FRKEZ08kzqxj0a7mw6MH3ZB6KjB4f4e+h6ybgth3kRvltWXM5/ v3tZtcg7+lqf/nXoVrBsW8yEy30VHJHK8vvkM7G0= Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by sourceware.org (Postfix) with ESMTPS id 0A608385C6CE for ; Thu, 22 Aug 2024 02:28:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A608385C6CE ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0A608385C6CE ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724293742; cv=none; b=OQnM6eDsP+PLXX5n1hl+xPAz/QWiPEa1tf278zPn5hr5e4aWT6Wj2aQ358sgXwMvd9yg7+8V89XeaKQX46eO6djgrlfjGn0F6ARSYrPyzRTvEmFlwkC6eNiBphDd5c6dOh61+7HGKpbSuF3fdKoM1dzyeU/YigZp1medeieeCrU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724293742; c=relaxed/simple; bh=Slf4Ub99WE/aWH0nmWEzcVm0IISjVW4dzQHRpE7RSg4=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=IFvUjKWudqtHLem3sb0E4vCoRLKIZ3FNKl4CeHmfnH5T+NNPumDm7fIsttq4wu6IInH5rR/2XCWOjsUSJc88a8hOEo4g48FMtwwyFRUNlfjaHrVuM2YOcNZ+EJeqG6IOw27GCMbiLq4K2C89RtiPdO/fugCrm5FLyaA1zwLCyLY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-qt1-x834.google.com with SMTP id d75a77b69052e-44fe9aa3bfaso2236451cf.0 for ; Wed, 21 Aug 2024 19:28:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724293738; x=1724898538; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=eXWAiUCoWcMS3A8UOw1eQhxHwj5LpkIq+Rv/OJWuQ/s=; b=DwR8Noz6UT7uTIGx3nhQ7u//33KXltr1oUZDV/AWTtQbN1keoLNsEPFR/pPUv2zDn8 OSMwCUs9h4Trw3tS1calCUuHAv4+8i+W60fpPhPmi968ntNZ93iX2M2cfiz5WTc0HTHY IKKfAS3xGl7a1rjzuoSASYwBMDc7RjpKDVcDxWuwK3Axy5uNoD4vyFmdCfoW5d1Uto1A BTrNBjzW1RFrZw3HXWKj1OglVHvmG1S8sr4IHZpa42z8COW8oC2QYNh65F7P80mV95BW kJblItAq2RBnzqCD2lvQooJe6ch6hyTW3wE8Jc2YDGaePKmo2ASGG2YZrMogsv0G2X/m 72Tw== X-Gm-Message-State: AOJu0Yw8m4Q5WVCL5WhwQ2oR/AY6AxQytzNH/UFqj81Vp+8ZPdXXQA+i jW2z5kOa7AuUKh74CGBsC0zaEb9SeAVfTR3KH0ylPKszt+2oYXFyQKasi+FgQV9VdIFqFze1LMH IG7VSbpgrCiLNqHuW6cNG9vfC8S/qvgE= X-Google-Smtp-Source: AGHT+IHiCiDqrnKDAC7GUkvc2EeCuQr673me3SYhB+u4XR6w7zai9VMear3+L0u+6jNcodY6gbFQlQx2Fprz6CMOxcM= X-Received: by 2002:a05:622a:588c:b0:454:e7e5:79df with SMTP id d75a77b69052e-454f21d3a96mr54407041cf.9.1724293738122; Wed, 21 Aug 2024 19:28:58 -0700 (PDT) MIME-Version: 1.0 Date: Wed, 21 Aug 2024 22:28:47 -0400 Message-ID: Subject: Expose Frame Type and Stop Reason in python Unwinder API To: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Wock via Gdb Reply-To: Andrew Wock Errors-To: gdb-bounces~public-inbox=simark.ca@sourceware.org Sender: "Gdb" Hello, Recently I wrote a kernel trapframe unwinder using the python API, and I was able to successfully extract the registers from the trapframe. However, sometimes gdb would throw the "previous frame inner to this frame" error on me. This is because unwinding a trapframe sometimes results in unwinding to a different stack. The way this is fixed in the internal unwinder API is that there are special frame types such as SIGTRAMP_FRAME which don't get checked for that error. Additionally, some trapframes unwind into userspace. In those cases I'd like to be able to stop the backtrace by setting a stop reason. More broadly this would be useful for any case where a user wants to stop the stacktrace at a certain point for whatever their use case is. I'm interested in moving forward and writing a patch for this. One implementation detail I noticed that complicates this implementation is that all python unwinders are internally modeled as a single C unwinder in py-unwind.c:974. I believe that in order to support a frame type feature, each unwinder will need to be modeled as an independent C unwinder. I am proposing this here to get community feedback on whether this feature should be supported. Thanks, Andrew Wock