哪位高手帮我看看这个linux下汇编程序的调试问题,谢谢。

为什么这个程序没办法单步调试,我设置的断点是8,可我一运行他的结果就立马跑出来了,没法单步执行,那位高手帮我解决下吧,谢谢。

(gdb) list
1 #cpuid.s Sample program to extract the processor Vendor ID
2 .section .data
3 output:
4 .ascii "The processor Vendor ID is 'xxxxxxxxxxxx'\n"
5 .section .text
6 .globl _start
7 _start:
8 movl $0, %eax
9 cpuid
10 movl $output, %edi
(gdb) 
11 movl %ebx, 28(%edi)
12 movl %edx, 32(%edi)
13 movl %ecx, 36(%edi)
14 movl $4, %eax
15 movl $1, %ebx
16 movl $output, %ecx
17 movl $42, %edx
18 int $0x80
19 movl $1, %eax
20 movl $0, %ebx
(gdb) 
21 int $0x80
(gdb) 
Line number 22 out of range; cpuid.s has 21 lines.
(gdb) break 8
Breakpoint 1 at 0x8048074: file cpuid.s, line 8.
(gdb) run 
Starting program: /home/heiying/testing/cpu 
The processor Vendor ID is 'GenuineIntel'

Program exited normally.
(gdb) 

作者: zhengyixiaohei   发布时间: 2011-02-21

虽然自认为写过很多汇编但是我从来不习惯用 gdb,只是喜欢眼睛看 :)

作者: linguranus   发布时间: 2011-02-21