So, after a few tries I finally managed to install GDB and Insight succesfully with this toolchain on MinGW Win32. Furthermore, it works OK with dc-tool-ip 1.0.4 in MinGW and I can debug lots of things now

The steps are not so trivial, but if you managed to compile this toolchain, then you will have succeed with that one.
PREPARATION AND INITIAL NOTES1 ) Check that 'wget' is installed in your system. In MinGW, you can download binaries here:
http://downloads.sourceforge.net/mingw/ ... RT.tar.bz2 2 ) GCC 4.5.2 needs GDB 7.0.50 or above by specifications. If you try to compile GDB 6.7.1 (default version)... it will fail
If you only want to compile GDB (for hard guys!):a ) Open Makefile and change GDB version to 7.0.50 (tested and worked), or 7.2.
Code:
make gdb
Go take a cofee / beer / drink of your desire, and wait to compile it. If everything is OK, you will have a new
sh-elf-gdb.exe file.
If you want to compile Insight (recommended):1 ) When you compile Insight, you will compile also GDB + Tcl/Tk (a graphical library that Insight uses).
2 ) The Insight version is in pair with GDB version (i.e. Insight 7.2 means that it has GDB 7.2).
3 ) Any clean version of Insight will fail to compile in a MinGW environment.
4 ) The 7.0.50 version of Insight (snapshot) worked for me. I tried latest CVS 7.2 but it gave me errors. So, I'll use this version in this mini How-to.
COMPILE INSIGHT1 ) Download manually this version of Insight: insight-weekly-CVS-7.0.50-20091130.tar.bz2 . You can get from here:
ftp://sourceware.org/pub/insight/snapsh ... 30.tar.bz22 ) Rename the file to: insight-7.0.50.tar.bz2
3 ) Uncompress everything in
dc-chain folder (so, there should be a new
src folder inside dc-chain).
4 ) Download the MinGW patch (see attachments), extract the content in
dc-chain folder, and apply it:
Code:
patch -p1 -i insight-mingw.patch
5 ) Now, rename the 'src' folder to: 'insight-7.0.50'
6 ) Open Makefile and change the Insight version to: 7.0.50
7 ) Create the following fake file to cheat Makefile:
Code:
touch unpack_insight_stamp
8 ) Finally, time to compile! (and cross fingers hehe).
Code:
make insight
The process is quite slow (less than building toolchain, but enough to go out and take a walk). If everything is fine, you will have two new exes: sh-elf-gdb.exe and sh-elf-insight.exe.
COMPILE DC-TOOLThis GDB will only work with
latest SVN version of dc-tool. I remark the SVN because it won't work for any of the 1.0.4 binaries that I found on the Internet. You need to compile dc-tool-ip (or dc-tool-serial) with your new and shiny toolchain, and then burn into a CD the Dreamcast binary (make-cd) folder.
1 ) In Makefile.cfg, I had to add one more library to compile dc-tool (and change paths). It should be like this
Code:
# MinGW
# these must point to your sh-elf bfd, not the system one
BFDLIB = -L/usr/sh-elf/lib -lbfd -lintl -liberty -lws2_32 -lwsock32
BFDINCLUDE = /usr/sh-elf/include
2 ) Remember to check other configs (like the Dreamcast IP in the IP version). When ready, 'make' and 'make install'
3 ) If you want to use BootDreams to burn the Dreamcast binary, you have to use the scramble utility first on the 1st_read.bin:
http://mc.pp.se/dc/files/scramble.cIn this post I won't explain how to use these tools (there is a good tutorial in the DDEr4 package), but if anyone needs help I'll explain a bit about them.
Happy debugging!!