[comp.windows.x] Re^2: Debugging while server grabs are present.

jcb@frisbee.Sun.COM (Jim Becker) (10/28/89)

meo@stiatl.UUCP (Miles O'Neal) writes:

->In article <427@bigsur.UUCP> darren2@bigsur.UUCP (Darren Toop) writes:
->|You may not be able to type, but you can still cut and paste.
->|cat the following file in scratch pad window:
->|
->|...
->|
->|Then when I get stuck, I can still cut+paste the command I want
->|into the dbx input buffer and it will do the command.  Hey, nobody
->|said it was elegant.  If you've got a better way, let me know.

this is pretty amazing..

->The other is our app now has an extra #define test
->throughout the source, that lets us turn off grabs for
->debugging, and turn them back on for release.

a #define is not all that flexible, I recommend a global boolean.

if you just set up a single layer interface to the routines that
perform the resource grabs then it is simple to have a global variable
boolean that can be toggled when debugging to enable or disable the
actual grab. There are times that one has to do the grab which don't
let this model work, but for most cases this is sufficient.

in a past life there was need for the documentation writers to do
screen snapshots of the appearance of the application when the popups
were on the screen. since the method I used to do the popups grabbed
the server I put an environment variable check in the initialization
code to determine if the server grab would take effect. This toggled a
global variable if the tech writer did "setenv DONTGRABSERVER 1",
which worked just fine.


->-Miles O'Neal
->{yr fave backbone here}!{emory|gatech}!stiatl!meo


-Jim
--    
   Jim Becker / jcb%frisbee@sun.com  / Sun Microsystems    
   ...these are my opinions, and even my id disagrees..