How to debug Eclipse's internal clases - eclipse

I have a very strange problem with regards to contributing to Eclipse. I have modified bundle org.eclipse.jdt.internal.junit4.runner and just wanted to test it and try it, but for some strange reason my breakpoints in the bundle org.eclipse.jdt.internal.junit4.runner are not working. It sounds to me that there is an internal filtering that cause that these bundles are ignored for breakpoint.
Funny thing is when I add
System.err.println("Did you reach it?"); //$NON-NLS-1$
In the console I can see the text, but the breakpoint is not working...
Any advice would be very welcome.

Look here. Also check whether any packages are excluded in Windows->Preferences->Java->Debug->Step filtering.

Well, I found out the problem but not a complete answer.
The problem is especially related to the org.eclipse.jdt.internal.junit4.runner bundle which launches and an another virtual machine and the code within this VM is not in debug mode, e.g. the first virtual machine is in debug mode and the second is not and that was the reason why my breakpoints did not work. So I guess there is no possibility how to enable debug mode "by eclipse automatically" in the subsequent VMs.
Here is an example of 2 VM from my blog http://blog.chocolatejar.eu/contribution/2014/02/27/better-visualization-junit-failures/

Related

How to properly set up the V8 Debug Configuration in Eclipse with Nodeclipse for NodeJS

Back in the day I was debugging node.js applications using the ChromeDevTools. Breakpoints would be synced or reset on remote, so that no matter what, the breakpoints in the Eclipse breakpoint window would always match the actual breakpoints.
Also, setting up the Source Mapping as described here would cause Eclipse to break inside my actual local files, not in a read-only V8 window.
These days, ChromeDevTools is outdated and unmaintained. I started using Nodeclipse and their V8 debugger.
But now, when debugging, Eclipse keeps breaking on breakpoints I had already unset or removed. Seemingly irregardless of my setting here:
Also, whether or not it's a break point I meant to break on, A new read-only editor opens with the V8 (Chromium) icon in stead of the javascript-icon. If the original name was e.g. index.js, the script that opens is index.js (20).chromium.
What is changed? How exactly does one set up the Nodeclipse V8 debugger for proper breakpoint syncing and source mapping?
There is nice intro info given, but still a discussion should follow, that does not fit to StackOverflow format. Please create and follow with an issue on https://github.com/Nodeclipse/nodeclipse-1/issues
These days, (since Nodecipse 0.2) Launch configuration is created automatically, so most users may even don't know about it existence. And it is needed to be recalled looking at code how actually launch configurations are created and synced. Related source are here:
https://github.com/Nodeclipse/nodeclipse-1/tree/master/org.nodeclipse.debug/src/org/nodeclipse/debug/launch

Service code debugging question with GWT 2.1

I recently attempted to set new breakpoints in eclipse to debug service side code in GWT. For some reason eclipse refused to see the breakpoints or the new code changes I had made. In the debugger it would open up what appeared to be an ear file from somewhere. Even though I had deleted the old ears, compiled and redeployed the new ear files. We are using GWT 2.1, JBoss 4.3, java 1.6 and Eclipse Helios. Finally, when I created a new environment with the code from scratch it started working. Any ideas as to what was holding on to the old code? BTW, I had rebooted my machine and restarted eclipse, but it also didn't make any difference.
Thanks,
James
Current state of debugging GWT apps is ... well not really good. Sometimes it's incredibly slow (development mode), sometimes lot of rubbish stays at webserver.
This might not solve your problem directly, but here are some advices from me:
Writing new client code (/client) at GWT means refreshing browser
Writing new server code means "Reloading web server". You have little yellow "refresh" button in Eclipse in "Development Mode" tab. This should reflect all the changes done at server side.
Embedded Jetty works usually well with GWT debugging. If you are not doing something jboss-server-specific, it should also work fine at production server. Just make sure your unit tests pass ;-)
You can ofcourse debug GWT application on external server, see this section of documentation (I guess you do on JBoss)
Be sure to remove all old files when reloading web server. It happened to me, that sometimes there were some weird old mixed up files (I was using Tomcat though). So you might want to write own clean script.
You must be absolutely sure that your serever code even launched! Use lot of GWT.log() at client side, that will ensure you in this. Don't worry, GWT.log are ommitted in production mode.
Be sure to inspect client-side page, it sometimes help to find out that your server code didn't manage to launch.
Log every public void onFailure(final Throwable caught) { of your AsyncCallbacks to get more info.
Don't use Google Chrome in development mode. It's MUCH slower than Firefox.
Otherwise, if you're using most recent version of your application, Eclipse must stop at breakpoint correctly.
I think JBoss was somehow caching things in it's temporary files and then I had forgotten about adding source in. This may be a JBoss thing as I don't recall seeing it with other application servers before.
So after I cleared out the cache, what got me thinking about the source was the fact that eclipse would stop on the breakpoints in the debugger that I had just set, but I couldn't see the source files.
Prior to this I was apparently hitting the breakpoints in the cached files and I couldn't alter them by setting new breakpoints. That was the root cause of the issue. Then by adding in the source from the ear, I got the debugger in sync with the code and it started working fine.

Blackberry eclipse debugger not reflecting code changes

I've been struggling with this for the past day. I seem to be stuck with a weird bug in Eclipse where it decides to step through and exec sections that I've entirely deleted or commented. It also chooses to ignore all the instructions that I've actually added today. I've tried removing all breakpoints, clearing my bin directory, resetting my emulator, but nothing works.
Any help is much appreciated!
Thanks,
Teja.
It depends on the OS you are debugging for...
5.0 + the sim is hot-swappable, and the menu option: Project-BlackBerry-Clean Simulator actually cleans the simulator
Do you have "Build Automatically" checked? You should (for this anywho)
if you select to Debug while it is running, it will build and resume near to the point it left off (if it still exists after your code edits anyway)
under 5.0, you need to kill the old sim, run the clean.bat as mentioned above and restart the sim
Although upon re-reading your post, sounds more like your build is not making it to the sim, and it is executing the app you already placed on it... Run the sim's clean.bat and check again... Are you sure you have a successful build?
I don't know if this is the solution to your problem but here are a few useful tips:
1.If you make changes to the code and save them while you have started the debugger i.e. have started Eclipse in Debug mode(Debug as...) the debugger won't recognize the changes. You have to recompile, repackage and then restart the debugger.
2.After making the changes to your code it isn't enough to just build the project. You also have to select the project and from the Project menu then Blackberry->Package Projects. After doing this try to start the debugger.
Hope this helps.
try to clean your emulator if you haven't done this yet. Go to emulator folder and use clean.bat to clean the emulator this will remove all applications you installed on emulator.
Whenever I make changes to the BB code I need to do a clean build in Eclipse, sounds silly but it works for me. Otherwise I get the behavior you describe...

Eclipse skipping over breakpoints when debugging java

I've been using Eclipse for ages and I use the debugger all the time but recently I've known it to skip over breakpoints while debugging! I've even had it so that I've set a break point on a println I'll see the text come out but not hit the breakpoint. Also sometimes I'll hit a break point consistently in one area of the code but not in others. This never used to happen and I can't work out what I've done to my system to cause this. Has anyone else had any experience of the problem?
What you mention ("-XX:+UseParallelGC") is a workaround for the bug found with jdk6u14 and 15.
As mentionned in "Eclipse SWING app: breakpoint hit only after an uncaught exception is thrown", it is fixed with jdk6u16.
Ahaha,
I've found the solution eventually after a long web trawl. I'm not sure why this happens but other people have seen the problem too and
Window -> Preferences -> Java -> Installed JRE's -> (edit your currently used JRE) -> Edit "Default VM Arguments" box and enter (w/o questionmarks) "-XX:+UseParallelGC"
Generally fixes the problem...
I encountered the same issue. My solution is, you do a clean on the project (Project->Clean) and build again(Project->Build All or Project->Build Project). Upon a successful build, Debug the project again. It will go through the code perfectly (in the proper way).

Hot Code Replace Failed (eclipse)

"Hot Code Replace Failed - add method not implemented".
I get this error message every time I change something in my test class (and save it).
Can't figure out what it means. Can somebody help?
Possibly, you have a test which is still running (in debug mode). Try finishing all tests (you can see them in the debug view: window->show view->debug) and try again...
See this thread:
This means you changed a class while it was debugging an application and it could not update the class for the application while it was running.
The error suggests you may be running an older JVM, i.e. pre-1.4.2 but this error can occur with any JVM if the change is incompatible with the previous version of the class.
Check carefully what JRE you are using in your debug session.
Also check you are deploying classes compiled with the debug attribute set. (see this thread)
Finally, as indicated here:
did you switch "Project->Build Automatically" off?
Hot code replacement works (only?) if automatic build is switched on...
I was running into this issues too. I found a build hiding in the backgound that was giving me fits. Check to make sure you have all tests/builds closed or completed. Nonetheless, you can still run the new code.
Whenever this error message appears it also gives options to terminate or restart. Select Terminate and it will terminate any running debug case which you are unable to locate.
if you have multiple projects involved, and multiple jre's installed, make sure all dependent projects are using the same javac/jre
Make sure your application server JRE and Eclipse JRE version should be same or else it will throw unsupported class version and hot code debug will not work.
I went to the same Problem,But my Debugging session ended hours ago.But still ECLIPSE error kept coming.
So I just simply restart the ECLIPSE IDE, then the problem just solved.