[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Who calls random()?
Hi, thank you for your suggestion.
> To find who's calling the function, run your program in a debugger and
> do a backtrace.
As I described in
http://www-mash.cs.berkeley.edu/dist/archive/ns-users/9908/0130.html
I also used xxgdb for debugger.
When I run nam using xxgdb, It starts from main() in nam-1.0a7/main.cc,
and from line # 310 of main.cc
Otcl_Init(interp);
it goes into otcl-1.0a4/otcl.c line # 2018, and after a lot of steps, it goes back
to nam-1.0a7/main.cc line # 318.
And from this line (#318)
Tcl::init(interp, appname);
it goes into nam-1.0a7/enetmodel.cc line # 31.
Then after a few steps, suddenly random() is called more than 400 times,
and nam Console window comes out.
The xxgdb doesn't goes into random.cc but I got a lot of error messages
from printf in random.cc.
So who calls random()???
Do you know more usefull way than I did?
Thanks in advance.
Mikihiro Ueno