[PATCH] Setter for Dwfl's offline_next_address

Martin Rodriguez Reboredo yakoyoku@gmail.com
Sat Mar 2 22:43:38 GMT 2024


Oh hi Mark!

On 3/2/24 17:47, Mark Wielaard wrote:
> Hi Martin,
> 
> On Fri, Mar 01, 2024 at 05:04:05PM -0300, Martin Rodriguez Reboredo wrote:
>> 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.
> 
> Could you give an example or testcase for this?

This is intended for the Linux kernel perf tool so you might see it in
action when I publish the changes. In regards to testing I thought that
it was not needed due to the patch being a simple setter, but as
requested I can think something in the lines of.

     int
     main (int argc, char **argv)
     {
       Dwfl *dwfl = dwfl_begin (&offline_callbacks);
       assert (dwfl != NULL);

       if (dwfl->offline_next_address != OFFLINE_REDZONE)
         {
           dwfl_end (dwfl);
           return 1;
         }

       int result = 0;
       dwfl_set_offline_next_address (dwfl, 0);
       if (dwfl->offline_next_address != 0)
               result = 1;

       dwfl_end (dwfl);

       return result;
     }

But this will require libdwflP.h to be included, maybe if I add a getter
too it'd remedy it. Thoughts?

> 
> Thanks,
> 
> Mark


More information about the Elfutils-devel mailing list