Re: a problem of how to debug codes
"Clement Hsu" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Dear Dave: Thanks a lot. I can using DEBUGMSG to debug codes now. Thank you once again. Best Regards, Clement Hsu 2007/1/8, Dave Shield <[email protected]>: > > On 08/01/07, Clement Hsu <[email protected]> wrote: > > But I don't realize how to use DEBUGMSG( ) correct. > > Please see the existing code for examples. > E.g. > > $ cd agent > $ grep DEBUGMSG *.c > > snmp_perl.c: DEBUGMSGTL(("perl", "calling perl\n")); > snmpd.c: DEBUGMSGTL(("snmpd/main", "Bye...\n")); > > > DEBUGMSG takes two parameters - the debug token (as passed to -D) > and the debug string to print. > > If you want to display variable values, use printf-style strings, such as: > > snmp_vars.c: DEBUGMSGTL(("mib_init", "initializing: %s\n", > module_name)); > > > For example: > > > DEBUGMSG("ucdSnmpTutorialMIB Initializing", "\n")); > > I'm sorry - I don't believe that compiles. > Just look at the number of parentheses you've got. > You open one, but close two. > > That's *not* the same as the DEBUGMSG statements in the main code. > Either you're being careless when writing your code, or when copying it > into email messages. Either way, such carelessness makes it much > harder to offer advice. Please try and check what you're doing against > existing code much more closely. Thanks. > > Dave > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users