pydev debugging: how to make the debug session automatically stop at the first executable line? - pydev

Can I make debug sessions in Aptana (with pydev) stop automatically on the first executable line, as if I had set a breakpoint there?

Not currently. Please open a feature request for that in the PyDev tracker (links: http://pydev.org/about.html)

Related

Can't find GDB option in Eclipse on mac

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.

Enabling breakpoints in goclipse

I'm trying to get debugging of go programs working in eclipse Luna with goclipse v0.11.0 on OS-X 10.9.5. I am using GNU gdb (GDB) 7.9.1 from brew, and go1.4.2.
I successfully installed and code-signed gdb using instructions here:
http://ntraft.com/installing-gdb-on-os-x-mavericks/
I am building my go program with -gcflags "-N -l" and I can successfully debug it at the command line, including setting breakpoints at go functions and stepping through them with the gdb command line, with source appearing as it should.
However, in goclipse I cannot set a breakpoint at all, because the 'toggle breakpoint' item on the menu is greyed out, and the 'Breakpoint Types' list says 'none available'.
If I select 'Stop on Startup at' 'main', then I can step through assembler, which is unhelpful, but proves gdb is being used.
If I keep the above option set, wait until the program hits the main breakpoint, and type (at the gdb console within eclipse) break main.foo, then cont, then a breakpoint is set in the right place, and I can step through things in the Eclipse IDE. Thus it appears the only issue is setting the breakpoints in the IDE.
The go program concerned is a single file and it works under command line gdb, and I have deleted the binary and started afresh, so this is not a 'need a rebuild' issue.
Related question: How to debug Go programs using GoClipse? however the two answers there are 'disable Stop on Startup' (which makes no difference here), and ensuring -gcflags "-N -l" is given (which makes no difference).
Screenshot:
Any ideas?

Disable break point in a .class file

I have a problem with my Eclipse debugger. When I start my server (JBoss Server AS 4.2) it always stops in a break point in a class called WebAppClassLoader whose source code doesn't exist on my machine. I don't know how to disable that frustrating breakpoint. Any suggestion please ?
Try Window/View/Other/Debug/Breakpoints
This will open a window that should list all the set breakpoints in your open project. You can remove a breakpoint by unchecking it in the list.

php unit-testing, eclipse PDT, makegood, xdebug

Is there any way to force makegood stop on breakpoints in order to inspect vars,etc ?
I installed eclipse indigo 3.7 + PDT tools, secondly I configured xdebug and it works during plain debug. at last I installed makegood from marketplace and enabled it's feature "Debug Test" and yet it doesn't stop at breakpoints instead it shows me report, which is correct, plus some buggy lines like:
/mnt/public/midnight/www/sandbox/makegood/Tests/makeGoodTest.php:11
/home/midnight/Software/eclipse/plugins/com.piece_framework.makegood.stagehand_testrunner_1.9.0.v201201241509/resources/php/PEAR/Stagehand/TestRunner/Runner/PHPUnitRunner.php:112
/home/midnight/Software/eclipse/plugins/com.piece_framework.makegood.stagehand_testrunner_1.9.0.v201201241509/resources/php/PEAR/Stagehand/TestRunner/TestRunner.php:79
/home/midnight/Software/eclipse/plugins/com.piece_framework.makegood.stagehand_testrunner_1.9.0.v201201241509/resources/php/PEAR/Stagehand/TestRunner/TestRunnerCLIController.php:325
/home/midnight/Software/eclipse/plugins/com.piece_framework.makegood.stagehand_testrunner_1.9.0.v201201241509/resources/php/PEAR/Stagehand/TestRunner/TestRunnerCLIController.php:175
/home/midnight/Software/eclipse/plugins/com.piece_framework.makegood.stagehand_testrunner_1.9.0.v201201241509/resources/php/PEAR/Stagehand/CLIController.php:101
/home/midnight/Software/eclipse/plugins/com.piece_framework.makegood.stagehand_testrunner_1.9.0.v201201241509/resources/php/bin/phpunitrunner.php:80
My /etc/php5/conf.d/xdebug.ini:
zend_extension="/usr/lib/php5/20090626/xdebug.so"
xdebug.profiler_enable = Off
xdebug.default_enable = On
xdebug.remote_enable = On
I'm sorry but I don't use makegood but I do know that xdebug has a function you can call from the code to trigger a break.
xdebug_break();
bool xdebug_break()
Emits a breakpoint to the debug client. This
function makes the debugger break on the specific line as if a normal
file/line breakpoint was set on this line.
I hope this will be of some help.
There is a button "Debug Test" for this in the MakeGood View.
To use if configure Eclipse Debuging using e.g. XDebug and then set a breakpoint and run your tests.
See https://wiki.eclipse.org/Debugging_using_XDebug

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.