Path: utzoo!attcan!uunet!cs.utexas.edu!usc!snorkelwacker!bloom-beacon!SABER.COM!jimf From: jimf@SABER.COM Newsgroups: comp.windows.x Subject: Re: Debugging Graphics Programs Message-ID: <9009171419.AA04532@armory> Date: 17 Sep 90 14:19:43 GMT Sender: root@athena.mit.edu (Wizard A. Root) Organization: The Internet Lines: 37 |I'd like to debug a program I've written in X that simply opens a window |and draws in it. However, when I use dbx or gdb, the window does not |open nor can I see any graphics being drawn as the program executes. If |I simply execute the program, it opens its window and draws in it just |fine. How can I get the debugger to open the window and draw into it as |the program executes? You're seeing the effects of buffering. Put in code to turn X debugging mode on, which makes the calls fully synchronous for easy debugging but which slows performance somewhat: main() { Display *disp; /* set up display variable */ XSynchronize(disp, 1); /* do your thing... */ } This can also be accomplished by setting the _XDebug flag to true: extern _XDebug; main() { _XDebug= True; /* do your thing... */ } Alternatively you can call XFlush before a breakpoint. In Saber-C you can use the following action point: { XFlush(disp); saber_stop(""); } jim frost saber software jimf@saber.com