objdump gcc Assembly debug筆記
gcc -s xxxx 可以篇成組合語言
gcc -g xxxx 之後可以用
objdump -S a.out 看到組語、C code
遇到要debug kernel panic時很好用! :)
example:
[carlos@localhost testC]$ objdump -S ./a.out
./a.out: file format elf32-i386
080483d4:
int func1()
{
80483d4: 55 push %ebp
80483d5: 89 e5 mov %esp,%ebp
80483d7: 83 ec 08 sub $0x8,%esp
printf("WAT WAT WAT \n");
80483da: c7 04 24 10 85 04 08 movl $0x8048510,(%esp)
80483e1: e8 02 ff ff ff call 80482e8
}
80483e6: c9 leave
80483e7: c3 ret
gcc -g xxxx 之後可以用
objdump -S a.out 看到組語、C code
遇到要debug kernel panic時很好用! :)
example:
[carlos@localhost testC]$ objdump -S ./a.out
./a.out: file format elf32-i386
080483d4
int func1()
{
80483d4: 55 push %ebp
80483d5: 89 e5 mov %esp,%ebp
80483d7: 83 ec 08 sub $0x8,%esp
printf("WAT WAT WAT \n");
80483da: c7 04 24 10 85 04 08 movl $0x8048510,(%esp)
80483e1: e8 02 ff ff ff call 80482e8
}
80483e6: c9 leave
80483e7: c3 ret
留言