mirror of
https://github.com/notwa/rc
synced 2024-11-05 00:29:02 -08:00
10 lines
390 B
Text
10 lines
390 B
Text
|
#!/usr/bin/env bash
|
||
|
# disassembles a function given its symbolic name.
|
||
|
function disf() {
|
||
|
local exe="${1:?first argument should be an unstripped executable}"
|
||
|
local symbol="${2:?second argument should be a function name}"
|
||
|
# note: relies on GNU sed: https://unix.stackexchange.com/a/78485
|
||
|
objdump -d -C --no-show-raw-insn "$exe" | sed '/<'"$symbol"'>:/,/^$/!d;//d'
|
||
|
}
|
||
|
disf "$@"
|