I\'ve got a binary installed on my system, and would like to look at the disassembly of a given function. Preferrably using objdump, but other solutions would b
./dasmComplete symbol names to this solution (D lang version):
dasm test and then pressing TabTab, you will get a list of all functions. dasm test m and then pressing TabTab all functions starting with m will be shown, or in case only one function exists, it will be autocompleted.File /etc/bash_completion.d/dasm:
# bash completion for dasm
_dasm()
{
local cur=${COMP_WORDS[COMP_CWORD]}
if [[ $COMP_CWORD -eq 1 ]] ; then
# files
COMPREPLY=( $( command ls *.o -F 2>/dev/null | grep "^$cur" ) )
elif [[ $COMP_CWORD -eq 2 ]] ; then
# functions
OBJFILE=${COMP_WORDS[COMP_CWORD-1]}
COMPREPLY=( $( command nm --demangle=dlang $OBJFILE | grep " W " | cut -d " " -f 3 | tr "()" " " | grep "$cur" ) )
else
COMPREPLY=($(compgen -W "" -- "$cur"));
fi
}
complete -F _dasm dasm