[ns] how to find where a variable is initialized

Daniel Dekst dolkoff at yahoo.com.cn
Sat Oct 4 12:52:29 PDT 2008


Hi, Mubashir,
   
  Thanks a lot!
  Usually I can find where a variable is defined (in which Class) but it is difficult to find out who call a command to change it.
   
  In this case, cache_node_count_ is defined in class Mac802_11 and is initialized to 0. Fortunately I notice that there is a command "nodes" in mac-802_11.cc that can change the value of cache_node_count_ and using gdb I see it is indeed executed here, but who call the command and when?
   
  Previous answers show it is related to mobile/god.h/cc and I found there exists commands related to nodes number. And I also thought it might has some relationship with node construction. So I read tcl/lib/ns-mobilenode.tcl and finally understand it --  "$mac nodes [$god_ num_nodes]". It is here changes the value of cache_node_count_.

  I'm lucky to find it without too many troubles, but is there any method that can list all tcl files which will call a certain command?
   
  Best,
  Pei
  
Mubashir Rehmani <mshrehmani at gmail.com> wrote:
    Hi Daniel Dekst,

You can find the variables here
http://www-rp.lip6.fr/ns-doc/ns226-doc/html/functions.htm

Regards

Mubashir Husain Rehmani

  2008/10/4 Daniel Dekst <dolkoff at yahoo.com.cn>
  

Hi, everyone,

How to find where a variable is initialized ?
I add a new mac same as mac-802_11, but it puts warning
MAC_RMAC: accessing MAC cache_ array out of range (src 0, dst 1, size 0)!
I found out that it is due to cache_node_count_ = 0.
It must be set somewhere in MAC/802_11, but I do not know where to find it. I think it might be in a .tcl file.
Any help is appreciated!

Best,
Pei



--------------------------------




-- 
Mubashir Husain Rehmani

Mobile :   00 33 (0)6 32 00 89 35




       
---------------------------------
 ÑÅ»¢ÓÊÏ䣬ÄúµÄÖÕÉúÓÊÏ䣡


More information about the Ns-users mailing list