← Back to team overview

yade-users team mailing list archive

Re: A strange glibc error when modifying StandAloneEngine:PositionOrientationRecorder

 

Feng, Chen said:     (by the date of Mon, 10 Apr 2006 18:10:25 -0400)

> I think I happened to find the solution for this glibc error by accident is 
> that after you have modified poisitionOrientationRecorder.cpp and compiled it, 
> you also have to recompile SDECSpheresPlane.cpp accordingly, which I guess 
> there is some dependency relationship between them?

oh, yes. I thought it's obvious, sorry. Everytime you modify a *.hpp
file you must recompile everything that #includes that *.hpp file.

(I think I should also add this to some FAQ, that is still waiting to be written :)

But you can modify *.cpp files and you don't need to recompile anything
more, just that one .cpp.

In fact that exactly explains the problem you had - "cannot add more that
7 variables". Because the compiler reads .hpp file and from that can
know how much memory a class will consume. If those calculations are
obsolete (ie. are from _before_ your modifications), then nothing can work :)

 
> (1) The universal way, add std::cerr<<xxxxxx;

ok :)

> (2) Use the gdb or ddd, however up till now I only managed to use gdb to debug 

recently I discovered that cgdb is quite useful, once you get through
the short help. Allows to set breakpoints, view highlighted code, etc...
But if we talking about this, then in fact kdevelop's built-in debug frontend
has similar functionality (but I don't like using it) :)

> the separate libxxx.so files, I didn't succeeded in breaking the shared 
> library files using ddd or something else.

yes, that's why I created a directory yade-flat, invoke
./yade-scripts/makeFlat and it will fill yade-flat directory. Then open
flat.kdevelop. Then inside kdevelop you must update a list of files in
the project - in the qmake manager delete (not from hard disc ;) all
files beloging to the project, and add them all again. I always do that,
because very often I'm adding/removing some files, and that's the
fastest way to update qmake manager project in kdevelop. I hope it's
clear.

When you compile it, you will have one huge file, of size about 200MB
(so huge because of all the debug info). And no shared libraries at all.
So now when you have a single file, there is no problem with debugging
separate files. But there is one thing to take care of - make sure that
plugins directory for yade contains plugin files. That huge 200MB file
will not load them (becasuse they are already inside), but will check
this directory, just to see what classes are _available_. It's a bug of
flat yade version... but it's not causing any trouble.

> (3) I didn't find way to debug inside KDevelop, can we do that?

In the upper menu, in kdevelop there is a position "debug", just between
"build" and "scripts", this should work - sometimes I'm debugging
yade-flat inside kdevelop. But still if it's not working for you - you
can use gdb, ddd or cgdb on that 200MB file - and it must work.

-- 
Janek Kozicki                                                         |
_______________________________________________
Yade-users mailing list
Yade-users@xxxxxxxxxxxxxxxx
http://lists.berlios.de/mailman/listinfo/yade-users



References