| Copyright | (c) 2026 Jared Tobin |
|---|---|
| License | MIT |
| Maintainer | Jared Tobin <jared@ppad.tech> |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Vestigia.Symbol
Description
Naming an instruction by its source: an addr2line over an object's debug information, inlined frames included, at the instruction's address in the object (where the object's program headers place it, as its disassembly does). LLVM's names each inlined frame by its own function, and an address no symbol covers by none, where binutils' gives the innermost frame the name of the function it was inlined into, and code without debug information (a GHC program's) the name of whatever function precedes it. LLVM leaves a legacy Rust symbol as an Itanium demangler does, its escapes and hash in place, which are undone here.
Documentation
One frame of a source location: the function and, where the debug information has it, the file and line. The innermost frame comes first.
symbolize :: FilePath -> [(Text, Integer)] -> IO (Map (Text, Integer) [Place]) Source #
The source of each address, per object, by one addr2line call per object. An object addr2line cannot read names nothing.
parseAddr2line :: Text -> [(Integer, [Place])] Source #
addr2line's output under -a -f -i: an address line, then a
function line and a location line per frame.
>>>parseAddr2line "0x20\n??\n??:0\n"[(32,[Place Nothing Nothing Nothing])]
rustLegacy :: Text -> Text Source #
A legacy Rust symbol, as an Itanium demangler leaves it, as rustc-demangle gives it: its hash dropped, each path segment's escapes undone. Any other name is left as it is.
>>>rustLegacy "a::_$LT$impl$u20$b..C$GT$::f::h346fee1681a4f34f""a::<impl b::C>::f"