  | 
   Program-Triggered Breakpoints 
   Submitted by  |   
  
  
The other day when I read the Conditional Breakpoints TOTD I remembered
something I'd read somewhere regarding interrupt 3.  I'm not sure about other
OS's, but certainly all Windows debuggers utilise it (unless you have a BIOS
setting disabling it or something similar).
The difference between this an the other TOTD is that this one appears to work
on _all_ compilers, not just MSVC.
  Basically, you insert a piece of code, like so, into your program where you want
a breakpoint:
  
 
 // check for validity
if (x  24)
{
  // breakpoint
  _asm
  {
    int 3
  }
}  |  
  
  
Note that this only works if you're running with a debugger and your program was
compiled in a "debug mode" (if availible), or else some other int 3 might be
called.
  Try it out...
  Kieren Johnstone
 | 
 
 
 
The zip file viewer built into the Developer Toolbox made use
of the zlib library, as well as the zlibdll source additions.
 
 
 |