Linux环境汇编语言编程初步——使用gdb调试程序(转)[@more@]调试是编写程序中一个永恒的话题,除非你的程序永远没有错误。本文介绍Linux下如何使用gdb调试汇编程序:
gdb(GNU Debugger)是一款功能非常强大的调试器,它的GUI版本叫做Kdbg,运行于KDE桌面环境。很多Linux发行版默认含有gdb
例子程序:
程序中-start:标签后加上nop语句是为了在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/,如需转载,请注明出处,否则将追究法律责任。
上一篇:
Linux下备份恢复技术的应用(转)
![]()
请登录后发表评论
登录
全部评论
<%=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%>
还有<%=items[i].items.total-5%>条评论
) data-count=1 data-flag=true>点击查看
<%}%>
|
转载于:http://blog.itpub.net/10617731/viewspace-959714/