Skip to Content
C语言核心技术(原书第2版)
book

C语言核心技术(原书第2版)

by Peter Prinz, Tony Crawford
August 2017
Intermediate to advanced
798 pages
17h 44m
Chinese
China Machine Press
Content preview from C语言核心技术(原书第2版)
使用
GDB
调试
C
程序
|
743
使用
GDB
调试
C
程序
3.
如果当前目录不是系统的
home
目录,并且如果当前目录包含一个初始化文件,则
GDB
会执行该文件内命令。通常当前目录包含一个开发中程序的相关文件,并且本
地的初始化文件
.gdbinit
包含一些用于配置调试器的命令,以满足程序特殊需求。
4.
最后,
GDB
执行在
-x
或
-command
选
项中被指定的命令文件。
GDB
同样可以通过下面命令行选项,跳过任何
.gdbinit
文件:
-nx
、
-n
指示
GDB
忽略所有的初始化文件。该选项不需要参数。
21.4 使用GDB命令
在启动时,调试器会提示输入命令。例如,设定断点,以及运行在命令行所指示的被调
试程序。
指示
GDB
执行的每个命令都是以一个命令关键字开始的文本行。除了关键字,命令行以
外余下的部分就是该命令的参数。你可以截断任何关键字,只要能保证键入的关键字长
度足够清楚将其与其他关键字区别。例如,可以输入
q
(或
qu
、
qui
)来表示
quit
命令,
它们都可以使得调试器退出。
如果输入一个空命令行(也就是说,如果在
GDB
命令提示符的后面直接按下回车键),
那么
GDB
会重复执行上一个命令,只要该动作看似合理。例如,
GDB
会自动地重复执行
step
和
next
命令,但是不会自动重复执行
run
命令。
如果输入一个不清楚或未知的命令缩写,或者没有提供适当的命令参数,
GDB
会发出适
当的错误信息,如下面所示:
(gdb) sh
Ambiguous command "sh": sharedlibrary, shell, show.
21.4.1 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

算法精讲视频课程:24篇系列讲座

算法精讲视频课程:24篇系列讲座

罗伯特·塞奇威克, 凯文·韦恩(Kevin Wayne)

Publisher Resources

ISBN: 9787111562207