public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
To: elfutils-devel@sourceware.org
Subject: [PATCH] Setter for Dwfl's offline_next_address
Date: Fri,  1 Mar 2024 17:04:05 -0300	[thread overview]
Message-ID: <20240301200405.87966-1-yakoyoku@gmail.com> (raw)

Added a new function dwfl_set_offline_next_addres which will set said
field from the Dwfl struct. This is a requirement for listing functions
from their addresses when using libdwfl offline, otherwise wrong symbols
are going to be returned.

Signed-off-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
---
 libdwfl/libdwfl.h | 3 +++
 libdwfl/offline.c | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/libdwfl/libdwfl.h b/libdwfl/libdwfl.h
index 49ad6664..0ee12b58 100644
--- a/libdwfl/libdwfl.h
+++ b/libdwfl/libdwfl.h
@@ -109,6 +109,9 @@ extern int dwfl_errno (void);
 extern const char *dwfl_errmsg (int err);
 
 
+/* Set the next offline address.  */
+extern void dwfl_set_offline_next_address (Dwfl *dwfl, GElf_Addr addr);
+
 /* Start reporting the current set of segments and modules to the library.
    All existing segments are wiped.  Existing modules are marked to be
    deleted, and will not be found via dwfl_addrmodule et al if they are not
diff --git a/libdwfl/offline.c b/libdwfl/offline.c
index e9ab0cc1..f65486d3 100644
--- a/libdwfl/offline.c
+++ b/libdwfl/offline.c
@@ -35,6 +35,12 @@
 #include "libdwflP.h"
 #include <fcntl.h>
 
+void
+dwfl_set_offline_next_address (Dwfl *dwfl, GElf_Addr addr)
+{
+  dwfl->offline_next_address = addr;
+}
+
 /* Since dwfl_report_elf lays out the sections already, this will only be
    called when the section headers of the debuginfo file are being
    consulted instead, or for the section placed at 0.  With binutils
-- 
2.44.0


             reply	other threads:[~2024-03-01 20:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 20:04 Martin Rodriguez Reboredo [this message]
2024-03-02 20:47 ` Mark Wielaard
2024-03-02 22:43   ` Martin Rodriguez Reboredo
2024-03-03  0:05     ` Mark Wielaard
2024-03-03  0:29       ` Martin Rodriguez Reboredo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240301200405.87966-1-yakoyoku@gmail.com \
    --to=yakoyoku@gmail.com \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).