- 1、本文档共43页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
GDB调试工具的使用方法
This is a test GDB调试工具的使用方法 周鸣 GDB的介绍 GDB的安装和使用 GDB的使用帮助说明 GDB的基本使用 GDB使用技巧 GDB的介绍 GDB可以运行在不同的操作系统上,下面以Linux操作系统为例来说明一下安装方法: 1、首先要安装gcc。 2、在安装gdb的rpm包。 3、设置gdb的path,一般gdb安装后会在/usr/bin目录下,只要指定PATH=/usr/bin即可。 4、在任何路径下执行gdb就可以运行了。 在gdb执行后,就可以运行命令了,输入help命令后,显示如下: List of classes of commands: aliases -- Aliases of other commands breakpoints -- Making program stop at certain points data -- Examining data files -- Specifying and examining files internals -- Maintenance commands obscure -- Obscure features running -- Running the program stack -- Examining the stack status -- Status inquiries support -- Support facilities tracepoints -- Tracing of program execution without stopping the program user-defined -- User-defined commands 执行help aliases后,就会显示如下: delete breakpoints -- Delete some breakpoints or auto-display expressions disable breakpoints -- Disable some breakpoints ni -- Step one instruction si -- Step one instruction exactly stepping -- Specify single-stepping behavior at a tracepoint tp -- Set a tracepoint at a specified line or function or address where -- Print backtrace of all stack frames ws -- Specify single-stepping behavior at a tracepoint 以上是gdb一些命令的别名 执行help breakpoints后,显示如下: break -- Set breakpoint at specified line or function catch -- Set catchpoints to catch events watch -- Set a watchpoint for an expression clear -- Clear breakpoint at specified line or function delete -- Delete some breakpoints or auto-display expressions disable -- Disable some breakpoints enable -- Enable some breakpoints 以上是gdb设置断点的一些基本命令,还有一些命令没有在这里描述。 执行help data后,显示如下: call -- Call a function in the program print -- Print value of expression EXP whatis -- Print data type of expression EXP 以上是gdb 数据命令的几条常用命令,还有很多没有在此描述。 执行help files命令后,显示如下: add-shared-symbol-files -- Load the symbols from shared objects in the dynamic linkers link map cd -- Set working directory to DIR for debugger and program being debugged core-file -- Use FILE as core dump for examini
文档评论(0)