Path: utzoo!attcan!uunet!snorkelwacker!bloom-beacon!ti-csl.csc.ti.COM!ekberg From: ekberg@ti-csl.csc.ti.COM Newsgroups: comp.windows.x Subject: Re: Debugging Graphics Programs > 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. I Message-ID: <9009171511.AA09194@osage.csc.ti.com> Date: 17 Sep 90 15:11:38 GMT Sender: ekberg@osage.csc.ti.com Organization: The Internet Lines: 19 The problem is that Xlib normally buffers up requests for you so reduce network traffic. When you put the breakpoint after the call to XMapWindow Xlib may still have that request in its buffer. What I do is to extern int _Xdebug; and then put the following near the top of my program: /* Synchronize errors. See page 46 of Adrian Nye's Xlib Programming Manual, volume 1. 0 means off, 1 means synchronize. */ _Xdebug = 1; This will slow down your program, but that is normally OK for debug purposes. This will cause Xlib to not buffer your requests, so setting a breakpoint after the call to XMapWindow will allow you to see the window. -- tom (aisle C-4Q), ekberg@csc.ti.com