使用GDB调试有关汇编代码的问题

时间:2018-11-17 19:48:15

标签: debugging gdb

我尝试使用gdb调试汇编代码,但收到错误消息,提示:

(gdb) run Starting program: /root/assembler_program/bsawp.o
/bin/bash: /root/assembler_program/bsawp.o: cannot execute binary file

代码:

.section .text
.globl _start
_start:
nop
movl 0x12345678 ,  %ebx
bswap %ebx    
movl $1 , %eax
int $0x80

然后我使用gdb:

(gdb) break *_start+1
Breakpoint 1 at 0x400079
(gdb) run
Starting program: /root/assembler_program/bsawp

Breakpoint 1, 0x0000000000400079 in _start ()
(gdb) step
Single stepping until exit from function _start,
which has no line number information.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000400079 in _start ()

能否请您提供任何提示和建议?

谢谢! 最好的问候

0 个答案:

没有答案