Linux环境汇编语言编程初步——使用gdb调试程序(转)

Linux环境汇编语言编程初步——使用gdb调试程序(转)[@more@]调试是编写程序中一个永恒的话题,除非你的程序永远没有错误。本文介绍Linux下如何使用gdb调试汇编程序:

gdb(GNU Debugger)是一款功能非常强大的调试器,它的GUI版本叫做Kdbg,运行于KDE桌面环境。很多Linux发行版默认含有gdb

例子程序:
程序中-start:标签后加上nop语句是为了在gdb中能够暂停程序
CODE:
#cpuid.s Sample program

.section .data

output:
.ascii "The processor Vendor ID is 'xxxxxxxxxxxx' "

.section .text
.globl _start

_start:

nop //gdb中暂停程序用

movl $0, %eax

cpuid

movl $output, %edi

movl %ebx, 28(%edi)

movl %edx, 32(%edi)

movl %ecx, 36(%edi)

movl $4, %eax

movl $1, %ebx

movl $output, %ecx

movl $42, %edx

int $0x80

movl $1, %eax

movl $0, %ebx

int $0x80

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10617731/viewspace-959714/,如需转载,请注明出处,否则将追究法律责任。

user_pic_default.png
请登录后发表评论 登录
全部评论
<%=items[i].createtime%>

<%=items[i].content%>

<%if(items[i].items.items.length) { %>
<%for(var j=0;j
<%=items[i].items.items[j].createtime%> 回复

<%=items[i].items.items[j].username%>   回复   <%=items[i].items.items[j].tousername%><%=items[i].items.items[j].content%>

<%}%> <%if(items[i].items.total > 5) { %>
还有<%=items[i].items.total-5%>条评论 ) data-count=1 data-flag=true>点击查看
<%}%>
<%}%> <%}%>

转载于:http://blog.itpub.net/10617731/viewspace-959714/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值