Open ishitatsuyuki opened 3 months ago
wholesym
has library_info_for_binary_at_path
, but it's async.
In https://github.com/mstange/samply/pull/141/commits/2bcbdf1667ea3f9b4248100894865d3246e06760 we're duplicating this code into the samply package (but with sync IO). Once that PR lands we can move it to samply/src/shared and use it in the Linux converter.
The Linux backend currently assumes that files have a debug_name equivalent to name (and likewise for name): https://github.com/mstange/samply/blob/5bf04b01ff1f564ed20bdc4b60d7baa94cbe03cd/samply/src/linux_shared/converter.rs#L1451-L1460
This assumption is valid for ELF, but not for PE (e.g. binaries running on Wine). PE binaries would get the wrong debug_name which will:
load_symbol_map_for_pdb_corresponding_to_binary
, which only looks forPdbFilename
(debug_path
), and does not resolvedirname(path) + debug_name
. The former is usually a path on the build machine, so if the file is redistributed it does not resolve.debug_id_for_object
helper.We already have a helper in wholesym to determine the correct debug_ids, so we should probably extend the helper to the entire
LibraryInfo
.