Discussion:
Debugging MinGW's gcc/g++ programs with wdw on Windows
(too old to reply)
Ricardo E. Gayoso
2014-04-08 17:44:40 UTC
Permalink
Raw Message
Hi,
Is it possible to debug with wdw the executables compiled with MinGW's gcc
or g++ ?
I tried -g and -gdwarf-2 -3 -4 without success. I only see assembler.
I tried on WinXP-32 and Win7-64.
I also trigger a memory exception to be sure that wdw is not stopping before
main()
Thanks,
Ricardo
Wilton Helm
2014-04-08 18:20:24 UTC
Permalink
Raw Message
Someone else might know more details. I see both possibilities and
problems. Some of the problems are related to the fact that the other
compilers probably use different calling conventions that OW, but OW
supports a wide variety of calling conventions, so that should be solvable.
The problem might be how to pass that information to the debugger, as I
think it normally gets it from the files. In a similar vein, C++ name
mangling, etc. can vary a lot from compiler to compiler, as well as RTL
calls. Also, OW doesn't support .dll libraries on Linux, which might raise
some problems for gcc.

What you are describing seems to primarily relate to how it acquires the
source code. The program also has to compile the object files with
debugging information, including line number references, in them (and passed
through the linker into the executable) or in a .sym file--in a format OW
can recognize. Otherwise it doesn't know where to look in the source files.
Again, OW supports multiple formats for this information, so it is possible
it could be convinced how to find it.

Wilton
Ricardo E. Gayoso
2014-04-08 20:24:49 UTC
Permalink
Raw Message
Hi Wilton,
Note that I am trying to debug on Windows, not on Linux.
The executable created with gcc is a regular win32 PE executable, thar
requires a gcc library dll, and msvcrt.dll
I read somewhere that SciTech people debug all gcc applications with wdw,
because it is a much better debugger than gdb and its GUIs (CodeBlocks,
etc).
Here
http://www.theinquirer.net/inquirer/news/1018187/-open-watcom-free-compiler-looking-amd64-help
they say "Open Watcom now includes GCC and PowerPC debugging support, so we
do all our debugging is done with Open Watcom".
And this was in 2006.
Ricardo
Post by Wilton Helm
Someone else might know more details. I see both possibilities and
problems. Some of the problems are related to the fact that the other
compilers probably use different calling conventions that OW, but OW
supports a wide variety of calling conventions, so that should be
solvable. The problem might be how to pass that information to the
debugger, as I think it normally gets it from the files. In a similar
vein, C++ name mangling, etc. can vary a lot from compiler to compiler, as
well as RTL calls. Also, OW doesn't support .dll libraries on Linux,
which might raise some problems for gcc.
What you are describing seems to primarily relate to how it acquires the
source code. The program also has to compile the object files with
debugging information, including line number references, in them (and
passed through the linker into the executable) or in a .sym file--in a
format OW can recognize. Otherwise it doesn't know where to look in the
source files. Again, OW supports multiple formats for this information, so
it is possible it could be convinced how to find it.
Wilton
Wilton Helm
2014-04-15 17:35:31 UTC
Permalink
Raw Message
I've not worked with GCC on Windows. I'm not sure how OW deals with gcc
dlls on Windows, since it doesn't support them on Linux. Hopefully someone
else is more familiar with the situation. I'm sure your SciTech quote is
correct, but I don't know if they were using gcc dlls or how they had to
configure it. OWs debugger definitely is nice, I used it for x86 embedded
debugging, and I know gdb is limited.

Wilton
r***@hotmail.com
2014-04-19 23:25:04 UTC
Permalink
Raw Message
Post by Ricardo E. Gayoso
Is it possible to debug with wdw the executables compiled with MinGW's
gcc or g++ ?
It has been reported on this group as working. A long time ago by Michal
Necasec (sorry if name not spelled correctly). The reported compiler was
definately gcc, but the platform might have been OS/2, Linux or Windows.
Post by Ricardo E. Gayoso
I tried -g and -gdwarf-2 -3 -4 without success. I only see assembler.
I tried on WinXP-32 and Win7-64.
OW supports dwarf 2.
Only seeing assembler in the debugger is most likely to indicate one of two
things:
1. WDW does not find the source. (check gcc doc on where it expects source
to
be located, and check the corresponding WDW expectations.
2. Needs additional (releated to debugging) gcc switches, see if any exists
that could influence WDW behaviour.

Unless you already are, test with a tiny hello world sample, and all
(input and
output) files in the same directory.

DLL's should not be a problem (mentioned in another reply) since most such
use MS defined ABI/calling convention and no name mangling.

I have no experience with this situation, but maybe some of this will help.

Roald

Loading...