From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by sourceware.org (Postfix) with ESMTPS id 0EB0B3858D3C for ; Sun, 3 Oct 2021 16:38:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0EB0B3858D3C Received: by mail-lf1-x12d.google.com with SMTP id g41so60950343lfv.1 for ; Sun, 03 Oct 2021 09:38:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=70lPd9tAEIoOlXHVxsV7QOW2c3rMXfZDuD1+aJfaaSg=; b=bJd9JjvZJKzujIVhhvttqcoABdEuQHt0UlLnNFOr4jhInGUOK7xO5Y6Y+M/Sodz1oQ G5XKXMQUqKMefFVIqVpSQ7sUsnPsM/ipaxylKuCjrvnopUGlq+9VOn3bt2GUh87YDC5z T4T32gKrtHu9ll6HjfcQDJ3cqt+XK1jKIQNOaC96BvC8uqEQx5VGZ9BCo4eDkG4Ys1Ul QLfqTeshb6dgZFzjfKf+cyV3Tl0LmA8k4LfoD8HM80wLnAAd0GjjcAHiobVZcwciYz6d 41HsgzSWlwAFFz9CU+ZjnCB5j1N6N+Zttnj1ZPYL5bFH5zHj0dfVKZ7lBCZLTFyYSJgT MArg== X-Gm-Message-State: AOAM532k1v3LK7+cyq5rfffc7A1656sJWQjuAtjihFwbMO9Dd+iNlJN/ ITEAbL+0P3DFMQu6rjbKBuhucGxkZbXPZBgEPmuDZOsUbOnx2A== X-Google-Smtp-Source: ABdhPJw0DyVPIxns6lOOeCz7HqhyLZGjj6slA/yMeQntiS9GQLX2TWk7QEcFSNXnNhtTg8euRMrnB+Y59Hdx70JAhMY= X-Received: by 2002:a2e:88ce:: with SMTP id a14mr10286291ljk.96.1633279097417; Sun, 03 Oct 2021 09:38:17 -0700 (PDT) MIME-Version: 1.0 From: Jacob Burkholder Date: Sun, 3 Oct 2021 09:38:06 -0700 Message-ID: Subject: unwind non-PC registers using elfutils To: elfutils-devel@sourceware.org X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2021 16:38:20 -0000 Hi, I'm trying to figure out how to unwind registers other than the PC using elfutils. I can use dwfl_module_register_names to get the register names, and then I'm trying to use dwarf_frame_register to get the register values for a given frame. I looked at the code in __libdwfl_frame_unwind and there's another example in addrcfi.c. dwarf_frame_register seems quite a low level dwarf API, I'm not sure how to use the ops that are returned, also the code used by __libdwfl_frame_unwind to evaluate the ops is all static or internal so not callable. Any guidance? Do I need to basically interpret the dwarf atoms in the ops returned by dwarf_frame_register? Any plans to make code like frame_unwind.c:expr_eval() used by frame_unwind.c:handle_cfi externally accessible?