Talk gdb together (first time: gdb introduction)

Source: Internet
Author: User


Everyone crossing, from today onwards, we talk about the large-scale couplet science fiction: GDB. Gossip Hugh, words return to the positive. Let's have a

Talk to GDB!


Crossing, we often say that GdB is a nickname, and its real name is: the GNU Project Debugger. Chinese is called the GNU program.

Debugger. Like GCC, because the nickname is so famous, everyone calls it that. GdB was born in the 80 's and is also a

A typical Gen Y. It and GCC are brothers, as to who is elder brother, who is younger brother, I also not clear, haha. But one thing is to be willing to

The father is also an American Richard Stallman. But it's no niang, poor child.


When we compile the program, we often debug the wrong program, and as an excellent debugger, GDB is famous for its powerful features, and it

has become the default program debugger in various Linux distributions. such as Ubuntun,readhat,bsd and so on. So to speak, as long as

There is a gcc where there is gdb, is the so-called war brothers. Like GCC, GDB is open source, so you can use it freely.

By the time this blog was published, the latest version of GDB was 7.9.1 (released in 2015.05.13) and it was constantly evolving and upgrading.


The program Debugger DDB is an open-source C/s + + debugger that needs to be used with GCC because it requires GCC to write debug information for it. and GCC

, it is also manipulated by the command line. But now there is a graphical version of it: Xxxgdb.


Crossing, we've talked so much, let's get a glimpse of GdB's hosting first. We used the Mint system with the default installation of GDB (V7.7), the first

Open the terminal first, and then enter GDB in the terminal to enter the software, open will have some brief description of the software. Hey, there's crossing under the table.

Sigh, it is estimated that GDB did not think of the beautiful bar. This crossing, can't judge by appearances, haha. Enter help at the terminal prompt

You can see the common GDB commands, and you can see more GDB commands by entering help all. Enter Q to exit GDB.


Crossing who have used the debugger should be aware of common debugging features:

    • Set breakpoints
    • Stepping through the program
    • View the value of a variable
    • Change the execution environment of the program

All of these features are supported by GDB, and each feature allows us to achieve the ultimate. about how to use these features to debug a program, we

In the back of the chapter back to explain in detail.


Crossing, here's what we're going to say about GDB today. Want to know how to funeral, and listen to tell!


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Talk gdb together (first time: gdb introduction)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.