]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwfl: add dwfl_thread_ebl users/serhei/eu-stacktrace.v1
authorSerhei Makarov <serhei@serhei.io>
Thu, 27 Feb 2025 19:38:55 +0000 (14:38 -0500)
committerSerhei Makarov <serhei@serhei.io>
Thu, 27 Feb 2025 19:46:01 +0000 (14:46 -0500)
Exposing the Ebl * here allows libdwfl users to access the
ebl_set_initial_regs_sample callback for a given process.

* libdw/libdw.map: Add dwfl_thread_ebl.
* libdwfl/dwfl_frame.c (dwfl_thread_ebl): New function.
* libdwfl/dwfl_frame.c (dwfl_thread_ebl): New function.

libdw/libdw.map
libdwfl/dwfl_frame.c
libdwfl/libdwfl.h

index ce990a09e989091b7a3641f8299606b26b7bd76d..a8241a2903387d4fc7ae861f46739e1642b2f8ef 100644 (file)
@@ -393,4 +393,5 @@ ELFUTILS_0.193 {
     dwfl_process_tracker_end;
     dwfl_process_tracker_find_elf;
     dwfl_process_tracker_find_pid;
+    dwfl_thread_ebl;
 } ELFUTILS_0.192;
index 1e715346f8eeb1eb863f69de7c628090028e735d..46b16b3a3adf7461617cd47997139230068af347 100644 (file)
@@ -239,6 +239,12 @@ dwfl_thread_dwfl (Dwfl_Thread *thread)
 }
 INTDEF(dwfl_thread_dwfl)
 
+Ebl *
+dwfl_thread_ebl (Dwfl_Thread *thread)
+{
+  return thread->process->ebl;
+}
+
 pid_t
 dwfl_thread_tid (Dwfl_Thread *thread)
 {
index 16b351cf7e8e7344b93f24c5a8f00b51ff7cb4cf..1092d2e1bad93d1c4d26ab888af42819ff39769f 100644 (file)
@@ -30,6 +30,7 @@
 #define _LIBDWFL_H     1
 
 #include "libdw.h"
+#include "libebl.h"
 #include <stdio.h>
 
 /* Handle for a session using the library to attach to a single target process.  */
@@ -786,6 +787,10 @@ pid_t dwfl_pid (Dwfl *dwfl)
 Dwfl *dwfl_thread_dwfl (Dwfl_Thread *thread)
   __nonnull_attribute__ (1);
 
+/* Return EBL associated with THREAD.  This function never fails.  */
+Ebl *dwfl_thread_ebl (Dwfl_Thread *thread)
+  __nonnull_attribute__ (1);
+
 /* Return positive TID (thread ID) for THREAD.  This function never fails.  */
 pid_t dwfl_thread_tid (Dwfl_Thread *thread)
   __nonnull_attribute__ (1);