I'm trying to debug code that I've built from source. It is started with the wrapper from Tanuki.
I'm debugging inside IntelliJ idea but I'm not sure that is the problem.
The debugger correctly stops at all lines where I've put a break point but never else so F8, "step over" doesn't work. Very tiresome as I have to put break points every where :)
Am I doing something wrong?
How do you build the project? If you build it with Ant or some other tool, make sure that compilation is performed with debug info enabled (debug=true for Ant javac task). Obfuscation and bytecode instrumentation during the build can also affect the possibility to debug. If you run under some non-standard JVM, it may also cause such problem.
When performing remote debug, ensure the target process is started with the correct JVM options suggested in the IntelliJ IDEA Remote debug configuration. Your wrapper configuration may pass them incorrectly.
Make sure you don't have a different jar on the classpath (other than the project) with the same classes. You could be stepping through the compiled classes and "breakpointing" in the sources.
This worked for me: http://devnet.jetbrains.com/thread/267022. Basically there's another lib in the classpath confusing the debugger. Simply find out which library it is by stepping into during the debug. Then find it on the project and delete it.
In my case, it was an auto generated file that was causing the confusion.
happened to me as well, on Eclipse (Mars).
Restart of eclipse solved it... as simple as that...
I also faced the same problem.Below trick worked for me:
Delete the settings for Intellij
Windows User :C:\Users{username}.IntelliJIdea14
This will restart the Intellij for you from the beginning.
Hi I also had the same behavior and I got it fixed by installing the latest IntelliJ after removing/rename the folders found in these locations https://intellij-support.jetbrains.com/hc/articles/206544519
I had to delet all the versions I previously installed. Just give it a try.
Related
I'm trying to debug a problem with the Eclipse plugin at https://github.com/davidmichaelkarr/e4macs . This is a fork of the original application, which is now unfortunately abandonware.
As Eclipse has moved on with further releases, there have been a small number of issues in the plugin. I was able to fix the first problem (shown by my diffs with the base repo), but the next problem that appeared around 2019-09 is a little harder to figure out.
Specifically, the "split-window-vertically" command just does nothing when I execute it. It doesn't matter whether it's bound to a key or executed directly from the "execute extended command" prompt. Nothing appears in the log about this.
So, I downloaded an instance of the RCP 2019-12 distro and set up to debug this. I ran an "Eclipse Application" in debug and tested the function. It worked perfectly fine. This means that somehow something else that I have loaded in my regular 2019-12 installation is making this function not do anything.
From the Marketplace Client, I tried installing some of the same plugins in the debug instance that I have in my regular instance, but I didn't get very far doing this. I tried to install the "Spring IDE", but this gave me many errors. It starts out with "Cannot be completed", and it gave me a long list of "will be uninstalled", "Will be upgraded/downgraded", and "Will not be installed". All of the Spring features were in the latter list. I tried to install the "Groovy" plugin, and that gave me several "Missing requirement" errors.
I don't know whether the missing plugins are what is causing the operation to work, and I can't figure out why I can't install the plugins.
I'm not sure what to do here.
Update:
A comment pointed out that the way to install plugins in a debug instance is to add plugins to the target platform. I proceeded to do that, and discovered that one of the choices for sets of plugins to use is from an existing installation, which is perfect, because that's exactly what I want the debug instance to use, all the plugins in my existing 2019-12 installation.
Unfortunately, doing this has apparently removed my other installed plugins as the source of the problem. I tested the plugin code in this newly edited debug instance, which has all of the same plugins as my regular instance, and the plugin is working perfectly fine. In my regular instance, when I execute the operation in question, nothing happens. No error of any kind, and I don't get the expected result. The operation in question is "split-window-vertically", which should do what it sounds like.
Note that by setting the plugin source to the regular installation, that also included the installed copy of the plugin in question, the Emacs+ plugin (which is installed from the "dropins" directory). I'm not sure exactly what that would do. In any case, I set breakpoints in the plugin code, and when I executed the operation, it did hit the breakpoints.
Note that I also did import the same preferences file into the debug instance that I use in the regular installation, so the preferences are identical, and based on the previous information, the set of installed plugins should be almost identical (I'm not convinced they are exactly identical).
The only other difference between the debug instance and my regular installation is that the regular installation is the "Eclipse IDE for Java Developers" variation from the Eclipse installer, but the debug instance was launched from the "Eclipse for RCP and RAP Developers" variation. I have no idea whether that is significant.
Update:
I added logger calls to the plugin code (using "org.eclipse.equinox.log.Logger", is that the correct logger class to use?). I even added a logger call (and even a println) to the constructor of the operation handler class. None of those were seen in the log file. That tells me that something is wrong with my plugin configuration files, like the "plugin.xml" file.
The "plugin.xml" file is 3928 lines long, so I'm a bit hesitant to just paste it here. I tried opening it in Eclipse, and it doesn't complain about anything.
The following is a screen grab showing the relevant entry:
Note that although the executable operation isn't doing anything, and it seems like the handler isn't being executed, there are some aspects of the operation definition that are being properly loaded into Eclipse, like the description of the operation. Emacs+ provides a "describe-command" function, and I can specify "split-window-vertically" to this command, and it properly returns the description of this command as set in the "plugin.properties" file.
Also note that although this particular operation is not doing anything in this version of Eclipse, there are other functions in Emacs+ that are still working perfectly fine.
in my project i want to debug the C/C++ source code of the OpenJDK version 8 using eclipse. For this purpose I have done following:
Compiled the OpenJDK8 with --with-debug-level=slowdebug using this readme.
Imported the sources makefile project into eclipse
Created an eclipse run configuration, executing gdb against the compiled OpenJDK's java.exe and targeting a sample java program. Into this configuration I have attached the JDK source code directory path, so that eclipse is able to translate debug symbols to source-code lines and view them to me (obviously)
With this approach, I am able to debug through the code of files like java.c.
My problem is that somehow I still cannot debug through native code. Like for example java.lang.System.currentTimeMillis().
To me it looked like the libraries were not included into the eclipse gdb-run. I tried to run gdb manually, and it still didn't work to debug through that code section.
Has anybody expirienced same behavior, or did ever try to debug the JDK source code? I guess I am missing something here... Maybe my approach is just not correct for the task? Would be glad to hear any proposal about how to debug the JDK source code propperly.
Thank you in advance.
You may need to force eclipse into debug mode via the top right corner beetle icon.
Another possible option is to use an assert(false) line instead of a break point.
finally, it's possible that you need to specify a compiler in your eclipse project settings.
Keep in mind that the Eclipse debugger does not work for all compilers, usually because of an incompatible linker. I would recommend looking online for a compatibility list.
I'm working on an Android project in Eclipse. I just updated to:
Version: Kepler Service Release 2
Build id: 20140224-0627
Since then, if I hit a breakpoint in debug, I can no longer type in any files. The keyboard seems to work for stepping through code and for typing text elsewhere in Eclipse outside the file editors. The behavior persists even if I terminate the debug session. (I'm debugging on a device.)
I need to restart Eclipse in order to be able to change files in the editor. Not too fun! I've not found any recent bug that explains the behavior. FWIW the upgrade wiped out my preferences too. It looks like my install history was lost too because the previous configuration does not seem available to revert to.
Any help appreciated!
This happens when you're debugging .class files instead of their correspodning .java files. This happens a lot when library projects are involved. Some other things happen too -- you can place double breakpoints, &c. It's a bit annoying.
You can normally fix this issue by editing the Source Lookup when debugging. Please see the answer to this question: Debug Android library project with java source code
I have an urgent and puzzling problem with Eclipse. My system crashed on itself this morning, and after I rebooted, I can run a program perfectly within Eclipse, by right-click on the Java file and choose 'Run as Java Application'. However, after I make the project into a .jar file, and execute that, the behavior of the program simply does not reflect what the code does.
I have checked that I am compiling the right project, and running the same code from the same project within Eclipse does not cause any problem. And btw, I am using a plug-in called fat jar to compile the .jar file, if that makes any difference. I have used the same plug-in numerous times before to compile the very same project, and never had any problem.
Does anyone know what might be causing this weird/inconsistent behavior of Eclipse? Do I need to re-install Eclipse and fat jar to fix this? Thanks.
My usual procedure for strange things like this is,
A) Clean and build again i.e. Project -> Clean
B) (not so eclipse related) Since I am usually using a build tool, do the same thing from the tool to ensure its eclipse.
C) If it gets really bad, I'll start a new eclipse workspace and try from there.
D) Iff I had just installed a new plugin before things went strange I'd think about reinstalling
It sounds extremely strange :)
But Eclipse can, and has, acted strange before. I have had problems in both Java, C++ and PHP development during the years that could only be fixed with a resinstall of Eclipse. You could probably fix it by digging around, but the time it takes to find and fix these types of strange problems in Eclipse is simply not worth it.
Good luck!
Please try to Reset Perspective first (Before reinstall eclipse)
Window->Reset Perspective.
I've run accorss a really weird issue, in eclipse I've got a codebase I've been working on for a couple of weeks and it's working fine. I did an svn update and all of a sudden one of my classes doesn't compile because it can't resolve an enum which is in the same namespace to a type.
I've checked the Java version and I'm running under Java 6 so enums should be supported.
Also it worked up till yesterday and now it doesn't.
Has anyone else seen this kind of behaviour? I've reloaded eclipse but beyond that I dont know where to start diagnosing it.
If it does say "Step cannot be resolved to a type", just try and clean the project (Project -> Clean). Eclipse gets confused sometimes, and a clean usually helps.
I had this recently. Turned out that someone had committed some jars that conflicted (had a previous build in) and put on the build path. Check recent commits to see if that's the problem, or to see what could have caused it.
However I would definitely do a build clean first within Eclipse, and see if ANT/Maven is affected (you do have such build scripts I assume).
Weird idea, but could it be that eclipse is trying to compile your class using a 1.4.2 compiler and isn't recognizing the enum?
I unloaded the project and reloaded it and it just works... No idea what the origianl issue was...