# FreeBSD Debugging



## seshanp (Nov 8, 2011)

Hello all,

Kindly excuse the trouble please. I am new to FreeBSD and hence this question. I am trying to obtain the real time values of certain variables as well as insert debug statements of my own using the nfsdbprintf macro defined in nfs_serv.c.  However this macro relies upon the definition of the variable NFSSRV_DEBUG.  I searched through the declaration of this variable though the entire tree of FreeBSD code using cscope but could find its appearance in the nfs_serv.c.  I would appreciate if someone who has done this before could share some light into this and provide some guidance so that I could use the nfsdbprintf macro to print some useful debug messages.  FYI, I have already set up the FreeBSD kernel for remote debugging but I am having some trouble in debugging the code that way, hence this email.

Thanking you in advance for your cooperation and inputs.

Seshan


----------



## PseudoCylon (Nov 11, 2011)

You need to define NFSSRV_DEBUG by yourself, like USB_DEBUG and IEEE80211_DEBUG in kernel conf file.

It's preprocessor, so you can ether compile with or without. No runtime configuration is possible.


----------

