Page 1 of 1

unable to debug win32 simulator cygwin64

Posted: Fri Mar 31, 2017 3:56 pm
by russian
I've realized that I've lost win32 simulator debugging ability at some point, looking for hints or help please.

========================================================

Scenario #1: cygwin64 toolchain, ChibiOS master. win32-simulator demo as is (it has "-O2 -ggdb" by default I only change "TRGT = i686-w64-mingw32-")

Here's the outcome - https://ibb.co/gctrva :(

========================================================


Scenario #2: cygwin64 gbd works on another project, but not on my ChibiOS project (that's a copy-paste of my http://stackoverflow.com/questions/4312 ... ource-info post)

Under Windows with same i686-w64-mingw32-gcc I have two C++ projects. Both with "-ggdb -g3 -O0" - the smaller not ChibioOS project I can debug in Eclipse but the larger chibiOs one says "No source available". Both projects with " -static-libgcc -static-libstdc++"

I am failing to figure out what breaks it :(

Smaller not ChibioOS project happy gdb:
Image


Larger ChibiOS prodject not happy gdb:
Image

Good makefile: https://github.com/rusefi/rusefi/blob/t ... s/Makefile https://github.com/rusefi/rusefi/blob/t ... s/rules.mk

Bad makefile: https://github.com/rusefi/rusefi/blob/t ... s/Makefile https://github.com/rusefi/rusefi/blob/t ... s/rules.mk

Both projects show symbols with objdump.exe --syms:

Good project symbols: https://github.com/rusefi/rusefi/blob/t ... ts/symbols

Bad project symbols: https://github.com/rusefi/rusefi/blob/t ... ts/symbols

I would like to be able to debug both projects. What am I doing wrong? :(


========================================================


Question#3: what is the official toolchain for Win32 simulator? I am looking at "TRGT = mingw32-" so I've downloaded https://sourceforge.net/projects/mingw/files/ (did they not update it since 2013?) and here are the issues compiling with that toolchain:

10:15:33 **** Incremental Build of configuration Default for project RT-Win32-Simulator.master ****
make -j4 all
'cat' is not recognized as an internal or external command,
operable program or batch file.
'cat' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
Compiler Options
The syntax of the command is incorrect.
mingw32-gcc -c -O2 -ggdb -ffunction-sections -fdata-sections -fno-common -Wall -Wextra -Wundef -Wstrict-prototypes -Wa,-alms=build/lst/ -DSIMULATOR -MD -MP -MF .dep/build.d -I. -I../../../os/license -I../../../os/rt/include -I../../../os/common/oslib/include -I../../../os/common/ports/SIMIA32/compilers/GCC -I../../../os/common/ports/SIMIA32 -I../../../os/hal/osal/rt -I../../../os/hal/include -I../../../os/hal/ports/simulator/win32 -I../../../os/hal/ports/simulator -I../../../os/hal/boards/simulator -I../../../test/lib -I../../../test/rt/source/test -I../../../os/hal/lib/streams -I../../../os/various/shell main.c -o main.o
The syntax of the command is incorrect.
../../../os/common/startup/SIMIA32/compilers/GCC/rules.mk:105: recipe for target 'build/obj' failed
make: *** [build/obj] Error 1
make: *** Waiting for unfinished jobs....
../../../os/common/startup/SIMIA32/compilers/GCC/rules.mk:108: recipe for target 'build/lst' failed
make: *** [build/lst] Error 1
ECHO is off.


Which 'cat' do we depend on? Have I missed cat embedded into mingw32? I am failing to locate a package which would have it.

Re: unable to debug win32 simulator cygwin64

Posted: Fri Mar 31, 2017 5:39 pm
by Giovanni
That "no source available" could indicate a change of source paths, I am not sure about what could cause it...

Giovanni

Re: unable to debug win32 simulator cygwin64

Posted: Fri Mar 31, 2017 5:42 pm
by russian
I've isolated the probelm to using "i686-w64-mingw32-" (32 bit compiler, it comes as one of the options in cygwin64) with cygwin64 version. Once I've switched to cygwin (32 bit) the issue is gone.

Just to reiterate - I have a non-Chibi project where debugger is fine with 32gcc+cygin64. But same pair does not work my ChibiOS project.

Not really a bit deal since an easy workaround exists, just wasted few hours of my life :(