From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56812 invoked by alias); 7 Oct 2019 09:05:49 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 56800 invoked by uid 89); 7 Oct 2019 09:05:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: mail-pl1-f172.google.com Received: from mail-pl1-f172.google.com (HELO mail-pl1-f172.google.com) (209.85.214.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Oct 2019 09:05:48 +0000 Received: by mail-pl1-f172.google.com with SMTP id q15so6530572pll.11 for ; Mon, 07 Oct 2019 02:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=e8uPX1LVlcIS4CQQtGBPTVa0KdltJirZhsw/KaAPK1I=; b=mHzQ3Zn4uiCY/jX5xSKG+6112vbwKM0b4hvb3/uJkxpz6gfEI1/AAn3rYQbw00Jo2o G2fSvwwQqm0egaYXB49UIi4xDV4DnEuIBfqDablLZTHb5NheJL9ySesyEENrM6vh79HI Gq4qXuhUt6Eh+cu1Q1jwvJhQ0C8SIt1brWCcNxRVA01P67IvGfxd4IZ374p/hvgYHuol gJN6GtmdzVqAtxBRAjv7ihD9ki4DKeo//8yYJpIAucgHi8HCNLANRSR0Gj7zkWZfoLv+ 0rshi5WwBygGWre3Sczqr7p9AfaMB7T+dIoBqNxATvD4qOpPxgvIwIqzGnXVgKVjhZn2 /eiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=e8uPX1LVlcIS4CQQtGBPTVa0KdltJirZhsw/KaAPK1I=; b=FJyBhQy97vUdY/erqohLfSPi0BNVhcRgtv7w+YKY1K5tm6jVFz8NwMIA8YIXuejnkw IhsYTcMBnjrNjEVWdbVMKv+Pwa4MqG5H3zAMAahCBEIz1fAnVMfua8LDG4i+s4FsKNUd FdqSLaR2Jbf1QnC7sOydizz3kJzvcqvlhmT0d0OGXXP8Vo1+uoT4sC9ujEXdlVH9qSOW NbQOt25GiAcscnoqHbRXNMT2CreYY7EDZqqVE1bjJWvAoxX8vM2eNrbWQcrsUT/gOGNz aOnx2oFdnzXEQfwoB+EI6eGHf4Zjf7Bza1rt/KjOK2rdGXiiLgblhbyY+xNn8aCINEaE 7jmw== X-Gm-Message-State: APjAAAWkV8uaGSr+UT/Izp9t3wN2HUC7Ucp9+Aych5IJo2Gns4d71FTu 6vmhAbsDIkWrvM+dZYtWpWtWsG28hM0= X-Google-Smtp-Source: APXvYqyeyosLR/l337+sWzHcK/4GZWdwX7B87S1xM25tRQgwwHtfehbZzj/1QtpKCT3YA7Uuts5hPQ== X-Received: by 2002:a17:902:b7c3:: with SMTP id v3mr27627030plz.139.1570439145944; Mon, 07 Oct 2019 02:05:45 -0700 (PDT) Received: from vader.hsd1.wa.comcast.net ([2601:602:8b80:8e0:e6a7:a0ff:fe0b:c9a8]) by smtp.gmail.com with ESMTPSA id a17sm13855631pfi.178.2019.10.07.02.05.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2019 02:05:45 -0700 (PDT) From: Omar Sandoval To: elfutils-devel@sourceware.org Subject: [PATCH 0/5] libdwfl: expand stack frame interface Date: Mon, 07 Oct 2019 09:05:00 -0000 Message-Id: X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-q4/txt/msg00006.txt.bz2 From: Omar Sandoval Hello, While using the libdwfl stack unwinding interface for my debugger [1], I found that it works great for getting the program counter at each stack frame, but it's hard to do anything beyond that. This is an attempt to expand the functionality by adding two main features: attaching to/detaching from threads at will, and evaluating DWARF expressions. This functionality already exists within libdwfl, so it's just a matter of defining the interface. Patches 1 and 2 are cleanups in preparation for the rest of the series. Patch 3 adds dwfl_attach_thread and dwfl_detach_thread so that it's possible to attach to threads at will and save stack frames so that they can be inspected later. Patch 4 adds dwfl_frame_module and dwfl_frame_dwarf_frame to avoid redundant lookups internally and in clients of libdwfl. Patch 5 adds dwfl_frame_eval_expr for evaluating DWARF expressions in the context of a stack frame. Please let me know what you think. Thanks! 1: https://drgn.readthedocs.io/en/latest/ Omar Sandoval (5): libdwfl: don't bother freeing frames outside of dwfl_thread_getframes libdwfl: only use thread->unwound for initial frame libdwfl: add interface for attaching to/detaching from threads libdwfl: cache Dwfl_Module and Dwarf_Frame for Dwfl_Frame libdwfl: add interface for evaluating DWARF expressions in a frame libdw/ChangeLog | 9 ++ libdw/libdw.map | 8 ++ libdwfl/ChangeLog | 31 +++++++ libdwfl/dwfl_frame.c | 190 ++++++++++++++++++++++++----------------- libdwfl/frame_unwind.c | 37 +++++++- libdwfl/libdwfl.h | 28 ++++++ libdwfl/libdwflP.h | 9 +- 7 files changed, 228 insertions(+), 84 deletions(-) -- 2.23.0