ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
platform_binary_match_t Struct Reference

Find which binary(ies) contain a given address. More...

#include <include/ascii-chat/os/system.h>

Data Fields

char path [4096]
uintptr_t symbolizer_address
bool relative_address

Detailed Description

Find which binary(ies) contain a given address.

Platform-independent interface to scan the runtime memory map and find which loaded binary owns a given address. Used by backtrace symbol resolution to map runtime addresses to binaries, which are then passed to llvm-symbolizer or addr2line for function name lookup.

Implementations:

  • Linux: Scans /proc/self/maps to find executable segments
  • macOS: Iterates dyld-loaded images
  • Windows: Enumerates process modules via EnumProcessModules()
Parameters
addrRuntime address to look up
matchesOutput array to populate with matches (can be NULL)
max_matchesMaximum number of matches to return
Returns
Number of matches found (0, 1, or rarely 2)
Note
Multiple matches are possible but rare (would indicate overlapping mapped regions, a configuration error).
Example:
int count = get_binary_file_address_offsets(backtrace_address, matches, 2);
for (int i = 0; i < count; i++) {
// Call llvm-symbolizer with matches[i].path and matches[i].symbolizer_address
printf("Address %p is in %s at symbolizer address %lx\n",
backtrace_address, matches[i].path, matches[i].symbolizer_address);
}
int get_binary_file_address_offsets(const void *addr, platform_binary_match_t *matches, int max_matches)
Find which binary(ies) contain a given address.
Definition system.h:793
uintptr_t symbolizer_address
Definition system.h:797

Definition at line 793 of file system.h.

Field Documentation

◆ path

char platform_binary_match_t::path[4096]

Path to the binary (exe, .so, dylib, DLL, etc.)

Definition at line 795 of file system.h.

◆ relative_address

bool platform_binary_match_t::relative_address

Whether symbolizer_address is relative to the image base

Definition at line 799 of file system.h.

◆ symbolizer_address

uintptr_t platform_binary_match_t::symbolizer_address

Address to pass to the symbolizer

Definition at line 797 of file system.h.


The documentation for this struct was generated from the following file: