Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: Debugger watchpoints in UNIX ? Keywords: debug watchpoint Message-ID: <3004@auspex.auspex.com> Date: 8 Mar 90 19:28:08 GMT References: <22567@pasteur.Berkeley.EDU> <1853@lzga.ATT.COM> Organization: Auspex Systems, Santa Clara Lines: 28 >At least System5.2 and beyond do watchpoints. Yes, but so does "dbx". That wasn't what he was asking: > Has anybody heard of an efficient implementation of watchpoints, i.e. > breakpoints activated whenever an arbitrary position in memory (e.g. a > field of a dynamically allocated structure) changes value ? > Both dbx and saber can do something similar, but with horrendous > performance penalty ("stop address" commands). and, since the "sdb" manual says: > Since this command is done by software, it can be very slow. that doesn't fit his criteria. In fact, the "sdb" version is slow for the same reason the "dbx" one is slow - they both basically single-step the program and check the variable after each instruction. The VMS scheme, to which he alluded, is to set the page containing the variable non-writeable, and catch the protection faults (actually, it may made it inaccessible, due to problems in, say, the 11/750's handling of protection faults that prevents it from being able to restart the instruction that faulted). Current UNIX systems generally don't let you do this. Some processors (e.g., the 80386) have hardware to watch some (generally small) number of locations; some debuggers on UNIX for those processors may use them.