public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug libdw/28579] New: libdwfl api for accessing registers for a thread frame (full register unwinding)
@ 2021-11-10 14:07 mark at klomp dot org
  2021-11-11 15:19 ` [Bug libdw/28579] " dichen at redhat dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mark at klomp dot org @ 2021-11-10 14:07 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=28579

            Bug ID: 28579
           Summary: libdwfl api for accessing registers for a thread frame
                    (full register unwinding)
           Product: elfutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libdw
          Assignee: unassigned at sourceware dot org
          Reporter: mark at klomp dot org
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

dwfl has most of the infrastructure to keep the full unwind state, including
the state of unwound registers per frame using Dwfl_Thread_Callbacks. But there
is no public API to access that state, except for the PC (dwfl_frame_pc).

There should be other methods on Dwfl_Frame to access other state.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libdw/28579] libdwfl api for accessing registers for a thread frame (full register unwinding)
  2021-11-10 14:07 [Bug libdw/28579] New: libdwfl api for accessing registers for a thread frame (full register unwinding) mark at klomp dot org
@ 2021-11-11 15:19 ` dichen at redhat dot com
  2021-11-11 15:20 ` dichen at redhat dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dichen at redhat dot com @ 2021-11-11 15:19 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=28579

Di Chen <dichen at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dichen at redhat dot com
           Assignee|unassigned at sourceware dot org   |dichen at redhat dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libdw/28579] libdwfl api for accessing registers for a thread frame (full register unwinding)
  2021-11-10 14:07 [Bug libdw/28579] New: libdwfl api for accessing registers for a thread frame (full register unwinding) mark at klomp dot org
  2021-11-11 15:19 ` [Bug libdw/28579] " dichen at redhat dot com
@ 2021-11-11 15:20 ` dichen at redhat dot com
  2022-07-03 14:58 ` dichen at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dichen at redhat dot com @ 2021-11-11 15:20 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=28579

Di Chen <dichen at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libdw/28579] libdwfl api for accessing registers for a thread frame (full register unwinding)
  2021-11-10 14:07 [Bug libdw/28579] New: libdwfl api for accessing registers for a thread frame (full register unwinding) mark at klomp dot org
  2021-11-11 15:19 ` [Bug libdw/28579] " dichen at redhat dot com
  2021-11-11 15:20 ` dichen at redhat dot com
@ 2022-07-03 14:58 ` dichen at redhat dot com
  2022-07-08 22:41 ` mark at klomp dot org
  2022-07-19 14:23 ` dichen at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: dichen at redhat dot com @ 2022-07-03 14:58 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=28579

--- Comment #1 from Di Chen <dichen at redhat dot com> ---
Created attachment 14193
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14193&action=edit
Submit a Patch for Bug 28579

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libdw/28579] libdwfl api for accessing registers for a thread frame (full register unwinding)
  2021-11-10 14:07 [Bug libdw/28579] New: libdwfl api for accessing registers for a thread frame (full register unwinding) mark at klomp dot org
                   ` (2 preceding siblings ...)
  2022-07-03 14:58 ` dichen at redhat dot com
@ 2022-07-08 22:41 ` mark at klomp dot org
  2022-07-19 14:23 ` dichen at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: mark at klomp dot org @ 2022-07-08 22:41 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=28579

--- Comment #2 from Mark Wielaard <mark at klomp dot org> ---
Thanks. This looks nice and simple. Few small comments:

- The dwfl_frame_reg should be in a new ELFUTILS_0.188 { global:
dwfl_frame_reg; } ELFUTILS_0.186; section (that is, this symbol is new in
ELFUTILS_0.188 which inherits from ELFUTILS_0.186).

- Technically __libdwfl_frame_reg_get failing can be either invalid register or
unknown value (if state->regs_set is false). It might make sense to set a
different error message if it isn't too much work.

- When using public functions internally we usually use INTUSE
(dwfl_frame_reg). Which is an tiny optimization to avoid a plt call. You'll
need an INTDECL in libdwflP.h.

- In the unwinder we are only really interested in addresses, which is why we
use Dwarf_Addr, but here I think we should use Dwarf_Word as the *val that
dwfl_frame_reg returns. Both are really uint64_t, so it doesn't really matter,
but it makes it more clear that the caller is responsible for interpreting the
register value.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libdw/28579] libdwfl api for accessing registers for a thread frame (full register unwinding)
  2021-11-10 14:07 [Bug libdw/28579] New: libdwfl api for accessing registers for a thread frame (full register unwinding) mark at klomp dot org
                   ` (3 preceding siblings ...)
  2022-07-08 22:41 ` mark at klomp dot org
@ 2022-07-19 14:23 ` dichen at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: dichen at redhat dot com @ 2022-07-19 14:23 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=28579

--- Comment #3 from Di Chen <dichen at redhat dot com> ---
Thank you Mark,

I have re-pushed a patch[1] for

1). add dwfl_frame_reg to ELFUTILS_0.188
2). add invalid regno check for dwfl_frame_reg
3). add INTDECL (dwfl_frame_reg)
4). Replace Dwarf_Word with Dwarf_Addr for *val

[1] https://sourceware.org/pipermail/elfutils-devel/2022q3/005206.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-07-19 14:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10 14:07 [Bug libdw/28579] New: libdwfl api for accessing registers for a thread frame (full register unwinding) mark at klomp dot org
2021-11-11 15:19 ` [Bug libdw/28579] " dichen at redhat dot com
2021-11-11 15:20 ` dichen at redhat dot com
2022-07-03 14:58 ` dichen at redhat dot com
2022-07-08 22:41 ` mark at klomp dot org
2022-07-19 14:23 ` dichen at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).