Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: Womble on April 25, 2013, 01:05:29 pm
-
Hi,
I am just in the process of moving a project over to C::B. The project compiles using unity files (i.e. the majority of .cpps are excluded from the build, and are instead included in a small subset of 'unity' files that are included in the build). I think this is a problem for debugging in C::B because as far as I can tell it requires that the original source file where you placed a breakpoint to be included in the build. Is this correct? If i just have a single file (say Test1.cpp ) built with a break point, this will hit as normal. If I include Test1.cpp from Test2.cpp and exclude Test1.cpp from the build, the breakpoint will not hit as the only file that is built is Test2.cpp.
If this is the case, do you think there is any workaround to get this to work? And if it's not the case any ideas what I'm doing wrong?
Thanks!
-
Does it work if you have it compiled normally, without including cpp files in other cpp files?
Does it work with command line gdb?
Do you have a test project?
I think that it should work fine, but I've not tried it.
-
Yes, it works if I compile normally.
I haven't tried with command line, I will try it.
I don't have a test project that I can post here, but I can create one if you'd like. (In theory just creating a new hello world project, and including main.cpp from somewhere else should do the job).
-
(Thanks for the extremely fast reply btw!)
-
Ok I just created a new console project, and excluded main.cpp from the build, and created a file called unity.cpp which included main.cpp. I ran this with a breakpoint in main.cpp and it worked. So it works as expected but there must be something wrong with my project.
In my larger project I get this output:
[debug]> break "/Volumes/MacData/Dev/Blah/Game/Main.cpp:232"
[debug]No source file named /Volumes/MacData/Dev/Blah/Game/Main.cpp.
[debug]Breakpoint 1 ("/Volumes/MacData/Dev/Blah/Game/Main.cpp:232) pending.
I thought the problem would be because Main.cpp is excluded from the project and included in a UnityXX.cpp.
-
I thought the problem would be because Main.cpp is excluded from the project and included in a UnityXX.cpp.
Does it work if you don't use the unity including?
-
I thought the problem would be because Main.cpp is excluded from the project and included in a UnityXX.cpp.
Does it work if you don't use the unity including?
yes
-
(but in case you're suggesting that I simply don't use the unity files, that's not an ideal solution as the build takes *significantly* longer without them).
-
How many cores do you have?
There is no way (if you have more than 1 core), the unity type build to be faster.
-
Unity files are mainly faster because they save time on the opens/closes/seeks on the hard drive of all the files, not the compilation time so we still benefit massively from them.
Anyway it's working now, the unity files that are autogenerated were being generated with all uppercase filenames so it wasn't finding them!
Thanks!
-
Anyway it's working now, the unity files that are autogenerated were being generated with all uppercase filenames so it wasn't finding them!
Heh, ok.