Can't find GDB option in Eclipse on mac - eclipse

I'm new to Macs but I don't think this is a problem that comes from that. I've been attempting to set up GDB as a debugger for programming in golang on Eclipse. I know how to do it for the most part, but at some point one of the steps is to open up your debug preferences in the C/C++ configuration and fill in the path of where the debugger is located. Unfortunately, the option doesn't even show up for me:
Why doesn't the "GDB" option show up under Preferences >> C/C++ >> Debug? If i'm not mistaken, it should be a part of the CDT package correct? Am I just using the wrong version? It should be giving me this option:
At least it does for Neil Craft, the author of this tutorial

For anyone coming here looking for an answer:
https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/mac-gdb-install.html#eclipse
If there is no GDB section in the C/C++Debug subtree, close the preferences window, and try to first start a debugging session for any project that you can already run without problems. You can do it by either clicking the Debug button on the toolbar, or selecting RunDebug from the main menu. This attempt will, of course, fail with an error message about the gdb command, but it will force the said C/C++DebugGDB settings to appear in the preferences.

Related

Ipython in pydev interactive debugging console(eclipse)

I have ipython working in pydev when using the normal interactive console, however when entering debug mode the console reverts to the standard pydev console. If I close this console and re-open it, ipython returns and I can use it as normal. Am I missing something, or is this a bug?
-Eric
Actually since PyDev version 3.0 you can attache a IPython console to a debug-session:
http://pydev.org/manual_adv_interactive_console.html#full-debug-support-in-interactive-console
To enable that feature, go to window > preferences > PyDev > Interactive Console and check 'Connect console to Debug Session?'.
Then only hassle is that you have to re-open a new IPython-console every time you re-launch the program in debug-mode.
Actually, Eclipse itself can have multiple consoles open at the same time... if you want, you can create multiple console views and pin a different console to each view (if you don't pin the console, one console will be shown on top of the other and you'll have to do the switching from one to the other manually).
As it is now, the debug console is not the same as the interactive console (it's a simpler version because of issues with the eclipse integration, although there are plans to be able to attach an interactive console to a debug session).
So, what you described is what should really happen (not really a bug).

Whats the shortcut to Debug in PyDev using Eclipse

The shortcut key is F11 to start debugging. But issue is that I have to be on that file and then hit F11 to start debugging.
Eg.
my file to launch the application is "launch.py" and "example.py".
example.py is open in the editor whereas launch.py is not.
Now, if I hit F11 it will try to launch the application using "example.py" and terminates due to error (as expected).
So then I have to open the "launch.py" in the editor and then hit F11 to start debugging the application.
Is there any neater way to configure the debugging, so that it starts the application in single hit/key?
Edit: example.py is some other file (some module). It does not launch the application.
As this PyDev Eclipse Tutorial suggests:
After the first run, if you type Ctrl+F11, the last file ran is re-run. Or, if you type just F11, a debug session is started with your last run. Let's test this...
Note: This behavior changed in Eclipse 3.3 -- but it's generally recommended to restore it in the preferences at: window > preferences > Run/Debug > Launching and set the Launch Operation to Always launch the previously launched application.
This tutorial will always consider this as the default option.
So, did you have this option selected?
If you have launch at least once launch.py, then you can re-launch it easily.
Although this isn't strictly an answer to what was asked initially, it might help someone looking here that had the same problem as me...
I'm a Java developer mainly, so have the Java view open almost all the time. However, sometimes I want to run some python file to test something (or just create a quick python script, and run it)...
In the Java editor, if the current class has a main(String[] args) method, I run it with (and popup the dialog to ask me what exactly I'd like to run in the middle)
alt+shift+x, j
Unfortunately, that doesn't work in the Python view, and I've not found a similar solution - it just asks me if I'd like to run it as a Java app... however, as the VonC says, you can run the last run thing (provided you've set the preferences accordingly) with
ctrl+f11
and this seems work well with python run configurations too.
But... What if the last thing I ran was a Java program, but I now want to run the active .py file? Previously, to run the .py file, I'd have to go digging through the buttons on the toolbar with the mouse, and I tend to prefer keyboard shortcuts...
Solution! So, finally I come to the actual useful bit of this answer - I just discovered by accident (typing Ivan's suggested shortcut, but missing!), it appears that
f9
will run the currently active python file.
Hope that helps someone get just that little bit faster...
I use CTRL+SHIFT+F9 to relaunch the previous debug configuration in Pydev.

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.
You must click here
Next select one with *gdb
Now you can write GDB commands in console example:
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.
It is possible to write in the console window and gdb answers. (You have to choose the right console window from the chooser in the top right edge of the console view).
Unfortunately the console is quite limited: gdb answers to command, but important features like tab-completion do not work.
Window > Show view > "Debugger Console" is the right way as of Eclipse CDT 4.7.0.
You can then type certain commands like print on the console and they will be evaluated.
Other more "active" commands like continue have no effect however.
Mentioned on this comment.

Strange behaviour of created *.exe

Has anyone any idea why the resulting exe from a build comes with a console?
I've built an EXE and it shows up with the window it should (the right one), and a console window (the left one - obviously).
alt text http://img216.imageshack.us/img216/570/strangep.jpg
This behaviour is the same for the debug - exe and the release - exe.
When I start it from Eclipse the console window does not show up.
(Eclipse Galileo / MinGW / C)
Find the linker settings, and add the -mwindows switch.
you might look into this here surely answers why Eclipse is not opening your console window
There seems to be no way to get a java.io.Console object when running an application through Eclipse. A command-line console window is not opened with the application, as it is run as a background process (background to Eclipse?). Currently, there is no Eclipse plugin to handle this issue, mainly due to the fact that java.io.Console is a final class.
All you can really do is test the returned Console object for null and proceed from there.
as far as your console window popping is concerned, you might be using System.console in the application
Hope this Helps

How do I fix a "broken" debugger in EclipseME (MTJ)?

How do I fix a broken debugger, one that just won't start, in EclipseME (now Mobile Tools Java)?
(This question has an answer which will be transferred from another question soon)
The most annoying issue with EclipseME for me was the "broken" debugger, which just wouldn't start. This is covered in docs, but it took me about an hour to find this tip when I first installed EclipseME, and another hour when I returned to JavaME development a year later, so I decided to share this piece of knowledge here, too.
If the debugger won't start,
open "Java > Debug" section in Eclipse "Preferences" menu, and uncheck "Suspend execution on uncaught exceptions" and "Suspend execution on compilation errors" and
increase the "Debugger timeout" near the bottom of the dialog to at least 15000 ms (so the docs say; in fact, a binary search on this value could find optimal delay for your case).
After that, Eclipse should be able to connect to KVM and run a midlet with a debugger attached.
most debuggers are just plug-ins that also have a command-line interface; try running the debugger from the command-line and see if it works. If it does, then check the plug-in configuration; you may have to re-install the plug-in.
caveat: I have not used EclipseME, but had similar problems with the Gnu C debugger in Eclipse for Ubuntu.