Anyone here using eclipse?
Anyone here using eclipse?
Hi, I was always wondering: does anyone here use eclipse for OS development?
For example, I use it just like this:
* Eclipse (Always loved it)
* Makefile (I like it, Ctrl-B (in eclipse) and your kernel/(whatever you coding) is compiling and emulator appears)
* Qemu emulator (I have redirected serial output to both log.txt and stdout, as I use serial i/o for logging in my kernel)
Are there any ways of debugging your kernel in eclipse?
For example, I use it just like this:
* Eclipse (Always loved it)
* Makefile (I like it, Ctrl-B (in eclipse) and your kernel/(whatever you coding) is compiling and emulator appears)
* Qemu emulator (I have redirected serial output to both log.txt and stdout, as I use serial i/o for logging in my kernel)
Are there any ways of debugging your kernel in eclipse?
- max
- Member
- Posts: 616
- Joined: Mon Mar 05, 2012 11:23 am
- Libera.chat IRC: maxdev
- Location: Germany
- Contact:
Re: Anyone here using eclipse?
Hi Awe2K,
I'm using Eclipse for OS development. I have a set of shell scripts that do the entire build process. I'm using Mercurial (hg) as my main version control.
Yes, you can debug: build a GDB for your target platform and connect to QEMU. Configure it as a "C/C++ Remote Application". You can then launch QEMU in debug mode, and then start debugging in Eclipse and it will connect.
I'll try to collect some tips on how I set it up so that indexing/code completion/error checking work flawlessly, so maybe you and others can make use of it. It took quite some time to figure out how to get Eclipse to detect the custom toolchain properly, but I wouldn't want to use anything else. This is what mine looks like
Greets,
Max
I'm using Eclipse for OS development. I have a set of shell scripts that do the entire build process. I'm using Mercurial (hg) as my main version control.
Yes, you can debug: build a GDB for your target platform and connect to QEMU. Configure it as a "C/C++ Remote Application". You can then launch QEMU in debug mode, and then start debugging in Eclipse and it will connect.
I'll try to collect some tips on how I set it up so that indexing/code completion/error checking work flawlessly, so maybe you and others can make use of it. It took quite some time to figure out how to get Eclipse to detect the custom toolchain properly, but I wouldn't want to use anything else. This is what mine looks like
- In the project properties, at the point "C/C++ Build" is where I've included my shell scripts as the build scripts. For this you just have to untick "Use default build command" and enter "sh build.sh" in the "Build command" line. This is what Eclipse executes on Clean/Build.
- I use external tools for launching the OS in a VM. This has the advantage that in the "Build" tab you can choose "Build before launch" for specific projects, and select that for example your kernel must be built before launching it.
- To make code completion work properly it's important to set the correct "Providers". These are used by Eclipse to detect the settings of your compiler. So thats what we have to configure to make Eclipse detect the settings of our cross compiler. You can find them in the project properties at "C/C++ General -> Preprocessor Include Paths, Macros etc. -> Providers".
Here you must configure one of the "Built-in Compiler Settings" entries so that they use your cross compiler instead of the default compiler (see this example configuration). For example I use the "CDT GCC Built-In Compiler Settings Cygwin". Select it. In the bottom panel, untick the "Use global provider shared between projects". Then in "Command to get compiler specs" you replace the "${COMMAND}" part with the name of your cross compiler, for me the line then looks for example like:Code: Select all
i686-ghost-g++ ${FLAGS} -E -P -v -dD "${INPUTS}"
- Tip: Configure the indexer under "Preferences -> C/C++ -> Indexer". Important is setting a slightly bigger heap size than default because otherwise there will be problems because it otherwise doesn't have enough memory to store the info. Also set the ticks on the top.
- Tip: Install Java Tools in Eclipse and use Java working sets. They are way more comfortable than the C++ ones.
Greets,
Max
Re: Anyone here using eclipse?
Hi, Max.
As I've said, I'm currently using make (I don't trust CDT much), and it's very useful. Maybe I wound make some shell scripts, but I don't know shell lang , and make file, like a shell script, may be configured (but my make still doesn't see my cross-compiler).
Also, is there any way in eclipse to use make with gdb? As far as I know, both qemu and gdb "lock" execution until they stop. Can they somehow be run parallel?
As I've said, I'm currently using make (I don't trust CDT much), and it's very useful. Maybe I wound make some shell scripts, but I don't know shell lang , and make file, like a shell script, may be configured (but my make still doesn't see my cross-compiler).
Also, is there any way in eclipse to use make with gdb? As far as I know, both qemu and gdb "lock" execution until they stop. Can they somehow be run parallel?
- max
- Member
- Posts: 616
- Joined: Mon Mar 05, 2012 11:23 am
- Libera.chat IRC: maxdev
- Location: Germany
- Contact:
Re: Anyone here using eclipse?
Makefiles are fine. I just decided for shell scripts myself because I find them easier comprehensible.
For GDB: Alas I can't try it out at the moment, but doesn't it work as described above? Running QEMU in debug mode makes it block until GDB connects. Running the debug mode in Eclipse with a "C/C++ Remote Application" should then make it connect to QEMU.
For GDB: Alas I can't try it out at the moment, but doesn't it work as described above? Running QEMU in debug mode makes it block until GDB connects. Running the debug mode in Eclipse with a "C/C++ Remote Application" should then make it connect to QEMU.
Re: Anyone here using eclipse?
Okay, thanks, I'll definitely try that way.max wrote:Makefiles are fine. I just decided for shell scripts myself because I find them easier comprehensible.
For GDB: Alas I can't try it out at the moment, but doesn't it work as described above? Running QEMU in debug mode makes it block until GDB connects. Running the debug mode in Eclipse with a "C/C++ Remote Application" should then make it connect to QEMU.
- DeezRamChips
- Member
- Posts: 132
- Joined: Fri Apr 08, 2016 5:03 am
- Location: atapio.cpp - why won't you work :(
- Contact:
Re: Anyone here using eclipse?
Hi max, I was wondering why you were using scripts and makefiles ? I managed to get it working only using a linker file xD and how you can see, it works well !
I've even added a lauch prophile that creates a bootable iso with grub-mkrecue and that lauches it into QEMU
I've even added a lauch prophile that creates a bootable iso with grub-mkrecue and that lauches it into QEMU
My github page: https://github.com/AlexandreRouma
Meme-deving since 420 Bc !
YouTube: https://www.youtube.com/channel/UCyJnOD ... C8Y7pccc6A
Twitter: https://twitter.com/WhatsTheGeekYT
Meme-deving since 420 Bc !
YouTube: https://www.youtube.com/channel/UCyJnOD ... C8Y7pccc6A
Twitter: https://twitter.com/WhatsTheGeekYT
- max
- Member
- Posts: 616
- Joined: Mon Mar 05, 2012 11:23 am
- Libera.chat IRC: maxdev
- Location: Germany
- Contact:
Re: Anyone here using eclipse?
Hey DeezRamChips,DeezRamChips wrote:Hi max, I was wondering why you were using scripts and makefiles ? I managed to get it working only using a linker file xD and how you can see, it works well !
I've even added a lauch prophile that creates a bootable iso with grub-mkrecue and that lauches it into QEMU
sure that will work when you put all your stuff in a structure so that the Eclipse builder can make sense of it. But you will not always want to build with Eclipse, what if you want to build on a system where you don't have Eclipse? Like, maybe your own OS later on, when you want to get self-hosting?
I don't use Make btw, I just use plain shell scripts.
Greets
Re: Anyone here using eclipse?
What happened to your custom build tool?max wrote:I don't use Make btw, I just use plain shell scripts.
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum
Compiler Development Forum
- max
- Member
- Posts: 616
- Joined: Mon Mar 05, 2012 11:23 am
- Libera.chat IRC: maxdev
- Location: Germany
- Contact:
Re: Anyone here using eclipse?
Both projects would take too much time, bash is available out of the box wherever I build it.matt11235 wrote:What happened to your custom build tool?
I might up it to GitHub though so maybe anyone else can make use of it.
-
- Member
- Posts: 80
- Joined: Wed Aug 09, 2017 7:37 am
Re: Anyone here using eclipse?
I use Eclipse but not for OS development. It is great for Java. I use a normal text editor and my Terminal