I can't seem to debug in Code::Blocks. I'm using Mingw and it's supplied debugger. I'm on Win7 64bit. After starting the debugger and after a couple "continues" I always get "Program received signal SIGSEGV, Segmentation fault.". Here is the compile log:
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\C++\CodeBlocks Projects\test\
Adding source dir: C:\C++\
Adding file: C:\C++\CodeBlocks Projects\test\bin\Debug\test.exe
Changing directory to: C:/C__~1/CODEBL~1/test/.
Set variable: PATH=.;C:\C++\mingw64\bin;C:\C++\mingw64;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;C:\Program Files (x86)\Windows Live\Shared;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn;c:\Program Files\Microsoft SQL Server\100\Tools\Binn;c:\Program Files\Microsoft SQL Server\100\DTS\Binn;C:\Program Files\Microsoft SQL Server\110\Tools\Binn
Starting debugger: C:\C++\mingw64\bin\gdb.exe -nx -fullname -quiet -args C:/C__~1/CODEBL~1/test/bin/Debug/test.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.6
Child process PID: 6200
Program received signal SIGTRAP, Trace/breakpoint trap.
In ntdll!RtlIsDosDeviceName_U () (C:\Windows\system32\ntdll.dll)
Continuing...
Program received signal SIGTRAP, Trace/breakpoint trap.
In ntdll!RtlIsDosDeviceName_U () (C:\Windows\system32\ntdll.dll)
Continuing...
Program received signal SIGSEGV, Segmentation fault.
In ?? () ()
The following are some typical causes of a segmentation fault:
Attempting to execute a program that does not compile correctly. Some compilers will output an executable file despite the presence of compile-time errors.
Dereferencing NULL pointers
Attempting to access memory the program does not have rights to (such as kernel structures in process context)
Attempting to access a nonexistent memory address (outside process's address space)
Attempting to write read-only memory (such as code segment)
A buffer overflow
Using uninitialized pointers
Can we see some code? "RtlIsDosDeviceName_U()" isn't documented so you shouldn't be using it. It's probably being called internally by ntdll.dll but if that's the case then I would try updating "libntdll.a" in your mingw directory. SIGTRAP and SIGFAULT mean that something is writing where it isn't supposed to, this may or may not be you. We would need to see some code to be sure.
I have not used RtlIsDosDeviceName_U(). I get these errors in any project, and by that I mean with a single file, main.cpp, which is empty. For the sake of it, here it is:
I can't see anything bad there. When I downloaded Code::Blocks, I had to get the compiler separately. The mingw zip was called x64-4.8.1-release-win32-sjlj-rev3, I used the debugger supplied with Mingw in the bin folder.