[comp.windows.x.motif] Anyone got any neat tricks to debug XmStrings?

kaleb@thyme.jpl.nasa.gov (Kaleb Keithley) (05/03/91)

I'm trying to track down an illusive bug.  It appears that an XmString
is getting trounced on.  If it were any *normal* data type I'd just
display it in dbx and then step through the program and watch for it
to get trashed.  But !@#$% Motif compound strings are opaque, and there's
no easy way that I've found to "watch" what's happening to one.

Has anyone else got any clever tricks for doing this?

Thanks in advance.

-- 
Kaleb Keithley                        kaleb@thyme.jpl.nasa.gov

Meep Meep                             Roadrunner
Veep veep                             Quayle

meeks@osf.org (W. Scott Meeks) (05/03/91)

>Date: 3 May 91 02:33:13 GMT
>From: usc!sdd.hp.com!elroy.jpl.nasa.gov!thyme!kaleb@ucsd.edu  (Kaleb Keithley)
>
>I'm trying to track down an illusive bug.  It appears that an XmString
>is getting trounced on.  If it were any *normal* data type I'd just
>display it in dbx and then step through the program and watch for it
>to get trashed.  But !@#$% Motif compound strings are opaque, and there's
>no easy way that I've found to "watch" what's happening to one.
>
>Has anyone else got any clever tricks for doing this?

If you have access to source code, then you can recompile XmString.c with 
-DDEBUG which will cause the routines dump_fontlist(XmFontList f),
dump_fontlist_cache(), dump_external(XmString cs), and
dump_internal(_XmString string) to be defined. 

If you don't have access to source, then your best bet is to cast it as
char * and read it as an ordinary string.  Unfortunately, it tends to have
NULLs in it which you'll have to skip over to see the whole thing.  The
fourth byte contains the length of the whole thing which might be useful.

Hope this helps.

W. Scott Meeks           
Open Software Foundation 
meeks@osf.org            
(617) 621-7229