User forums > Using Code::Blocks

GDB troubles

(1/1)

sebarnolds:
Hi !

Here is my situation : I have a workspace with several projects (DLLS and one exe). Some DLLs contains base classes (which are abstract because of pure virtual functions) and some other DLLs contains classes which inherit from these base classes.

Now, how can I tell GDB to use all the symbol files (it seems he only loads the symbols of the current project).

Besides, if I put a breakpoint in my sourcecode, it doesn't manage to stop on that line (I'm sure it reaches it), it is as if no breakpoint was set. I tried on a small project with only one source file and the breakpoint works, but I want it to work with my projects. I uninstalled codeblocks and mingw and installed lastest version (which included mingw), but it doesn't seem to make any change.

Any advice ?

Thanks.

grv575:
1.  compile all dlls with debugging symbols
2. add all dll project .lib files to the exe project link libraries tab

that work or no?

tiwag:

--- Quote from: sebarnolds on August 10, 2005, 08:56:21 am ---..I put a breakpoint in my sourcecode, it doesn't manage to stop on that line...

--- End quote ---
this happens (unfortunately) very often when using gdb

--- Quote ---Any advice ?

--- End quote ---
one technique which works sometimes is to set a breakpoint in the dllhelper and start debugging.
when gdb breaks in the dllhelper, the go to the source file of the dll and set the breakpoint there
and continue debugging.
or you can compile "a HARD breakpoint" into you code

--- Code: ---__asm("int3");
--- End code ---

attached is a sample project rename it to "debug_dlls.zip",
its an ordinary zip file, but the forum software
doesn't allow to post *.zip's therefore its renambed to *.txt
open "debug_dlls.workspace" and do Compile->Rebuild All Projects
and then start a debugging session "F8"

[attachment deleted by admin]

sebarnolds:
Hi !

grv575 >> Thanks but I already checked the debugging symbols. I will try your second advice.
tiwag >> Thanks, I will check this file out.

Thanks for your help.

sebarnolds:
Yeah, I looked at it and finally, I think I will use the hard-coded version, it seems to work well.

Now, another problem : I have a class in a DLL which inherits from a class in another DLL. GDB isn't able to display the values of inherited members.

Here is a sample :

--- Code: ---class A
{
protected :
   int a;
};

class B : public A
{
public :
   int b;
}

--- End code ---

For an instance of B, GDB is able to display the value of "b" but not the value of "a" (in the "watches" panel).

Any idea ? Thanks.

Navigation

[0] Message Index

Go to full version