Bug #13866 2008-05-24 10:22

u2227

Cannot debug included files if their extension is not "cpp"

----sample.l-----

test() {

int i = 123;

}

---main.cpp---

#include "sample.l"

void main() {

test(); /// click Step-In here, got debugger frozen.

return 0;

}

Category
Debugger
Group
 
Status
Closed
Close date
2011-04-09 21:44
Assigned to
tpetrov
u2227 2008-05-24 10:28

if you set a break point in test(), I have two variants of behavior:

1) breakpoint is never even reached, program just continues.

2) breakpoint is reached but the execution point is not displayed, although I can see the local variable test()::asd

Run to cursor in sample.l::test() will never be reached.

I tried to fix that myself, I believe should see in plugin/contrib/gdb.. but I got no clue when I looked in there. I think I might be able to fix this if someone give me some hints where to look.

u2227 2008-05-24 10:32

I use FreeBSD, GCC, GDB.

Also I believe this report might be related to this:

BUG 10443

https://developer.berlios.de/bugs/?func=detailbug&bug_id=10443&group_id=5358

u2227 2008-05-24 10:51

OK, one more thing, I found that this might be not CodeBlocks problem at all!

(gdb) break /home/sample.l:3

No source file named /home/info.l.

Make breakpoint pending on future shared library load? (y or [n]) n

needless to say, the file is actually there.

u2227 2008-05-24 11:06

Even more details are coming :)

I updated GDB from 6.1.1 to 6.6

Now I can set a breakpoint in the GDB!!

But not in codeblocks.

I am sure CodeBlocks is using the new version, it outputs that in "debugger" tab.

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

1:03 /home gdb -q -f /home/test

(gdb) b /home/sample.l:3

Breakpoint 1 at 0x804c476: file /home/sample.l, line 3.

(gdb) r

Starting program: /home/test

Breakpoint 1, test () at /home/sample.l:3

▒▒/home/sample.l:3:18:beg:0x804c476

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

u2227 2008-05-24 11:16

Ok, with the new GDB, I think breakpoints are working, run to cursor is working.

But the execution point is not updated. So the focus doe snot switch to the included file and there fore not to the included function. But You can still debug if you manually open the given file and locate the function, theline is not highlighted, but you can even step over and see locals. This must be another bug in GDB?