Alexander Mai wrote:
>
> On Fri, 09 Mar 2001 18:35:15 -0500, Todd Denniston wrote:
>
> >Guys,
> >I have been searching for information on how to use DEBUGSOURCES to find the
> >problem I am having in my program, unfortunately there is very little in the
> >source distribution + web pages and nothing other than find|grep to direct you
> >to it. May I suggest that the following which is a compilation of knowledge
> >that I have been able to find be, as Jon A. Christopher suggested (Sept. 99),
> >placed either into a file called HACKING or appended to BUG-REPORTING, and
> >then committed to the repository.
> [...]
>
> DEBUGSOURCES is referenced more than once so far,
> our new (upcoming) lesstif.1 does and what you cite looks
> similar to BUG-HUNTING.html in our doc/www.lesstif.org directory ...
>
Ok, looking at the _CVS_ doc/www.lesstif.org/BUG-HUNTING.html, yes it looks
like it is there, just was not in the 92.6 distro. (and you have another help
pointer there yea)
you still need a pointer like
For more info on DEBUGSOURCES & DEBUG_FILE look in the source file
lesstif/lib/Xm/DebugUtil.c
or include that material (comment at ~line 52 to 70) in the BUG-HUNTING.html,
it is just clearer and fuller than what was in the page.
> >and now to my current question:
> >
> >why is it that when I run my app as
> >DEBUGSOURCES=all ./app_gui -sync > lt926run.log8 2>&1
> >it seems to put all the runtime debug (stuff that occurs after XtAppMainLoop
> >is called) info after the run of the app, I expected it to be mixed in with my
> >apps printf lines so I could see where stuff, resizes and redraws, was
> >happening.
>
> Your "printf()" are sent to stdout, we write to stderr.
hehe, I suppose I could 'use the source' and send DebugUtil.c ouput to stdout
:)
looks like only two places to change, or perhaps set DEBUG_FILE=stdout
Please find quick patch included.
> Out of my mind I can't really say what effects might happen there.
> (is buffering an issue here? just today I explicitly tried to turn off
> buffering even for stderr in DebugUtil.c)
>
> >And is what is dumped at the end just one dump of the last state
> >of the app or does it contain the info in a form similar to what I was looking
> >for just all scrunched together?
> >
> >Note:
> >DEBUGSOURCES=all ./app_gui -sync >& lt926run.log7
> >looks the similar, but I did not get a dump at the end (probably because of ^C
> >to end).
> >
<SNIP>
> >Thanks for any help you can give or suggest.
> >--
>
> dump = core dump?
> This is the last state of the application and useless to us anyway
> since it's only really useful on exactly the same system
> (or a "clone" of it).
No, the program does not die, it runs fairly well except this visual problem.
by dump I mean it looks like my program runs untill I issue ^c and then the
lesstif debug info gets put into the log file, instead of the lesstif info
being mixed into my progs output.
>
> A DEBUGSOURCES=all statement is not a good idea in almost any case,
> it produces too much output.
Problem is I am not sure what is causing it so I just dumped everything hoping
I could see something and then narrow in.
> The approach of trying to design a small app which feature the
> same problem or at least to a specific widget has not many alternatives ...
yep, I just wish it was not such a big program to begin with (15K lines) so I
could easily see the interactions.
>
> ---
> Alexander Mai
> [EMAIL PROTECTED]
Index: DebugUtil.c
===================================================================
RCS file: /cvsroot/lesstif/lesstif/lib/Xm/DebugUtil.c,v
retrieving revision 1.54
diff -u -r1.54 DebugUtil.c
--- DebugUtil.c 2001/03/09 09:25:09 1.54
+++ DebugUtil.c 2001/03/10 00:52:57
@@ -107,11 +107,23 @@
else
#endif /* HAVE_GETPID */
{
- strcpy(fn, s);
+ if (strcmp(s, "stdout") == 0)
+ {
+ /* the user wants to mix our output with the users own program
+ * standard out.
+ */
+ XdbFile = stdout;
+ return;
+ }
+ else
+ {
+ strcpy(fn, s);
+ }
}
/* "a" means append, create if doesn't exist */
XdbFile = fopen(fn, "a");
+ /* if fopen fails do something sensible */
if (XdbFile == NULL)
{
XdbFile = stderr;
patch end--------------------------------------------------------------
--
______________________________________________________________________________
Todd Denniston, Code 6067, NSWC Crane mailto:[EMAIL PROTECTED]
Phone : (voice)(812)854-3993 (fax): (812)854-3437
I'd crawl over an acre of 'Visual This++' and 'Integrated Development
That' to get to gcc, Emacs, and gdb. Thank you.
-- Vance Petree, Virginia Power