GCC does not inline any functions when not optimizing unless you specify the ‘always_inline’ attribute for the function, like this:
/* Prototype. */
inline void foo (const char) __attribute__((always_inline));
Using "-gstabs" in "Compiler settings -> Other options" instead works for me.Jens, thanks for the suggestion. Unfortunately, it did not solve my problem. Since apparently most CodeBlocks users do not have this problem, I probably have a mingw/gcc/gdb incompatibility. I guess I will have to use another IDE to get my work done and then later try to figure out what my problem is.
This has been determined to be a bug in GCC's debug info generation. I'll be following up on it in the GCC bug tracker in the near future.Any updates on this? I am using your latest and I still can't set breakpoints in header files? Any help would be greatly appreciated.
This has been determined to be a bug in GCC's debug info generation. I'll be following up on it in the GCC bug tracker in the near future.Any updates on this? I am using your latest and I still can't set breakpoints in header files? Any help would be greatly appreciated.
#ifndef WX_SERIALIZE_COMBO_BOX_H
#define WX_SERIALIZE_COMBO_BOX_H
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/split_free.hpp>
#include <wx/combobox.h>
#include "ctrlsub.h"
namespace boost
{
namespace serialization
{
template< class Archive > inline void serialize( Archive & ar, wxComboBox& t, const unsigned int /*file_version*/ )
{
// invoke serialization of the base class
ar & boost::serialization::make_nvp( "wxControlWithItems", boost::serialization::base_object< wxControlWithItems >( t ) );
}
} // namespace serialization
} // namespace boost
#endif
Debuggee process ID: 1128
No source file named D:/devel/Utilities/MetaCapture/wxtools/wx/serialization/combobox.h in loaded symbols.
No source file named D:/devel/Utilities/MetaCapture/wxtools/wx/serialization/combobox.h in loaded symbols.
Per http://www.tdragon.net/recentgcc/devel.php (http://www.tdragon.net/recentgcc/devel.php), I have included a patch in TDM-GCC that fixes rhf's problem.TDragon,
#include "headerbrk.h"
int main()
{
return DoSomething("hi");
}
#include <stdio.h>
inline int DoSomething(const char* blah)
{
printf("%s - blah\n", blah);
return 5;
}
I really need a reproducible test case to work with here, folks.I know, and it is frustrating that I can't come up with a test case as I did for the previous problem. I am currently working on a fairly large program; and every now and then, when I set a break in a header file, the debugger fails. I keep wondering if it is perhaps a problem with the project search directories, but I have not been able to identify anything obvious. Thanks again for your good work.
I shouldn't need to ask this, but are you sure you're compiling without any optimization flags and with debugging info turned on?Yes.
I confirm the same problem. I have a project with headers placed in root project folder and some subfolders. I can not enter breakpoint in headers from start, and now I found that gdb kind of hung in template function, if I enter it by step and than place a new breakpoint inside. WinXP SP3, last TDM gcc. :(I really need a reproducible test case to work with here, folks.I know, and it is frustrating that I can't come up with a test case as I did for the previous problem. I am currently working on a fairly large program; and every now and then, when I set a break in a header file, the debugger fails. <***>
I shouldn't need to ask this, but are you sure you're compiling without any optimization flags and with debugging info turned on?Yes I have them on.
break template_headerbrk.h:12
break "C:\path\to\headerbrk\wxtools\wx\serialization\template_headerbrk.h":12
Before trying it in C::B, I tried it from command-line gdb withThanks. I had tried a few sytax's and now that works. I am not very familiar with gdb.exe so I was trying to follow the earlier post in this thread that was using gdb.exe. I will let my issues rest. Again thanks for your patience and understanding.Codewhich worked fine for me, as didbreak template_headerbrk.h:12
Codebreak "C:\path\to\headerbrk\wxtools\wx\serialization\template_headerbrk.h":12
So I have no idea what the problem on your end is.
And, yes, unless you come up with a scenario that breaks in C::B, I suspect this has gone off-topic.Correct. And sorry for the noise.
<***> So I have no idea what the problem on your end is. <***>I figured out a case (at least, my case). I have a complicated project structure, with sources in the set of folders.
Quote<***> So I have no idea what the problem on your end is. <***>I figured out a case (at least, my case). I have a complicated project structure, with sources in the set of folders.
C::B sets breakpoint as:
"c:/MinGW/run/prj_root/template_header.hpp:13
But in gdb console path to this line looks like:
At c:/MinGW/run/prj_root/v01/../template_header.hpp:13
"v01" is a folder, where template from "template_header.hpp" was instated.
So, if I send to gdb
break c:/MinGW/run/prj_root/v01/../template_header.hpp:13
it works. But C::B can not set a breakpoint properly. :(
See the post:That might be because your issue there is almost entirely unrelated.
http://forums.codeblocks.org/index.php/topic,9744.0.html
But no body replied there. :(
But in gdb console path to this line looks like:If verified, this appears to be a bug in GDB.
At c:/MinGW/run/prj_root/v01/../template_header.hpp:13
"v01" is a folder, where template from "template_header.hpp" was instated.
So, if I send to gdb
break c:/MinGW/run/prj_root/v01/../template_header.hpp:13
it works. But C::B can not set a breakpoint properly. :(
I know, and it is frustrating that I can't come up with a test case as I did for the previous problem. I am currently working on a fairly large program; and every now and then, when I set a break in a header file, the debugger fails. I keep wondering if it is perhaps a problem with the project search directories, but I have not been able to identify anything obvious. Thanks again for your good work.@rhf
@rhfI have been following that thread. The next time I have the problem, which seems to occur only with my larger, more complicated projects, I will definitely try the compiler options. Thanks very much!
I meet the same problem when I'm include an inline function header in many CPP files, then setting brekpoints may fails.
But I have solved the problem by adding GCC options. You can see this post, maybe, it's the cause of your problem.
http://forums.codeblocks.org/index.php/topic,10508.msg73723.html#msg73723