OS/2, eCS & ArcaOS - Technical > Programming

Only short exceptq report although .xqs file was there, why?

<< < (3/4) > >>

Dave Yeo:
Hi Andy, sorry, I didn't realize that you were compiling with OW when I posted.
DBG vs XQS: DBG has more info to find where the error occurred. XQS are small and give enough info much of the time. I feel that it is best to add the XQS files to your package and have the DBG files available if needed. I don't know how well exceptq handles the OpenWatcom debug format.
You should be able to add the symfile directive to your wlink options

I see your linking with wl, wl is for GCC, handles dwarf style debug info. Using wc386, you should probably link with wlink. Perhaps this is your problem producing debug info, '-d2 -dDEBUG_BUILD' is what the screensaver uses.
wc386 only produces HLL debugging info and that's currently it. You have to use the OW debugger.
Might of got confused about debugging styles, GCC -Zomf -g produces files that can be debugged in idebug, OW doesn't so your left with its debugger.

Andi B.:

--- Quote from: Dave Yeo on January 22, 2022, 06:48:52 pm ---OK, use something like 'LDFLAGS=-Zlinker option symfile=xxx.dbg' ...

--- End quote ---
Doing this leads to missing debug info (c source code) for wdw :-(

This would be no problem when I got idebug debug info instead. But unfortunately no.

Dave Yeo:
Sorry, I was thinking GCC, for OW, I think you'd want something like this,

--- Code: ---wlink NAME main SYSTEM os2v2 OPTION symfile=PCM9362_ANETCOM.dbg OPTION MAP=main.watmap debug all lib pmprintf.lib file { main.obj }

--- End code ---
Hmm, testing it doesn't seem to work here. Anyways see the SYMFILE option in the OW Linker Guide

Andi B.:
Ok, now a bit offtopic but as you're here ...

I want to use different scenarios -

* compile with OW (wcc382), link with wl or wlink, debug works but only with wdw (idebug would be better so ...)
* compile with gcc, link with wl or wlink, debug with idebug (or wdw)
* compile with gcc, link with gcc, debug with idebug (think this works cause I did that in the past with wpa_supplicant, have to check again)
I'm currently struggling with 2. as I don't find the right libraries which I need to link with. I now realize that if my memory serves me well and 3. really works then it would be better to skip 2. and use 3. only. But wait, there is a ticket about debug problems and Lars comment that this does not work correct....

For new projects I want to circumvent ICC cause it's missing language extension, its slow compile time, not so good error checking.....

Dave Yeo:
OK, as you know, #1 only works with OW tools.
I think perhaps your understanding of how GCC works is incomplete. GCC itself will call the linker.

--- Code: ---gcc -g test.c -o test.exe
--- End code ---
will compile test to an aout object file and link with ld.exe, it won't produce a debuggable binary (it did way back)

--- Code: ---gcc -g -Zomf test.c test.exe
--- End code ---
Will convert the aout object file to omf and link with emxomfld.exe, which depending on environment settings will massage the command line for a native linker,

--- Code: ---Environment variables:
    The type of linker we're using. Values: WLINK, VAC365, VAC308, LINK386.
        WLINK    wlink.exe from Open Watcom v1.5 or later.
        VAC365   ilink.exe from IBM C and C++ Compilers for OS/2 v3.6 or later.
        VAC308   ilink.exe from Visual Age for C++ v3.08.
        LINK386  link386 form OS/2 install or DDK.
    Name of the linker to use and optionally extra parameters. Spaces in the
    linker name or path is not supported. Quotes are not supported either.
The default values for these two variables are VAC365 and ilink.exe.

--- End code ---
There's also environment variables for rc, run emxomfld without arguments to see all options.
So while it is possible to link directly with wlink, it is tricky and really you should use GCC to link.
Both of these work, (going from memory)

--- Code: ---gcc -g test.c -o test.o
gcc -g -Zomf test.o -o test.exe

--- End code ---

--- Code: ---gcc -g -Zomf test.c -o test.o
gcc -g -Zomf test.o -o test.exe

--- End code ---

With CFLAGS=-Zomf, things can get more complex, static libs use emxomfar instead of ar, ranlib will fail on a omf static lib, do SET AR=emxomfar, SET RANLIB=ECHO for that scenario.
Usually omf libs end in .lib and aout ones in .a


[0] Message Index

[#] Next page

[*] Previous page

Go to full version