User forums > Help

Debug problem with header files

<< < (3/6) > >>

rhf:

--- Quote from: TDragon on April 09, 2009, 04:52:36 pm ---Per http://www.tdragon.net/recentgcc/devel.php, I have included a patch in TDM-GCC that fixes rhf's problem.

--- End quote ---
TDragon,
Just a quick note. You did indeed fix the header problem as you describe - which I really appreciate. However, when I migrated from your  gcc-4.3.2-tdm-2 to gcc-4.3.3 tdm-1, I began to have problems again. This is much more sporadic than before, however; and I have not been able to develop a small consistent test example. In fact, I tried to restore my system back to your gcc-4.3.2-tdm-2 release to see if perhaps the problem actually existed with the earlier version and that I had just overlooked it. Unfortunately, I have not been able to get your binaries for that previous release.

RJP Computing:
It really seems like it has to be a header only (no .cpp) file to get the issue I am describing. Maybe that is what you are seeing.

RJP Computing:
Do you think it has to do with the fact that it is an inline function. Can gdb debug those functions?

TDragon:
I really need a reproducible test case to work with here, folks. The following works fine for me.

headerbrk.c

--- Code: ---#include "headerbrk.h"
int main()
{
return DoSomething("hi");
}

--- End code ---

headerbrk.h

--- Code: ---#include <stdio.h>
inline int DoSomething(const char* blah)
{
printf("%s - blah\n", blah);
return 5;
}

--- End code ---

Add to a new console project in C::B, open headerbrk.h and set a breakpoing on the printf line, start debugging, and the breakpoint is hit without any problems. Using GCC 4.3.3 TDM-1.

I shouldn't need to ask this, but are you sure you're compiling without any optimization flags and with debugging info turned on?

rhf:

--- Quote from: TDragon on April 10, 2009, 05:38:33 pm ---I really need a reproducible test case to work with here, folks.
--- End quote ---
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.

--- Quote from: TDragon on April 10, 2009, 05:38:33 pm ---I shouldn't need to ask this, but are you sure you're compiling without any optimization flags and with debugging info turned on?

--- End quote ---
Yes.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version