Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » no debugging of C++ programs on linux?
no debugging of C++ programs on linux? [message #200291] Sat, 25 August 2007 22:52 Go to next message
Nick Schweyer is currently offline Nick SchweyerFriend
Messages: 175
Registered: July 2009
Senior Member
hi,

I am just beginning to work with Eclipse and CDT.
My problem is that I cannot debug my C++-program. Everything seems to be
ok, i.e. I can compile and run the program. But when I want to debug it
the debugger (gdb) does not stop at breakpoints. The program runs just as
if there were no breakpoints. There is no error message.

I tried it with two configurations with the same problem
- openSuse10.1, Eclipse 3.1.1, CDT 3.0.2, Qt4 library for GUI
- openSuse10.2. Eclipse 3.2.1, CDT 3.1.1, Qt4 library for GUI

With a C-program the debugger is working as expected.

Tips are very welcome - without debugging programming is very tedious.

Nikosch


Niko

Eclipse-CDT Version: 2019-12 (4.14.0), Win10 64bit
Re: no debugging of C++ programs on linux? [message #200349 is a reply to message #200291] Mon, 27 August 2007 18:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: spam.noway.com

On Sat, 25 Aug 2007 22:52:34 +0000, nikosch wrote:

> hi,
>
> I am just beginning to work with Eclipse and CDT.
> My problem is that I cannot debug my C++-program. Everything seems to be
> ok, i.e. I can compile and run the program. But when I want to debug it
> the debugger (gdb) does not stop at breakpoints. The program runs just as
> if there were no breakpoints. There is no error message.
>
> I tried it with two configurations with the same problem
> - openSuse10.1, Eclipse 3.1.1, CDT 3.0.2, Qt4 library for GUI
> - openSuse10.2. Eclipse 3.2.1, CDT 3.1.1, Qt4 library for GUI
>
> With a C-program the debugger is working as expected.
>
> Tips are very welcome - without debugging programming is very tedious.
>
> Nikosch

What are the debugging flags that are being passed to GCC?

C++ debugging works without a problem on my Project, Eclipse 3.3 CDT 4.0
though. You may want to consider giving that a try, it's well worth it. =)

--
Stephan
2003 Yamaha R6

君のこと思い出す日なんてないのは
君のこと忘れたときがないから
Re: no debugging of C++ programs on linux? [message #200365 is a reply to message #200349] Mon, 27 August 2007 20:15 Go to previous messageGo to next message
Nick Schweyer is currently offline Nick SchweyerFriend
Messages: 175
Registered: July 2009
Senior Member
Stephan Rose wrote:

> What are the debugging flags that are being passed to GCC?


Where shall I set debugging flags? -> newcomer :-(

My run configuration:
tab Debugger:
Debugger: 'GDB'
Debugger Options
tab main:
GDB Debugger: 'gdb'
GDB Command File: this field is empty; set here debugging flags?
tab Shared Libraries:
hook in front of "Load shared library symbols automatically"
tab Source:
Source Lookup Path:
'Default' (has a folder-icon)
'PC_Simulation' (has a folder-icon, my application)
'.settings-/ PC_Simulation' (has a folder-icon)
tab Common:
Save as: local file
Display in favourite menue
hook in front of "Run"
hook in front of "Debug"
Standard Input and Output
hook in front of "Allocate Console"
hook in front of "launch in background"

My Debug configuration:
tab Debugger:
Debugger: 'GDB Debugger'
hook in front of "stop at main() on startup
tab main:
GDB Debugger: 'gdb'
GDB Command File: this field is empty; set here debugging flags?
tab Shared Libraries:
hook in front of "Load shared library symbols automatically"
tab Source and tab Common: same as in Run configuration

My make-file does not contain any 'debug'. It is generated by a utility,
qmake, which is part of QT4.2.3. QT is a nice library for building GUIs.

Note: I wrote in my posting that there is no error message. Really there
is one in the console: "no source file named pcsimu.cpp"
pcsimu.cpp is the C++ file where I had set a breakpoint.
Who does not find the file? Eclipse knows it because in the debugging
perspective the file pcsimu.cpp is displayed and the line with the
breakpoint is marked automatically.

The Source Lookup Path is conspicuous to me, see above.
A folder 'Default' is not existing in my directory tree but a folder
'PC_Simulation' is existing.
Now I tried to add the folder 'PC_Simulation' to the Source Lookup Path
with the following problem:
- clicking 'add' in "Run configuration / tab Source / Source Lookup Path"
- selecting 'Workspace Folder'
- selecting 'PC_Simulation' which is the only choice, disables the
OK-Button with the hint "selection must be a folder". But 'PC_Simulation'
is a folder.

What is wrong?

Nikosch


Niko

Eclipse-CDT Version: 2019-12 (4.14.0), Win10 64bit
Re: [solved]no debugging of C++ programs on linux? [message #200574 is a reply to message #200365] Tue, 28 August 2007 19:25 Go to previous message
Nick Schweyer is currently offline Nick SchweyerFriend
Messages: 175
Registered: July 2009
Senior Member
Now it is clear:
The debugging info from compilation was missing (gcc -g).
As a newcomer I expected that the debug configuration of eclipse is
handling the correct compilation with debugging info. But eclipse is not
responsible for the make file. It is Qt which generates it, and there is
the place where to do the necessary settings.
O dear, it was a hard way. But now it works.

Nikosch


Niko

Eclipse-CDT Version: 2019-12 (4.14.0), Win10 64bit
Previous Topic:CDT Cgywin debugger can't find source under Eclipse 3.2
Next Topic:How to start C project under Vista with Eclipse?
Goto Forum:
  


Current Time: Sat Aug 17 13:16:49 GMT 2024

Powered by FUDForum. Page generated in 0.02897 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top