Subject: debugging FvwmIconMan

From: [email-masked]
Date: Thu, 12 Nov 1998 13:50:14 +0100

I noticed FvwmIconMan is compiled with debug by default.
That should probably be turned off before 2.2. I'd like
to replace the debugging functions with macros too, but
they are called about 400 times in the code (with variable
parameter lists). That should save lots of k's.

What are the needs of the people who are debugging?
Is it ok to just have stderr output or is output to
a file absolutely necessary? That would require more
code, however, I don't think it can be done with macros.

Bye

Dominik
-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Thu, 12 Nov 1998 08:14:06 -0500

> code, however, I don't think it can be done with macros.

stderr is fine for me.

--
Dan Espen                                Phone: (732) 699-5570
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked] (Paul D. Smith)
Date: 12 Nov 1998 09:41:19 -0500

%% [email-masked] writes:

  dv> I noticed FvwmIconMan is compiled with debug by default.  That
  dv> should probably be turned off before 2.2. I'd like to replace the
  dv> debugging functions with macros too, but they are called about 400
  dv> times in the code (with variable parameter lists). That should
  dv> save lots of k's.

You should use (or start with, anyway) the DB(()) macro I added a week
or so ago.  It's defined in fvwmlib.h and the code is in libfvwm.a.

It evaluates to empty when DEBUG is not set, and it evaluates to a
special debugging function (in libs/debug.c) when DEBUG is set.  That
function takes printf-style options (that's why you need double-parens)
and automatically prepends the filename and linenumber where the DB call
originates... like this:

  DB(("Window ID: %d", wid));

Note you shouldn't use \n at the end of debug format strings; they're
added for you automatically.

  dv> What are the needs of the people who are debugging?
  dv> Is it ok to just have stderr output or is output to
  dv> a file absolutely necessary? That would require more
  dv> code, however, I don't think it can be done with macros.

It uses stderr for now, but it would be easy to have it go to a file
instead, and wouldn't require any of the DB() calls to change.

One other thing I wanted to add but forgot to mention in my last email
is a configuration for module name; this would probably require some
kind of DB_INIT() macro that would be called in main() and eval to
nothing without DEBUG, or to a real function call with DEBUG.  It would
take the module name and could optionally create a log file instead of
going to stderr.  Maybe it would set some levels, too.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].