Changes

Jump to navigation Jump to search
Neaaaaaarly there.
Please leave suggestions on the talk page instead of editing directly, for now.
-->
The [http://www.eclipse.org/ Eclipse Platform] is a modern open source IDE with a built-in debugger GUI and support for several programming languages via plug-ins. Plug-ins can also be used to extend functionality. For many, programmer's notepad and insight will suffice, but others may find the combination a little out of date. This wiki will guide you through each stage in the setup process, but assumes that you are using Windows, have already installed [[DevkitProdevkitPro]] (including devkitPPC) and are relatively familiar with the concepts of developing Wii Homebrew. I hope it is of use to others ~ [[User:PhoenixTank|PhoenixTank]] | [[User talk:PhoenixTank|talk]] | [[Special:Contributions/PhoenixTank|contribs]] |
== Requirements ==
*You now see the main IDE with Project Explorer, File Editor, Console and others panes.
*There will be an error and a probably warning in the problems pane. Don't worry about them for now, and open C:\devkitPro\examples\wii\template\ in Windows Explorer. Select the Source folder and makefile, and copy them to clipboard. Return to Eclipse, right click the HelloWorld project in Project Explorer, and paste. The files should now be a part of your project.
*Head to Projects > Properties, or do the same from the right click menu of helloworldHelloWorld. Click ''C/C++ Build'' then choose the ''behaviour'' tab. Here, change the value of ''Build (Incremental Build)'' to ''build''or simply blank, then hit OK. Alternatively, use a [[#Custom Make Targets|custom make target]] instead of the built in build.
*With default settings, Eclipse will immediately build your project. The error should no longer be there to pester you.
*If you have a warning like: Error launching external scanner info generator (gcc -E -P -v -dD C:/WiiDev/projects/.metadata/.plugins/org.eclipse.cdt.make.core/specs.cpp) then the easiest way to fix this is to add C:\devkitPro\devkitPPC\powerpc-gekko\bin; to the start of your [[#Path|path]] environment variable.
*Right click the project name and choose "Add Make Target".
*Enter Wiiload (or another name) into the first box, and "run" in the second box and hit create.
Provided you have wiiload set up correctly, double clicking this will allow you to easily send your most recently compiled .dol/.elf to your Wii. Your makefile entry for wiiload should look something like this, if not set up already:<pre>run: make wiiload $(TARGET).dol</pre>This is the same as the standard makefile from the template, but "make" is added simply to be sure we have a compiled version before trying to send our .elf/.dol file.
== More Settings ==
*C/C++ ¬ Code Style. I use BSD/Allman, but the other most common styles are there too.
*C/C++ ¬ Editor ¬ Content Assist. Drop the delay to 200 ms.
<!--*C/C++ ¬ New CDT project wizard ¬ Makefile Project : Behaviour tab. Uncheck ''Build on resource save'', change value of ''Build (Incremental Build)'' to ''build''--->
== Debugging ==
In order to debug a Wii application, you have to connect your debugger to it somehow. Your options consist of the use of a USB Gecko or a libogc wifi patch. Either way, the base setup is the same.
*Head to Run > Debug Configurations. Select ''Zylin Embedded debug (Native)'' and create a new configuration.
*Name it HelloWorld GDB (or other relevant name, but bear in mind that it will need to be unique across all Eclipse projects.From here, I'll explain settings tab by tab, as there are several ways to achieve the same setup.==== Main tab ====*Adding your project name is optional, and may or may not be filled in for you already. It only seem to enable the Search Project button below, which doesn't actually do anything useful for us.*In ''C/C++ Application'' you can specify your project's .elf (not.dol)to be used by GDB as a symbol file. Alternatively, and it can be done via the commands tab. ==== Debugger tab ====*GDB debugger - enter the path "C:\devkitPro\devkitPPC\bin\powerpc-gekko-gdb.exe". '''This one is required.'''*GDB command file - As an alternative to the commands tab, you can specify an external file containing GDB commands to run. Blank the field if you aren't going to use it. This may be useful if, for example, your Wii can't be assigned a static IP. Using a single command file that is updated to target the new Wii IP is easier than editing the config in each project.*Protocol - Keep it as "mi". I haven't tested for any differences yet.*"Verbose console mode" and "Use full file paths to set breakpoints" are pretty self-explanatory. ==== Commands tab ====*If you are not using an external gdb command file, "Initialize" should contain your "target" command, and if you did not specify a path to your project .elf in the C/C++ on the main tab, a "symbol-file" command.*I don't personally use "run" for any gdb commands, but it probably has a use for more seasoned developers. ==== Source tab ====By default your project path is added, but you can add other source folders for GDB to use if required. ==== Common tab ====*This tab allows you to save the configuration as an embedded part of the project (local) or as a shared file that can be used by other projects (shared).*You can add the debug configuration as a favourite and change the console encoding.*If you don't want to be able to use the Eclipse console to enter GDB commands, you have the option to disable it, but I'd recommend that you leave it enabled.*You can also have an external file process the output from GDB.
==== USB Gecko ====
==== Wifi Debugging Patch ====
AKA "The poor man's USB Gecko". This takes a little work to implement, but at a total cost of £0, who can complain? You'll need to be familiar with checking out from a SVN, patching source files, and compiling libogc from source. ===== Setting up the patch =====*Check out libogc SVN from: https://devkitpro.svn.sourceforge.net/svnroot/devkitpro/trunk/libogc*Apply tcpipwifi.patch from: http://sourceforge.net/tracker/?func=detail&aid=2707076&group_id=114505&atid=668553*Compile libogc and install.*???*Profit ===== Example GDB target command ===== target remote 192.168.0.5:8000
You'll need to be familiar with checking out from a SVN== Credits ==*http://forum.wiibrew.org/read.php?11, patching source files12220*http://forum.wiibrew.org/read.php?11, and compiling libogc from source.17444
78

edits

Navigation menu