Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the GDB console in Eclipse CDT?

Is there a way how I can access gdb's console in Eclipse? I would like to just be able to set breakpoints with the mouse and then use the console for debugging.

like image 360
Nils Avatar asked Aug 02 '10 12:08

Nils


People also ask

How do I run a command in GDB?

Use the run command to start your program under GDB. You must first specify the program name (except on VxWorks) with an argument to GDB (see section Getting In and Out of GDB), or by using the file or exec-file command (see section Commands to specify files).

Does Eclipse use GDB?

In case you want to define a default configuration for gdb to be used in any Eclipse project, these are the steps to follow: Go to Eclipse > Preferences. From the left menu select C/C++ > Debug > GDB. Set GDB debugger to the full path of your gdb binary file (the same used for signing the certificate)

What command is used to start up GDB?

Use the run command to start your program under gdb. You must first specify the program name (except on VxWorks) with an argument to gdb (see Getting In and Out of gdb), or by using the file or exec-file command (see Commands to Specify Files).


2 Answers

You must click here enter image description here

Next select one with *gdb enter image description here

Now you can write GDB commands in console example:

enter image description here

like image 138
Dawid Avatar answered Sep 21 '22 06:09

Dawid


First of all, you need to install CDT plugin. Then, you can debug C++ application like Java application in Eclipse.

If you want gdb console, push 'Display Selected Console' in Console view in Debug perspective.

You can choose '[Your App name][C/C++ Application]gdb' entry, and then you can type gdb instruction(i.e. print this) in Console View.

like image 24
Huang Dongsung Avatar answered Sep 18 '22 06:09

Huang Dongsung