It's not working for me. I've always had trouble with hitting breakpoints in headers. Here's a few more datapoints to work with:
I'm on Windows Vista, the official MinGW G++ 4.4.0, and CB 8.02. I started a fresh, C++, CB console project, and added the following file, named "tester1.h":#ifndef TESTER1_H
#define TESTER1_H
#include <iostream>
inline void function(){
std::cout << "in function()" << std::endl;
}
struct Foo{
Foo(){
std::cout << "constructing Foo" << std::endl;
}
void bar(){
std::cout << "Foo::bar" << std::endl;
}
};
#endif
Then in main .cpp:int main()
{
cout << "Hello world!" << endl;
Foo foo;
function();
foo.bar();
return 0;
}
I set breakpoints on all the output lines in tester1.h, and on the return 0. Only the latter was hit, with either GDB 6.8 or 7.0. Same results when I named the header tester.h, in case the number in the filename was screwing things up. There path to my project is C:\Users\Fleenor\Projects\DebugTest, no spaces or anything irregular. Mingw is C:\MinGW.
Here is my debug log with GDB 7.0, tester1.h:PATH=.;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\hp\bin\Python;C:\MinGW\bin;C:\Program Files\Subversion\bin;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\TortoiseSVN\bin
Command-line: C:\MinGW\bin\gdb.exe -nx -fullname -quiet -args bin/Debug/DebugTest.exe
Working dir : C:\Users\Fleenor\Projects\DebugTest\
> set prompt >>>>>>cb_gdb:
Reading symbols from C:\Users\Fleenor\Projects\DebugTest/bin/Debug/DebugTest.exe...
done.
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb (GDB) 7.0
Copyright (C) 2009 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:
> directory C:/Users/Fleenor/Projects/DebugTest/
>>>>>>cb_gdb:
> break "C:/Users/Fleenor/Projects/DebugTest/main.cpp:12"
Breakpoint 1 at 0x4013ef: file C:\Users\Fleenor\Projects\DebugTest\main.cpp, line 12.
>>>>>>cb_gdb:
> break "C:/Users/Fleenor/Projects/DebugTest/tester1.h:15"
No source file named C:/Users/Fleenor/Projects/DebugTest/tester1.h.
Breakpoint 2 ("C:/Users/Fleenor/Projects/DebugTest/tester1.h:15) pending.
>>>>>>cb_gdb:
> break "C:/Users/Fleenor/Projects/DebugTest/tester1.h:12"
No source file named C:/Users/Fleenor/Projects/DebugTest/tester1.h.
Breakpoint 3 ("C:/Users/Fleenor/Projects/DebugTest/tester1.h:12) pending.
>>>>>>cb_gdb:
> break "C:/Users/Fleenor/Projects/DebugTest/tester1.h:7"
No source file named C:/Users/Fleenor/Projects/DebugTest/tester1.h.
Breakpoint 4 ("C:/Users/Fleenor/Projects/DebugTest/tester1.h:7) pending.
>>>>>>cb_gdb:
> run
gdb: windows_init_thread_list
gdb: kernel event for pid=2840 tid=3476 code=CREATE_PROCESS_DEBUG_EVENT)
[New Thread 2840.0xd94]
gdb: kernel event for pid=2840 tid=3476 code=LOAD_DLL_DEBUG_EVENT)
gdb: Loading dll "C:\Windows\system32\ntdll.dll" at 0x76e30000.
gdb: kernel event for pid=2840 tid=3476 code=LOAD_DLL_DEBUG_EVENT)
gdb: Loading dll "C:\Windows\system32\kernel32.dll" at 0x76bb0000.
gdb: kernel event for pid=2840 tid=3476 code=LOAD_DLL_DEBUG_EVENT)
gdb: Loading dll "C:\Windows\system32\msvcrt.dll" at 0x75720000.
gdb: kernel event for pid=2840 tid=3476 code=LOAD_DLL_DEBUG_EVENT)
gdb: Loading dll "C:\MinGW\bin\libgcc_s_dw2-1.dll" at 0x6e940000.
gdb: kernel event for pid=2840 tid=3476 code=EXCEPTION_DEBUG_EVENT)
warning: Can not parse XML library list; XML support was disabled at compile time
gdb: kernel event for pid=2840 tid=3476 code=EXCEPTION_DEBUG_EVENT)
Breakpoint 1, main () at C:\Users\Fleenor\Projects\DebugTest\main.cpp:12
C:\Users\Fleenor\Projects\DebugTest\main.cpp:12:168:beg:0x4013ef
>>>>>>cb_gdb:
> info locals
foo = {<No data fields>}
>>>>>>cb_gdb:
> info args
No arguments.
>>>>>>cb_gdb:
> bt 30
#0 main () at C:\Users\Fleenor\Projects\DebugTest\main.cpp:12
>>>>>>cb_gdb:
> quit
gdb: windows_close, inferior_ptid=2840
The interesting part of course is where it still says "No source file named C:/Users/Fleenor/Projects/DebugTest/tester1.h." I wonder if it could be something to do with the different slash types, but it seems like that would have been fixed a long time ago.
I don't really want to do anything to further confuse my installation, but would TDM help me? Is the only way to know to try? I'll attach my project in 7z format, if anyone wants to see if they can reproduce my behavior, or show non-reproducibility on their system.
[attachment deleted by admin]