Hi guys,
I'm trying to debug a console project on windows, but I keep getting errors where GDB is ignoring breakpoints and reports the message "no line xx in file "C:\path\to\source.c" "
It is a multi-threaded console app, but I've removed all threads and it still behaves the same! I can successfully set breakpoints in any file under the cpu subdirectory, but not in any of the main files as they all get ignored.
Here's the build log:
gcc.exe -Wall -g -I.\ -c C:\Filter\hal\x86\cpu_support_wave.c -o obj\Debug\hal\x86\cpu_support_wave.o
gcc.exe -Wall -g -I.\ -c C:\Filter\hal\x86\cpu_log.c -o obj\Debug\hal\x86\cpu_log.o
gcc.exe -Wall -g -I.\ -c C:\Filter\hal\x86\cpu_keyboard_thread.c -o obj\Debug\hal\x86\cpu_keyboard_thread.o
gcc.exe -Wall -g -I.\ -c C:\Filter\hal\x86\cpu_dac_wave.c -o obj\Debug\hal\x86\cpu_dac_wave.o
gcc.exe -Wall -g -I.\ -c C:\Filter\hal\x86\cpu_adc_wave.c -o obj\Debug\hal\x86\cpu_adc_wave.o
gcc.exe -Wall -g -I.\ -c C:\Filter\hal\x86\cpu_adc_thread.c -o obj\Debug\hal\x86\cpu_adc_thread.o
gcc.exe -Wall -g -I.\ -c C:\Filter\hal\x86\cpu.c -o obj\Debug\hal\x86\cpu.o
gcc.exe -Wall -g -I.\ -c C:\Filter\pm_app.c -o obj\Debug\pmr_app.o
gcc.exe -Wall -g -I.\ -c C:\Filter\main.c -o obj\Debug\main.o
C:\Filter\main.c: In function 'main':
C:\Filter\main.c:47:9: warning: implicit declaration of function 'CPU_adc_sample' [-Wimplicit-function-declaration]
gcc.exe -Wall -g -I.\ -c C:\Filter\hal\x86\cpu_timer_thread.c -o obj\Debug\hal\x86\cpu_timer_thread.o
gcc.exe -Wall -g -I.\ -c C:\Filter\hal\x86\cpu_timer.c -o obj\Debug\hal\x86\cpu_timer.o
gcc.exe -Wall -g -I.\ -c C:\Filter\eam.c -o obj\Debug\eam.o
g++.exe -o bin\Debug\cpuc.exe obj\Debug\hal\x86\cpu_support_wave.o obj\Debug\hal\x86\cpu_log.o obj\Debug\hal\x86\cpu_keyboard_thread.o obj\Debug\hal\x86\cpu_dac_wave.o obj\Debug\hal\x86\cpu_adc_wave.o obj\Debug\hal\x86\cpu_adc_thread.o obj\Debug\hal\x86\cpu.o obj\Debug\pmr_app.o obj\Debug\main.o obj\Debug\hal\x86\cpu_timer_thread.o obj\Debug\hal\x86\cpu_timer.o obj\Debug\eam.o ..\..\..\..\mingw\lib\libpthread.a pm\lib\x86\libpm.a
Output size is 118.96 KB
Process terminated with status 0 (0 minutes, 2 seconds)
0 errors, 1 warnings (0 minutes, 2 seconds)
and the GDB debugger messages:
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\Filter\
Adding source dir: C:\Filter\
Adding file: C:\Filter\bin\Debug\cpuc.exe
Changing directory to: C:/Filter/.
Starting debugger: C:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet -args C:/Filter/bin/Debug/cpuc.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.7.50.20071127
No line 86 in file "C:\Filter\eam.c".
At C:\Filter\hal\x86\cpu.c:51
Debugger finished with status 0
Yet, of course there IS a line 86 in eam.c. It doesn't seem to be an optimisation problem (i've tried breakpoints all over the code and have optimisation turned off anyway!)
So what am I doing wrong? I'm always convinced it's me that's doing something wrong!
I'm using the latest nightly build SVN8081 on Windows XP. I'm using GDB 7.4 and GCC 4.6.2
Thanks, Brian.