0.5.0 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform
Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.
MIT - MIT LicenseResolves symbols for dynamic code generated by a JIT via a map file.
var resolveJITSymbols = require('resolve-jit-symbols');
var map = fs.readFileSync(__dirname + '/test/fixtures/jit.map', 'utf8')
var resolver = resolveJITSymbols(map);
var res = resolver.resolve('0x38852ffd485a');
console.log(res);
{ address : '38852ffd4640',
size : '54c',
decimalAddress : 62144686933568,
symbol : 'LazyCompile : *go' }
cat test/fixtures/callgraph.csv | rjs test/fixtures/jit.map
npm install resolve-jit-symbols
# Supply path to map file
cat callstack.csv | rjs /tmp/<perf-*.map>
# Or pid of process whose map file to use (resolved from /tmp/perf-<pid>.map)
cat callstack.csv | rjs <pid>
Any tool that can generate the format described here will work.
With Node.js >=v0.11.15
do the following:
node --perf-basic-prof your-app.js
This will create a map file at /tmp/perf-<pid>.map
.
RegExp used to match memory addresses.
RegExp used to match memory lldb backtraces of the form #1 0x001 in 0x001 ()
When calling var m = s.match(regex)
m[1]
contains first matched address and m[2]
contains second matched address.
Instantiates a JIT resolver for the given map.
Name | Type | Description |
---|---|---|
map |
String | Array.<String> | either a string or lines with space separated HexAddress, Size, Symbol on each line |
the initialized JIT resolver
Matches the address of the symbol of which the given address is part of.
Name | Type | Description |
---|---|---|
hexAddress |
String | Number | the hexadecimal address of the address to check |
info of the matching symbol which includes address, size, symbol
Resolves all symbols in a given stack and replaces them accordingly
Name | Type | Argument | Description |
---|---|---|---|
stack |
Array.<String> | String | string of stack or lines of stack |
|
getHexAddress |
function |
<optional> |
allows overriding the function used to find a hex address on each line, returns |
the stack with symbols resolved in the same format that the stack was given, either as lines or one string
generated with docme
MIT