Perl Disassembly plugin for Devel::Trepan via B::Concise
This adds a disassemble command to the Devel::Trepan debugger.
disassemble [options] [subroutine|package-name ...]
options: -concise -terse -linenoise -debug -compact -exec -tree -loose -vt -ascii
Use B::Concise to disassemble a list of subroutines or a packages. If no subroutine or package is specified, use the subroutine where the program is currently stopped.
$ trepan.pl -e 1 (trepanpl): dissassemble Package Main main program: => LISTOP (0xa0dd208) op_next 0 op_sibling 0 op_ppaddr PL_ppaddr[OP_LEAVE] op_type 185 op_flags 13 op_private 64 op_first 0xa0e6f60 op_last 0xa0e7298 OP (0xa0e6f60) op_next 0xa0dd228 op_sibling 0xa0dd228 op_ppaddr PL_ppaddr[OP_ENTER] op_type 184 op_flags 0 op_private 0 # 1: -src not supported for -e COP (0xa0dd228) op_next 0xa0dd208 op_sibling 0xa0e7298 op_ppaddr PL_ppaddr[OP_DBSTATE] op_type 182 op_flags 1 op_private 0 256 OP (0xa0e7298) op_next 0xa0dd208 op_sibling 0 op_ppaddr PL_ppaddr[OP_NULL] op_type 0 op_flags 1 op_private 0
Above, the => indicates the next instruction to run.
=>
By default disasm is an alias for disassemble. Here is the -tree option; --tree is okay too.
-tree
--tree
(trepanpl): disasm -tree main program: 0xa0dd208-+-0xa0e6f60 |-# 1: -src not supported for -e 0xa0dd228 `-0xa0e7298
Finally, functions can be given
(trepanpl): disasm -basic File::Basename::basename File::Basename::basename: UNOP (0x8ad1d00) op_next 0 op_sibling 0 op_ppaddr PL_ppaddr[OP_LEAVESUB] op_type 174 ...
Add support for -e via trepan.pl's temporary file renaming.
-e
Rocky Bernstein
Copyright (C) 2012 Rocky Bernstein <rocky@cpan.org>
This program is distributed WITHOUT ANY WARRANTY, including but not limited to the implied warranties of merchantability or fitness for a particular purpose.
The program is free software. You may distribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation (either version 2 or any later version) and the Perl Artistic License as published by O'Reilly Media, Inc. Please open the files named gpl-2.0.txt and Artistic for a copy of these licenses.
To install Devel::Trepan::Disassemble, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::Trepan::Disassemble
CPAN shell
perl -MCPAN -e shell install Devel::Trepan::Disassemble
For more information on module installation, please visit the detailed CPAN module installation guide.