I tried installing the last nightly build and tdm gcc. There where other issues involving the Linux project I want to build. This project builds and runs error free on 32 & 64 bit Linux and builds fine with "Codeblocks-10.05mingw-setup.exe". Just needs some Windows specific fixes relating to drive letter, linked files and large files.
This is the test code:
main.c:
#include <stdio.h>
#include <stdlib.h>
int sub(void);
int main(int argc, char** argv)
{
int ret;
ret = 99; /*Set beak point here,
then single step with 'F7' & 'Shift F7')*/
printf("I am in main.c!\n");
ret = sub();
printf("I am back in main.c!\n");
return 0;
}
------------------------
sub.c:
#include <stdio.h>
#include <stdlib.h>
int sub(void);
int sub(void)
{
int ret = 1;
printf("I am in sub.c!\n");
ret = 0;
return ret;
}
After installing and updating to the latest MinGW version I get this Debug Output:
PATH=.;Y:\MinGW\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
Command-line: Y:\MinGW\bin\gdb.exe -nx -fullname -quiet -args bin/Debug/Test.exe
Working dir : Y:\Test\
> set prompt >>>>>>cb_gdb:
Reading symbols from y:\test\bin\debug\Test.exe...done.
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set debugevents on
>>>>>>cb_gdb:
> set new-console on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> catch throw
Function "__cxa_throw" not defined.
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source Y:\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory Y:/Test/
>>>>>>cb_gdb:
> break "Y:/Test/sub.c:10"
Breakpoint 2 at 0x4013c4: file Y:\Test\sub.c, line 10.
>>>>>>cb_gdb:
> break "Y:/Test/main.c:10"
Breakpoint 3 at 0x401415: file Y:\Test\main.c, line 10.
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
[New Thread 312.0x71c]
Line number 10 out of range; Y:\Test\main.c has 1 lines.
Breakpoint 3, main (argc=1, argv=0x601088) at Y:\Test\main.c:10
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> next
Line number 12 out of range; Y:\Test\main.c has 1 lines.
>>>>>>cb_gdb:
> whatis argv
type = char **
>>>>>>cb_gdb:
> output argv
(char **) 0x601088>>>>>>cb_gdb:
> output argv
(char **) 0x601088>>>>>>cb_gdb:
> next
Line number 13 out of range; Y:\Test\main.c has 1 lines.
>>>>>>cb_gdb:
> step
Line number 8 out of range; Y:\Test\sub.c has 1 lines.
sub () at Y:\Test\sub.c:8
>>>>>>cb_gdb:
> next
Line number 10 out of range; Y:\Test\sub.c has 1 lines.
Breakpoint 2, sub () at Y:\Test\sub.c:10
>>>>>>cb_gdb:
> next
Line number 11 out of range; Y:\Test\sub.c has 1 lines.
>>>>>>cb_gdb:
> next
Line number 12 out of range; Y:\Test\sub.c has 1 lines.
>>>>>>cb_gdb:
> next
Line number 13 out of range; Y:\Test\sub.c has 1 lines.
>>>>>>cb_gdb:
> next
Line number 14 out of range; Y:\Test\main.c has 1 lines.
main (argc=1, argv=0x601088) at Y:\Test\main.c:14
>>>>>>cb_gdb:
> next
Line number 15 out of range; Y:\Test\main.c has 1 lines.
>>>>>>cb_gdb:
> next
Line number 16 out of range; Y:\Test\main.c has 1 lines.
>>>>>>cb_gdb:
> next
250 ../mingw/crt1.c: No such file or directory.
__mingw_CRTStartup () at ../mingw/crt1.c:250
in ../mingw/crt1.c
>>>>>>cb_gdb:
It appears that the source file line numbers are somewhere screwed up.
Hans