X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Fso-info.h;h=17d0f59cfd278e6ed61e3bf87a860190e04fe2d2;hp=7badeb2fa43940e4b4cd5e37670866831db06f2d;hb=dc419b6cc12d26c840d29440d5077f0a29221952;hpb=e362dc9319fe4863cf6d60ac41f8779807b7fbce diff --git a/include/babeltrace/so-info.h b/include/babeltrace/so-info.h index 7badeb2f..17d0f59c 100644 --- a/include/babeltrace/so-info.h +++ b/include/babeltrace/so-info.h @@ -192,6 +192,25 @@ int so_info_lookup_function_name(struct so_info *so, uint64_t addr, BT_HIDDEN int so_info_lookup_source_location(struct so_info *so, uint64_t addr, struct source_location **src_loc); +/** + * Get a string representing the location within the binary of a given + * address. + * + * In the case of a PIC binary, the location is relative (+0x1234). + * For a non-PIC binary, the location is absolute (@0x1234) + * + * On success, the out parameter `bin_loc` is set. The ownership is + * passed to the caller. On failure, `bin_loc` remains unchanged. + * + * @param so so_info instance for the executable containing + * the address + * @param addr Virtual memory address for which to find the + * binary location + * @param bin_loc Out parameter, the binary location + * @returns 0 on success, -1 on failure + */ +BT_HIDDEN +int so_info_get_bin_loc(struct so_info *so, uint64_t addr, char **bin_loc); /** * Destroy the given source_location instance