哪位高手帮我看看这个linux下汇编程序的调试问题,谢谢。
时间:2011-02-21
来源:互联网
为什么这个程序没办法单步调试,我设置的断点是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)
(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
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28