Debugging JNI on Eclipse CDT ( MinGW & GDB ) - eclipse

I'm using Eclipse CDT on Windows 7, with MinGW as my toolchain and GDB as my debugger. For the most part I have been able to get everything working normally, including the development of Java, C/C++, and JNI applications.
However, I am unable to debug the native side of those JNI applications. The Java debugger works fine for Java code and GDB works fine for purely native code, but I cannot seem to get GDB to operate properly on code within a JNI .DLL.
I have searched the web for quite a while regarding this, and it sounds like the success people have had is by attaching to the running Java process after launching it from Eclipse. Then, setting a breakpoint and letting GDB hit it. Unfortunately, this does NOT seem to work for Windows users.
The only advice that seems to work ( which I can confirm ) is to launch the Java application in Eclipse, then attach to the process from Visual Studio. From there you can set breakpoints in the native code, and they will be hit. This approach is a pain in itself, but what really makes it awful is that you need to have compiled the .DLL from Visual Studio in order to generate the .PDB file for debugging symbols. Making the whole CDT somewhat extraneous at that point.
I'd much prefer to stay within Eclipse, but only if I can actually debug with it. Can anybody out there confirm if it's possible to debug JNI code with Eclipse CDT from Windows?

After a bunch more digging, I have confirmed this is definitely possible with the current ( Kepler ) build of Eclipse and MinGW.
That seemed to be my problem actually; the version of GDB I had wasn't able to attach to any process at all ( which I verified from the command line ). After updating to the current version of MinGW with a new gdb.exe, I could attach properly and view all the threads. Getting breakpoints to hit took a bit more work ( I was missing -g from the gcc compile ), but after that all seems fine.

Related

Eclipse Java IDE restore

I was developing a plugin, using Eclipse IDE for java developers (Version: 2021-09 (4.21.0)
Build id: 20210910-1417)
During development, when I run it as an eclipse application, it opens a runtime-Eclipse application where the plug-in is present. In my setup this new runtime-eclips app opened from a folder next to the workspace, where C codes were present. (and my progrem would get the tests run in C , and get the results from it's exe)
Then I downloaded the Eclipse IDE for committers, which is a newer version. I downloaded it as a zip and after unpacking I run the eclipse.exe. My program had problems opening the runtime-Eclipse application in C there, so i went back to the older one which is installed on my computer.
After opening the original eclipse, on which I was working and had no problems, I was hoping everything will be fine. It opens the IDE for java developers (same version, same build) but I have the same problems with the runtime-eclipse application as the one I run as an eclipse.exe , (not recognising the C code?? I don't understand).
When i try to run the plug-in I get this error.
And when the runtime-app opens i get this error.
I cannot create C projects anymore on the runtime-app. I don't know the reason behind this.
Also I have billion of these
["java.net.UnknownHostException: downdload.eclipse.ort"]
[" org.eclipse.equinox.p2.core.ProvisionException: Unknown Host: http://downdload.eclipse.ort/eclipse/updates/4.2/content.xml "]
Thank you in advance!
I don't know if it is possible or not, since seemingly it did not update the older eclipse IDE. If it can be restored the way it was before i run the eclipse.exe, I would be happy.
eclipse.ort is obviously a typo, it should be eclipse.org, I don't know where it is coming from - but its possible you enter it yourself as update site
the runtime error means eclipse cannot resolve all dependencies, which means it could not load bunch of plugins including yours, you need to figure out why on your own, its not possible to debug this remotely, its best to start from the scratch in the new workspace
The solution was easier than expected. The run configuration was modified by the other eclipse version. It was not launched with every plugin. only a selected handful

Eclipse cdt gdb: specify library to debug

I'm using eclipse cdt mingw 7.3.0 windows 10 for debugging the dynamically loaded dll.
Problem is that program loads a lot of dlls and it takes minutes till gdb is connected to all of them, but I need only one.
Is there a possibility to specify in debug configuration the library that I want to debug and load only this one in gdb?
Thanks in advance.

Qt application made in Eclipse doesn't start

I've been trying for a few hours now to make eclipse, mingw and Qt work, and I can't manage to.
No matter what I try, when I try to run the qt application (using Run or Debug, same thing), no window appears, and after a few seconds, Eclipse says 'program terminated'. Another time I tried (using some different configurations), windows would give that "Program has stopped" error.
If I try to launch the application from outside eclipse, I get a missing .dll error.
I have Qt 4.8.1 installed, latest version of eclipse, and I just installed the latest version of MinGW. I am also using the Qt plugin for Eclipse. I'm running Windows 7.
There are also some other minor problems:
For some reason I have to rebuild the index after opening/creating a project, or I'll get 'undefined include' errors.
The build (hammer) icon in the toolbar is grayed/disabled, why could that be?
For every new project, I need to change the make application to mingw32-make, is it possible to make the toolchain use this make executable or something?
I can't understand why Microsoft Visual Studio just works, I didn't have to set up anything other than install the Qt add-in, and Eclipse is so hard to configure...

Debug Haxe from Eclipse

My goal is to debug Haxe application in Eclipse (publishing SWF) on Linux. I have manually installed Eclipse Helios, Flash debugger version and Haxe. I have installed Eclihx. Problem is that I'm getting message from Eclipse:
Flash debug runner. This feature isn't ready!
Note: I can run program, so Haxe compiling works. I have also tried adding -D and -debug to hxml. I've been Googling out there, but no success.
And also, I don't know how to setup Eclipse so when I do run that automatically browser pops up with html.
From what I know, it's not currently possible to debug Haxe from Eclipse. However, you could compile a debug Haxe build and and use Adobe's fdb.exe, which is the command line debugger for Flash. With it, you should be able to set breakpoints and do some run-time state inspection. Hope this helps!

Setting up Eclipse for other programming languages

I have installed Eclipse (Helios) for the Java programming language, but I also want to use it for programming in C/C++, Python and Ruby. I've installed CDT and DLTK (for Python and Ruby).
I already had mingw-w64 (Windows platform) installed. How do I set up Eclipse so that it uses MinGW as the toolchain? It apparently detects MinGW as a toolchain, but when I create a project, two warnings already appear saying "error launching external scanner info generator". I'm assuming this is because it can't find the compiler program. Also, it doesn't detect any of the standard-library header files. Could these problems be because I'm using mingw-w64 rather than the standard MinGW?
I have Ruby working, but as for Python, it cannot find the interpreter nor the default system library. I have Python 2.7 already installed. I don't know how to tell Eclipse where to look for the files.
Note: I am on Windows 7 Professional 64-bit. I've heard of people on 64-bit versions of Vista having trouble getting mingw-w64 to work. I may be having the same problem. Ignoring Eclipse, when I try to compile a C file using gcc, it has trouble finding the libraries and includes.
Edit: If I set the path to /bin/ and /libexec/ via environmental variables, I don't get the initial errors when creating a project, but, what I want to know is, how could I set the paths via Eclipse? Also, even if I set the paths, the linker still can't find the libraries and includes. I went to Project > Properties > C/C++ Build > Settings and tried to set the libraries and includes that way, but it still couldn't find them (the libraries, at least)! Moreover, would I really have to do this for every project? This option isn't available in Window > Preferences.
As for the python part, I recommend using pydev: http://pydev.org/
It's the best eclipse plugin for python. From code completion, syntax highlighting, virtualenv support (http://pydev.blogspot.com/2010/04/pydev-and-virtualenv.html) and so on...
If you are into web development,
from javascript, php, html, python, ruby... you also might want to take a look at aptana.
http://www.aptana.com/
It's a eclipse based IDE with lots of goodies working out of thebox, like git and subversion plugins, pydev etc... aptana is (or was, I switched IDE) installable as a plugin in a regular eclipse)
Martin K. link looks good for mingw part.