Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » GDB Console Not Working(The gdb console was once accessible for direct interaction with gdb)
icon9.gif  GDB Console Not Working [message #644961] Wed, 15 December 2010 01:06 Go to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
Hi,

A few versions ago I was running CDT 6 (6? Pre 7.0 anyway) on Eclipse Ganymede on Ubuntu 10.04. Debugging my C++ app was workable. I found that I could select the gdb node under the 'Debug' tab and interact with gdb directly. In some cases I find it easier, and for calling simple methods on objects I know of no other technique. The interface was a bit clumsy but adequate.

Now I have moved to CDT 7.0 on Eclipse Helios. The DSF is great. But the gdb console mode no longer works. Is this an intentional change? Or is there something wrong with my configuration? Is there another technique for calling methods?

By the way, I'm not an Eclipse guru. I have never developed a plugin and the plugin development guides I have stumbled across while looking for an answer look like double dutch.

Thanks.
J.



Re: GDB Console Not Working [message #644963 is a reply to message #644961] Wed, 15 December 2010 01:30 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
The GDB console should still work with DSF-GDB. There are a couple of features missing like setting a breakpoint from the console, but overall you should be able to use it.

Which operation is not working?

Marc
Re: GDB Console Not Working [message #644967 is a reply to message #644963] Wed, 15 December 2010 01:50 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
In this case I'm just trying to print a variable. i.e.

~console~

p some_variable

~console~

I don't get any result. I get the impression that the console is not connected to the gdb instance i.e. there is no delay after pressing return - there is no sign of any processing going on.
Re: GDB Console Not Working [message #644969 is a reply to message #644967] Wed, 15 December 2010 02:22 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
I just tried it and it works for me.
Are you sure you are typing inside the gdb console and not inside the program console?

Marc
Re: GDB Console Not Working [message #644971 is a reply to message #644969] Wed, 15 December 2010 02:30 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
Fair call. Pretty sure though. I used to use this functionality in my earlier configuration (and I taught someone else how to do it).

I was hoping to upload a picture so you could confirm my sanity. I can't see an option in this reply window. Maybe I can email you.
Re: GDB Console Not Working [message #644975 is a reply to message #644971] Wed, 15 December 2010 02:39 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
Thanks for your help by the way. I have been google-ing for a while and can't find anything. I'm hoping it's something in my debug configuration.
Re: GDB Console Not Working [message #644984 is a reply to message #644969] Wed, 15 December 2010 05:36 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
See screenshot: http://tinypic.com/view.php?pic=kajqy0&s=7
Re: GDB Console Not Working [message #644988 is a reply to message #644984] Wed, 15 December 2010 06:13 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
It just started working. I have no idea why. Someone came by and I showed it to them ... and it started working.

So, I used Murphy's Law to solve it.
Re: GDB Console Not Working [message #644990 is a reply to message #644988] Wed, 15 December 2010 06:24 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
I found a difference. I restarted Helios completely. When I went to gdb I saw the following message:

[Thread debugging using libthread_db enabled]

Then gdb console was active (i.e. command line font was cyan).

On a restart it stopped working again. I guess I can't rule out this might be application specific (the application I'm trying to debug).
Re: GDB Console Not Working [message #645051 is a reply to message #644990] Wed, 15 December 2010 11:43 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
No Real Name wrote on Wed, 15 December 2010 01:24
I found a difference. I restarted Helios completely. When I went to gdb I saw the following message:

[Thread debugging using libthread_db enabled]

Then gdb console was active (i.e. command line font was cyan).

On a restart it stopped working again. I guess I can't rule out this might be application specific (the application I'm trying to debug).



I usually see this printout as well.
In your image, I noticed the prefix [Debug console] in the title of the console. Do you also see this when things work? I don't think this prefix should be there, which makes me wonder if it is the right console.

Either way, since you have selected the 'gdb' element in the debug view, if the console that it shows is not correct, then we have a bug.

In the console view toolbar, there is a little blue TV icon with an arrow. If you click on it you can see all available consoles. Do you see more consoles that you would expect? More than one for 'gdb'?

Thanks

Marc
Re: GDB Console Not Working [message #645211 is a reply to message #645051] Wed, 15 December 2010 23:16 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
A screenshot with it working: http://i55.tinypic.com/2hyicyp.png

When I select the console drop down I have the following consoles available:

- Aptana Scripting Console
- C-Build <project>
- <run config name> [C/C++ Application] gdb traces
- <run config name> [C/C++ Application] gdb
- <run config name> [C/C++ Application] <binary>

If I come across the previous scenario then I'll check the available consoles and repost.

Thanks,
Jevon
Re: GDB Console Not Working [message #645216 is a reply to message #645211] Thu, 16 December 2010 00:23 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
OK. I reproduced the non-working scenario. After continuing with execution after startup, I then set a breakpoint and hit that breakpoint.

A new console has appeared in the console list:
- [Debug Console] <run config name> [C/C++ Application] gdb

On hitting the breakpoint it defaulted to this console. This console doesn't seem to work with accepting gdb commands. I changed to the working gdb console:
- <run config name> [C/C++ Application] gdb

and it works fine.

I didn't spot this new console type. It does look like a debug console!
Re: GDB Console Not Working [message #645217 is a reply to message #645216] Thu, 16 December 2010 00:26 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
Sorry, In the previous post, I mean that on hitting the breakpoint, and then selecting the 'gdb' node in the 'debug' view, it defaults to the '[Debug Console]' variant.

I tried it again. It does this every time. I have to then select the other console type.
Re: GDB Console Not Working [message #645358 is a reply to message #645217] Thu, 16 December 2010 18:07 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
I'm not able to reproduce it. My guess is that you have something else installed that creates the console, and the code that chooses the gdb console is getting confused.

Can you tell where this console is coming from?

One trick you may use is the plugin-spy.
Press Alt+Shift+F2 and then when you hover over buttons you will see your mouse icon as a magnifying glass; you can then select a button and a pop up will show you who contributed that button. The trick here is to choose a button that is not provided by the standard console. Looking at the image you showed of the bad console, I suggest you try the big X button or the double big XX.

I hope this can give us some info.

Marc
Re: GDB Console Not Working [message #645389 is a reply to message #645358] Fri, 17 December 2010 00:14 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
I don't think I have the PDE plug-in spy installed. ALT+SHIFT+F2 doesn't activate anything. I've spent half an hour scouring the web. I'm unsure how to install the PDE plug-in. I can't find an update url for Eclipse (which I'd prefer). I downloaded the Eclipse SDK but I'm unsure what plugins I would need to copy across to my standard Eclipse installation.

Help!
Re: GDB Console Not Working [message #645405 is a reply to message #645389] Fri, 17 December 2010 04:53 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
I wonder if it might be the Aptana plugin.
Re: GDB Console Not Working [message #645545 is a reply to message #645389] Fri, 17 December 2010 19:14 Go to previous messageGo to next message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
No Real Name wrote on Thu, 16 December 2010 19:14
I don't think I have the PDE plug-in spy installed. ALT+SHIFT+F2 doesn't activate anything. I've spent half an hour scouring the web. I'm unsure how to install the PDE plug-in. I can't find an update url for Eclipse (which I'd prefer). I downloaded the Eclipse SDK but I'm unsure what plugins I would need to copy across to my standard Eclipse installation.

Help!


After you have pressed ALT+SHIFT+F2, you have to move your mouse around until you hover over something meaningful.

But to know if the plugin spy works or not try ALT+SHIFT+F1, that should pop-up a window right away.

Marc
Re: GDB Console Not Working [message #645582 is a reply to message #645545] Sat, 18 December 2010 08:47 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
OK. We're closed for Christmas. I'll pick this up in a few weeks.
Re: GDB Console Not Working [message #647007 is a reply to message #644961] Tue, 04 January 2011 00:10 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
ALT+SHIFT+F1 does nothing, so I assume it's not installed. What's the easiest way to install it? I remember I had trouble finding straight forward installation instructions.
Re: GDB Console Not Working [message #647011 is a reply to message #647007] Tue, 04 January 2011 01:45 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 16
Registered: December 2010
Junior Member
I'm pretty sure this debug console belongs to the Aptana plugin. I uninstalled the plugin and no longer get that other debug console.
Re: GDB Console Not Working [message #647491 is a reply to message #647011] Thu, 06 January 2011 16:34 Go to previous message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
No Real Name wrote on Mon, 03 January 2011 20:45
I'm pretty sure this debug console belongs to the Aptana plugin. I uninstalled the plugin and no longer get that other debug console.


There may be a bug somewhere that makes selecting the 'gdb' entry make the wrong console pop up.
Previous Topic:Set preferences for all projects
Next Topic:Program won't compile
Goto Forum:
  


Current Time: Fri Apr 26 05:30:29 GMT 2024

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

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

Back to the top