_BreakPoint( ) API Library Routine

_BreakPoint( ) is a macro that generates the debugger breakpoint instruction, INT 3. This can be helpful for debugging external routines.

void _BreakPoint(void any)
void any;                     /* Pointer. */

Remarks

When a _BreakPoint( ) call is encountered, control transfers to your debugger. Most debuggers return control to the program line that includes the INT3 instruction, and you have to manually increment the instruction pointer (IP) past this instruction. At that time you can use your debugger to set additional breakpoints. Always remove any breakpoints before exiting the external routine. For more information about debugging, see Accessing the Visual FoxPro API.

Example

The following example uses the macro _BreakPoint( ) to place an INT 3 that debuggers recognize as a breakpoint.

Visual FoxPro Code

SET LIBRARY TO BPOINT  

C Code

#include <pro_ext.h>

FAR Example(ParamBlk FAR *parm)
{
   int RetValue;

   _BreakPoint(); // debugger breaks execution here

   _HLock(parm->p[0].val.ev_handle);
   _HLock(parm->p[1].val.ev_handle);

   RetValue = _StrCmp(_HandToPtr(parm->p[0].val.ev_handle),
      _HandToPtr(parm->p[1].val.ev_handle));

   _RetInt(RetValue, 10); // does return control here

   _HUnLock(parm->p[0].val.ev_handle);
   _HUnLock(parm->p[1].val.ev_handle);
}

FoxInfo myFoxInfo[] = {
   {"STRCMP", (FPFI) Example, 2, "C,C"},
};
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};

See Also

Accessing the Visual FoxPro API | Debugging Routines | Debugging and Error Handling