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
程序
|
753
使用
GDB
调试
C
程序
continue [
passes
]
、
c [
passes
]
允许程序执行直到下一个断点时停止,如果后面没有断点,就让程序执行到退出。
passes
参数是一个数字,它指示当前的断点被忽略多少次才后再次被
GDB
中断。如
果程序当前的断点在循环内,这个方式非常有用。实现同样的功能,请同时参考前
面
21.4.6
节的
ignore
命令。
step [
lines
]
、
s [
lines
]
执行程序当前的这一行代码,但在执行下一行之前再次停下来。
step
命令有可选参
数,该参数是正数,代表要执行多少行之后再次被
GDB
中端。然而,如果在执行完
所指定代码行之前先遇到断点,程序还是会被中断的。如果使用这种方法进行调试
过程中遇到函数调用,并且该函数具有调试可用的符号表和行号信息,那么
step
将
指示进入函数内部,并在函数内第一行代码处停下来。许多开发工具把这样的做法
称为单步跳入(
step in
)。
next [
lines
]
、
n [
lines
]
与
step
工作方式一样,但是遇到函数调用时,
next
不会跟踪进入函数内,而是直接
把整个函数执行完,它把函数调用作为一个简单的语句,即便必须的调试信息表示
单步通过函数。
finish
如果想继续执行到当前的函数结束,则应该使用
finish
命令。该命令允许程序继续执
行到当前的函数结束,然后在程序流将控制权交回到该函数的调用者时停止。在当
前位置上,
GDB
会显示该函数的返回值,以及下一行语句。
请记住,程序的这些行并非总是依照源代码中出现的次序来执行,例如,下面是一个计 ...
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