GDB提供了强大的反汇编能力,本节就围绕于该主题而展开。
继续以Hello.c为例。
1 2 3 4 5 6 7 #include <stdlib.h> #include <stdio.h> int main( int argc, char ** argv) { printf ( "hello,world\n" ); return 0; }编译生成可执行文件
gcc -o hello -g hello.c用gdb载入进行调试
gdb hello反汇编main函数
disassemble main以下为输出内容:
Dump of assembler code for function main: 0x080483fc <+ 0 >: push