Author Topic: Support for Open Watcom toolchain now fixed, includes debugger  (Read 4728 times)

Offline tim_c

  • Single posting newcomer
  • *
  • Posts: 5
Support for Open Watcom toolchain now fixed, includes debugger
« on: October 22, 2008, 10:00:53 pm »
Over the past months I have worked on and acheived satisfactory compiling, linking and debugging using Open Watcom from CB, but I have had no feedback from other people so mileage may vary. No work has been done on cross targeting, Linux, DOS, OS/2 and so on.

When Watcom was originally added to CodeBlocks the developers hit a fatal problem, they could not get GDB to work with Watcom PE format Win32 executables, so whilst basic detection, compile and linking worked there was no debugger.

Config
No changes are required to CodeBlocks 8.2 itself with the already implemented Open Watcom support working fine, just minor configuration changes easily done by a user. Works with the standard Watcom install which you have to do separately. CodeBlocks knows about Watcom so it should autodetect a valid install.

Debug is now good but using the Watcom GUI debugger WDW for Watcom produced binaries and can debug project DLL
(hint, set a trigger on binary image load)
The debugger is simply called as an external tool to CB and is the solution to debugging using the Watcom toolchain where CB is the IDE.
It is a full Windows GUI based debugger designed for GUI use. (there is also a text window version for special uses)
Details on how to set this up are on the Open Watcom Wiki.
Is here http://www.openwatcom.org/index.php/Configuring_Code::Blocks
This has no side effects on a mingw32 installation and either toolchain can be used.

Target debug/release switching operates as normal.

No it does not step source in CB. Displays the source itself.

Target toolchain versions
Works using Watcom 1.7a (long time stable and current) and with the soon to be released 1.8, where the main change is improvements to the C++ compiler, an ongoing work. As a reminder the fork of WASM to JWASM gives MASM compatibility if needed for assembly work.
http://www.japheth.de/JWasm.html

Premake (project has no connection with Watcom)
Support has been added to Premake in release 3.7, http://premake.sourceforge.net/, a make make which uses Lua as it's scripting language. This is small using a single static linked executable and automatically creates a GUI project with debug and release versions.

Either toolchain of MIngw32 or Watcom can be targetted as a CodeBlocks IDE project.
--target cb-gcc or --target cb-ow

With a well set up project switching toolchain takes a few seconds.

It works by writing out XML format configuration files for CodeBlocks. Under Win32, double click on the result and CB is invoked with the project ready to roll.

Cross target
I have not attempted cross targeting such as Linux, OS/2, DOS etc. nor remote debug but that should just be an exercise (WDW can use almost any link and is most often used for debugging cross compiled such as embedded DOS, as well as some self targetting such as for GUI work)

About Open Watcom
You can read about this on their wiki but I'll add some words here.
The audience tend to be people dealing with embedded, unusual applications, Fortran. It is ex full commerical and this tends to show in maturity and flexibility. The default passing method is register with possibly more of a Borland than GCC flavour.
The entire toolchain sources if wanted are available for download (you end up wth circa 150,000 files so only if you need it). A build takes about an hour on a modern PC.
(Automated builds with test suite are done daily, this is taken seriously. The repository uses a Perforce licence their donation to OSI projects)
Watcom is tied to neither GNU nor Microsoft, tending to avoid dependencies.

OS targets are Linux (should be considered immature), Win 32, Win 16, DOS 16, DOS 32, DOS extender, OS/2, NLM. (QNX is no longer supported, closed source)