home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sd386v50.zip / sd386src.zip / BRK.C < prev    next >
Text File  |  1996-03-15  |  33KB  |  601 lines

  1. /*****************************************************************************/
  2. /* File:                                             IBM INTERNAL USE ONLY   */
  3. /*   brk.c                                                                   */
  4. /*                                                                           */
  5. /* Description:                                                              */
  6. /*                                                                           */
  7. /*   Breakpoint handling.                                                    */
  8. /*                                                                           */
  9. /*                                                                           */
  10. /* History:                                                                  */
  11. /*                                                                           */
  12. /*...Release 1.00                                                            */
  13. /*...                                                                        */
  14. /*... 02/08/91  100   made changes for 32-bit compilation.                   */
  15. /*... 02/08/91  101   made changes for 32-bit compilation. ( by Joe C. )     */
  16. /*    04/04/91  107   Change calls to PeekData/PokeData to DBGet/DBPut.   107*/
  17. /*... 06/02/91  111   fix warnings                                           */
  18. /*                                                                           */
  19. /*...Release 1.00 (Pre-release 1)                                            */
  20. /*...                                                                        */
  21. /*... 08/22/91  234   Joe       PL/X gives "varname" is incorrect message    */
  22. /*...                           when entering a parameter name in the data   */
  23. /*...                           window.  This happens when the cursor is on  */
  24. /*...                           an internal procedure definition statement   */
  25. /*...                           and you use F2 to get into the data window   */
  26. /*...                           and then type the name.                      */
  27. /*...                                                                        */
  28. /*...Release 1.00 (Pre-release 108 12/05/91)                                 */
  29. /*...                                                                        */
  30. /*... 02/10/92  515   Srinivas  Multiple hits of a deferred break points     */
  31. /*                              (same func names).                           */
  32. /*... 02/12/92  521   Joe       Port to C-Set/2.                             */
  33. /*...                                                                        */
  34. /*...Release 1.01 (04/03/92)                                                 */
  35. /*...                                                                        */
  36. /*... 05/08/92  701   Srinivas  Cua Interface.                               */
  37. /*... 05/08/92  701   Joe       Cua Interface.                               */
  38. /*... 06/04/93  827   Joe       Add remote debug support.                    */
  39. /**Includes*******************************************************************/
  40. #include "all.h"
  41.  
  42. extern PROCESS_NODE *pnode;
  43. extern AFILE        *allfps;
  44. extern CmdParms      cmd;
  45.  
  46. /*****************************************************************************/
  47. /* DefBrk                                                                    */
  48. /*                                                                           */
  49. /* Description:                                                              */
  50. /*                                                                           */
  51. /*   Add a breakpoint to the list of breakpoints                             */
  52. /*                                                                           */
  53. /* Parameters:                                                               */
  54. /*                                                                           */
  55. /*   where      address where the breakpoint is to be set.                   */
  56. /*   TorF       optional xbox call.                                          */
  57. /*                                                                           */
  58. /* Return:                                                                   */
  59. /*                                                                           */
  60. /*   BRK *      -> breakpoint structure built for this address.              */
  61. /*                                                                           */
  62. /*****************************************************************************/
  63. BRK *DefBrk( ULONG where, int TorF)
  64. {
  65.  BRK *p;
  66.  
  67.  p = (BRK *)Talloc(sizeof(BRK));
  68.  p->brkat = where;
  69.  p->byte = BREAKPT8086OPCODE;
  70.  p->next = pnode->allbrks;
  71.  pnode->allbrks = p ;
  72.  if( TorF == TRUE )
  73.   xDefBrk( where );
  74.  return( p );
  75. }
  76.  
  77. /*****************************************************************************/
  78. /* UndBrk()                                                                  */
  79. /*                                                                           */
  80. /* Description:                                                              */
  81. /*                                                                           */
  82. /*  Undefine a break point.                                                  */
  83. /*                                                                           */
  84. /* Parameters:                                                               */
  85. /*                                                                           */
  86. /*    where   address to be zapped.                                          */
  87. /*    TorF    optional xbox call.                                            */
  88. /*                                                                           */
  89. /* Return:                                                                   */
  90. /*                                                                           */
  91. /* Assumptions:                                                              */
  92. /*                                                                           */
  93. /*   brk != NULL &&                                                          */
  94. /*   brk is a pointer to a brk* structure in the list of breakpoints.        */
  95. /*   This guarantees that we will always be able to find it.                 */
  96. /*                                                                           */
  97. /*****************************************************************************/
  98. void UndBrk( ULONG where, int TorF )
  99. {
  100.  BRK *p, *pprev;
  101.  
  102.  /****************************************************************************/
  103.  /* - scan the break point list and remove this break point.                 */
  104.  /****************************************************************************/
  105.  pprev = (BRK*)&pnode->allbrks;
  106.  p = pprev->next;
  107.  for( ; p ; )
  108.  {
  109.   if( p->brkat == where )
  110.   {
  111.    pprev->next = p->next;
  112.  
  113.    if( p->cond )
  114.    {
  115.     if( p->cond->pCondition )
  116.      Tfree(p->cond->pCondition);
  117.     Tfree( p->cond );
  118.    }
  119.    Tfree((void*)p);
  120.  
  121.    goto fini;
  122.   }
  123.   pprev = p;
  124.   p = pprev->next;
  125.  }
  126. fini:
  127.  if( TorF == TRUE )
  128.   xUndBrk(where);
  129. }
  130.  
  131. /*****************************************************************************/
  132. /* FreeAllBrks()                                                             */
  133. /*                                                                           */
  134. /* Description:                                                              */
  135. /*   free all break points and reset the ring to null.                       */
  136. /*                                                                           */
  137. /* Parameters:                                                               */
  138. /*                                                                           */
  139. /* Return:                                                                   */
  140. /*                                                                           */
  141. /* Assumptions:                                                              */
  142. /*                                                                           */
  143. /*                                                                           */
  144. /*****************************************************************************/
  145.  void
  146. FreeAllBrks( )
  147. {
  148.   BRK   *bp;
  149.   BRK   *bpnext;
  150.   BRK   *bplast;
  151.   AFILE *fp;
  152.  
  153.  
  154. /*****************************************************************************/
  155. /* - let's not reset the breakpoint file time in this case.                  */
  156. /*****************************************************************************/
  157. /*ResetBreakpointFileTime();*/
  158.  
  159.   for ( fp = allfps;
  160.         fp;
  161.         fp=fp->next
  162.       )
  163.    UnMarkLineBRKs(fp);
  164.  
  165.   bplast=(BRK*)&(pnode->allbrks);
  166.   bp=pnode->allbrks;
  167.  
  168.   while(  bp )
  169.   {
  170.    xUndBrk(bp->brkat);                                                  /*827*/
  171.    bpnext= bp->next;
  172.    if(bp->funcname)
  173.     Tfree((void*)bp->funcname);                                           /*521*/
  174.    if(bp->dllname)
  175.     Tfree((void*)bp->dllname);                                           /*521*/
  176.    if(bp->srcname)
  177.     Tfree((void*)bp->srcname);                                           /*521*/
  178.    Tfree((void*)bp);                                                     /*521*/
  179.    bplast->next=bpnext;
  180.    bp=bpnext;
  181.   }
  182. }
  183.  
  184. /*****************************************************************************/
  185. /* UnMarkLineBRKs()                                                          */
  186. /*                                                                           */
  187. /* Description:                                                              */
  188. /*   Turn of all the breakpoints in this afile.                              */
  189. /*                                                                           */
  190. /* Parameters:                                                               */
  191. /*   fp        input - the afile for this source.                            */
  192. /*                                                                           */
  193. /* Return:                                                                   */
  194. /*                                                                           */
  195. /* Assumptions:                                                              */
  196. /*                                                                           */
  197. /*                                                                           */
  198. /*****************************************************************************/
  199.  void
  200. UnMarkLineBRKs( AFILE *fp)
  201. {
  202.     BRK *brk;
  203.     UINT mid = fp->mid;
  204.     int rellno;
  205.  
  206.     /* Note: "next" must be 1st field in the BPT block for this code.*/
  207.     for( brk = (BRK *) &pnode->allbrks ; brk != NULL ; brk = brk->next  )
  208.     {
  209.         if( (brk->mid == mid)
  210.          && ((rellno = (int)(brk->lno - fp->Nbias)) > 0)
  211.          && (rellno <= (int)fp->Nlines)
  212.           ) *( fp->source + fp->offtab[ rellno   ] - 1 ) &= ~LINE_BP;   /*234*/
  213.     }
  214. }
  215.  
  216.  void
  217. DropBrk( AFILE *fp,
  218.          BRK *brk)
  219. {
  220.     UINT lno = brk->lno, mid = brk->mid;
  221.  
  222.     UndBrk( brk->brkat , TRUE);                                         /*827*/
  223.  
  224.     /* check to see if any more breakpoints are set for this line */
  225.     /* Note: "next" must be 1st field in the BPT block for this code */
  226.     for( brk = (BRK*)&pnode->allbrks; brk !=NULL ; brk = brk->next )
  227.         if( (brk->lno == lno) && (brk->mid == mid) )
  228.             return;
  229.  
  230.     /* clear the active breakpoint flag for the source line */
  231.     if( fp && fp->source && ((lno -= fp->Nbias    ) < fp->Nlines) )     /*234*/
  232.         SetBitOff( *(fp->source + fp->offtab[lno] - 1), LINE_BP );
  233. }
  234.  
  235.  void
  236. DropOnceBrks( UINT address)
  237. {
  238.     BRK *p, *pprev;
  239.  
  240.     /* Note:  This code assumes that "next" is the 1st field in BRK */
  241.  
  242.     pprev = (BRK*) &pnode->allbrks ;
  243.  
  244.     for( p = pprev->next ; p != NULL ; p = pprev->next ){
  245.         if( p->once && (p->brkat == address) ){
  246.             DropBrk( mid2fp(p->mid), p );
  247.         }else{
  248.             pprev = p;
  249.     }   }
  250. }
  251.  
  252. /*****************************************************************************/
  253. /* SetLineBRK()                                                              */
  254. /*                                                                           */
  255. /* Description:                                                              */
  256. /*   set/reset breakpoints on source lines.                                  */
  257. /*                                                                           */
  258. /* Parameters:                                                               */
  259. /*   fp         pointer to the afile for this source line.                   */
  260. /*   lno        line number.                                                 */
  261. /*   lp         pointer to source line in buffer.                            */
  262. /*   special    pointer to debug file structure.                             */
  263. /*               BRK_COND 1 => conditional breakpoint                        */
  264. /*               BRK_ONCE 2 => onetime breakpoint                            */
  265. /*   expr       expression for a conditional breakpoint.                     */
  266. /*                                                                           */
  267. /* Return:                                                                   */
  268. /*   msg        an error message from ParseCbrk().                           */
  269. /*              NULL    - success.                                           */
  270. /*              BADNESS - not successful when trying to handle breakpoints   */
  271. /*                        that do not call ParseCbrk().                      */
  272. /*                                                                           */
  273. /*****************************************************************************/
  274. #define BADNESS (void *)1
  275.  
  276.  char *
  277. SetLineBRK( AFILE *fp, UINT   lno, UCHAR *lp, UINT special , char *expr )
  278. {
  279.  BRK     *p;                            /* pointer to breakpoint node.       */
  280.  BRK     *pp;                           /* pointer to breakpoint node.       */
  281.  UINT     addr;                         /*                                101*/
  282.  ULONG    span;                         /*                                   */
  283.  
  284.  /****************************************************************************/
  285.  /*                                                                       701*/
  286.  /* if there's a bp already on the line                                   701*/
  287.  /* {                                                                     701*/
  288.  /*  scan the list of breakpoints                                         701*/
  289.  /*  {                                                                    701*/
  290.  /*   if this is the node with the breakpoint info for this line          701*/
  291.  /*   {                                                                   701*/
  292.  /*    if this is a conditional breakpoint                                701*/
  293.  /*    {                                                                  701*/
  294.  /*     allocate a conditional node if it hasn't been done already.       701*/
  295.  /*     copy the expression into the conditional structure.               701*/
  296.  /*     parse the expression.                                             701*/
  297.  /*     if it doesn't parse                                               701*/
  298.  /*     {                                                                 701*/
  299.  /*      remove all traces of the allocation.                             701*/
  300.  /*     }                                                                 701*/
  301.  /*     return the error message or null.                                 701*/
  302.  /*      ( effectively this converts a complex breakpoint to a simple one)701*/
  303.  /*    }                                                                  701*/
  304.  /*    else                                                               701*/
  305.  /*     remove the breakpoint. ( this just toggles the break off )        701*/
  306.  /*   {                                                                   701*/
  307.  /*   else                                                                701*/
  308.  /*    bump to the next breakpoint node.                                  701*/
  309.  /*  }                                                                    701*/
  310.  /*  set the breakpoint flag in the source line buffer.                   701*/
  311.  /* }                                                                     701*/
  312.  /****************************************************************************/
  313.  if( *(lp-1) & LINE_BP )                                                /*701*/
  314.  {                                                                      /*701*/
  315.   for( pp = (BRK *) &(pnode->allbrks),p = pp->next;                     /*701*/
  316.        p != NULL;                                                       /*701*/
  317.        p = pp->next                                                     /*701*/
  318.      )                                                                  /*701*/
  319.   {                                                                     /*701*/
  320.    if((p->lno==lno)&&(p->mid==fp->mid))                                 /*701*/
  321.    {                                                                    /*701*/
  322.     if( special == BRK_COND )                                           /*701*/
  323.     {                                                                   /*701*/
  324.      {                                                                  /*701*/
  325.       UCHAR *msg;                                                       /*701*/
  326.                                                                         /*701*/
  327.       if( !p->cond )                                                    /*701*/
  328.       {
  329.        p->cond             = (BRKCOND*) Talloc(sizeof(BRKCOND));
  330.        p->cond->pCondition = Talloc(strlen(expr)+1);
  331.       }
  332.  
  333.       strcpy(p->cond->pCondition, expr);
  334.       msg = ParseCbrk(p->cond, fp->mid, lno, fp->sfi);
  335.       if( msg )                                                         /*701*/
  336.       {                                                                 /*701*/
  337.        Tfree((void*)p->cond);                                            /*701*/
  338.        Tfree((void*)p->cond->pCondition);
  339.        p->cond = NULL;                                                  /*701*/
  340.       }                                                                 /*701*/
  341.       return(msg);                                                      /*701*/
  342.      }                                                                  /*701*/
  343.     }                                                                   /*701*/
  344.     else                                                                /*701*/
  345.      UndBrk( p->brkat , TRUE);                                          /*701*/
  346.    }                                                                    /*701*/
  347.    else                                                                 /*701*/
  348.        pp = p;                                                          /*701*/
  349.   }                                                                     /*701*/
  350.   *(lp-1) &= ~LINE_BP;                                                  /*701*/
  351.   return(NULL);                                                         /*701*/
  352.  }                                                                      /*701*/
  353.  else                                                                   /*701*/
  354.  {                                                                      /*701*/
  355.  /****************************************************************************/
  356.  /*                                                                       701*/
  357.  /* else there's not a bp already on the line                             701*/
  358.  /* {                                                                     701*/
  359.  /*  map the source line number to an address.                            701*/
  360.  /*  if it maps ok                                                        701*/
  361.  /*  {                                                                    701*/
  362.  /*    allocate a break point structure.                                  701*/
  363.  /*    add module id,lno, and brk type to the structure.                  701*/
  364.  /*    if this is a conditional breakpoint                                701*/
  365.  /*    {                                                                  701*/
  366.  /*     allocate a conditional node.                                      701*/
  367.  /*     copy the expression into the conditional structure.               701*/
  368.  /*     parse the expression.                                             701*/
  369.  /*     if it doesn't parse                                               701*/
  370.  /*     {                                                                 701*/
  371.  /*      remove all traces of the allocation.                             701*/
  372.  /*      remove the break point node.                                     701*/
  373.  /*      return an error message.                                         701*/
  374.  /*     }                                                                 701*/
  375.  /*    }                                                                  701*/
  376.  /*    set the breakpoint flag in the source line buffer.                 701*/
  377.  /*    return ok.                                                         701*/
  378.  /*  }                                                                    701*/
  379.  /*  else                                                                 701*/
  380.  /*   return an error since line doesn't map to an address.               701*/
  381.  /* }                                                                     701*/
  382.  /****************************************************************************/
  383.   addr = DBMapLno(fp->mid, lno, fp->sfi, &span, fp->pdf);
  384.   if( addr )                                                            /*701*/
  385.   {                                                                     /*701*/
  386.    p = DefBrk(addr,TRUE);                                               /*827*/
  387.    p->mid = fp->mid;                                                    /*701*/
  388.    p->lno = lno;                                                        /*701*/
  389.    p->sfi = fp->sfi;
  390.    p->once = (UCHAR)(special==BRK_ONCE);                                /*701*/
  391.    if( special == BRK_COND )                                            /*701*/
  392.    {                                                                    /*701*/
  393.     UCHAR *msg;                                                         /*701*/
  394.     p->cond             = (BRKCOND*) Talloc(sizeof(BRKCOND));                       /*701*/
  395.     p->cond->pCondition = Talloc(strlen(expr) + 1);
  396.     strcpy(p->cond->pCondition, expr);
  397.     msg = ParseCbrk(p->cond,fp->mid,lno,fp->sfi);
  398.     if( msg )                                                           /*701*/
  399.     {                                                                   /*701*/
  400.      Tfree((void*)p->cond->pCondition);
  401.      Tfree((void*)p->cond);                                              /*701*/
  402.      p->cond = NULL;                                                    /*701*/
  403.      UndBrk( p->brkat , TRUE );                                         /*827*/
  404.      return(msg);                                                       /*701*/
  405.     }                                                                   /*701*/
  406.    }                                                                    /*701*/
  407.    *(lp-1) |= LINE_BP;                                                  /*701*/
  408.    return(NULL);                                                        /*701*/
  409.   }                                                                     /*701*/
  410.   else                                                                  /*701*/
  411.    return( BADNESS);                                                    /*701*/
  412.  }                                                                      /*701*/
  413. }                                       /* end SetLineBrk()             /*701*/
  414.  
  415. /*****************************************************************************/
  416. /* SetAddrBrk()                                                              */
  417. /*                                                                           */
  418. /* Description:                                                              */
  419. /*                                                                           */
  420. /*   Set/Reset a simple or a one time breakpoint.                            */
  421. /*                                                                           */
  422. /* Parameters:                                                               */
  423. /*                                                                           */
  424. /*   fp         -> to view where break will be set.                          */
  425. /*   address    address where the breakpoint is to be set.                   */
  426. /*   special    one time or simple breakpoint.                               */
  427. /*                                                                           */
  428. /* Return:                                                                   */
  429. /*                                                                           */
  430. /*    void                                                                   */
  431. /*                                                                           */
  432. /*****************************************************************************/
  433. void SetAddrBRK(AFILE *fp, ULONG address, int special)
  434. {
  435.  BRK     *p;
  436.  DEBFILE *pdf;
  437.  UINT     lineno;
  438.  ULONG    lno;
  439.  
  440.  pdf = fp->pdf;
  441.  
  442.  /****************************************************************************/
  443.  /* - don't do anything if we're trying to set a one time break and          */
  444.  /*   there's already a breakpoint on that address.                          */
  445.  /****************************************************************************/
  446.  if( (special == BRK_ONCE)  && ( IfBrkOnAddr(address) ) )
  447.   return;
  448.  
  449.  /****************************************************************************/
  450.  /* - if it's a simple breakpoint and there is already a breakpoint          */
  451.  /*   defined for that address, then drop the breakpoint.                    */
  452.  /****************************************************************************/
  453.  if( special == BRK_SIMP )
  454.  {
  455.   p = IfBrkOnAddr(address);
  456.   if( p != NULL )
  457.   {
  458.    DropBrk(fp, p);
  459.    return;
  460.   }
  461.  }
  462.  
  463.  /****************************************************************************/
  464.  /* - define the breakpoint.                                                 */
  465.  /****************************************************************************/
  466.  lno = 0;
  467.  if( fp->source )
  468.  {
  469.   LNOTAB *pLnoTabEntry;
  470.   ULONG   mid;
  471.  
  472.  
  473.   mid = DBMapInstAddr(address, &pLnoTabEntry, pdf);
  474.   lno = 0;
  475.   if( pLnoTabEntry )
  476.    lno = pLnoTabEntry->lno;
  477.   if( ( mid != 0 )                        &&
  478.       ((lineno = lno) > fp->Nbias)        &&
  479.         (lineno -= fp->Nbias) <= fp->Nlines  )
  480.    *(fp->source + fp->offtab[lineno] - 1) |= LINE_BP;
  481.  }
  482.  
  483.  p = DefBrk(address, TRUE);
  484.  
  485.  p->mid  = fp->mid;
  486.  p->lno  = lno;
  487.  p->sfi  = fp->sfi;
  488.  p->once = (special == BRK_ONCE)?TRUE:FALSE;
  489.  return;
  490. }
  491.  
  492. /* Mark all line that have an active breakpoint */
  493.  void
  494. MarkLineBRKs( AFILE *fp )
  495. {
  496.     BRK *brk;
  497.     UINT mid = fp->mid;
  498.     int  sfi = fp->sfi;
  499.     int rellno;
  500.  
  501.     /* Note: "next" must be 1st field in the BPT block for this code.  */
  502.     for( brk = (BRK *) &(pnode->allbrks) ; brk != NULL ; brk = brk->next ){
  503.         if( (brk->mid == mid)
  504.          && (brk->sfi == sfi)
  505.          && ((rellno = (int)(brk->lno - fp->Nbias)) > 0)
  506.          && (rellno <= (int)fp->Nlines)
  507.           ) *( fp->source + fp->offtab[ rellno   ] - 1 ) |= LINE_BP;
  508.     }
  509. }
  510.  
  511. /*****************************************************************************/
  512. /* IsBrk()                                                                   */
  513. /*                                                                           */
  514. /* Description:                                                              */
  515. /*                                                                           */
  516. /*   Is there a break point on this line.                                    */
  517. /*                                                                           */
  518. /* Parameters:                                                               */
  519. /*                                                                           */
  520. /*   fp         -> to view structure.                                        */
  521. /*   lno        executable line number.                                      */
  522. /*                                                                           */
  523. /* Return Value:                                                             */
  524. /*                                                                           */
  525. /*   p or NULL  return a ptr to the BRK node if there is a bp for this line. */
  526. /*                                                                           */
  527. /* Assumptions:                                                              */
  528. /*                                                                           */
  529. /*   lno is executable.                                                      */
  530. /*                                                                           */
  531. /*****************************************************************************/
  532. BRK *IsBrk( AFILE *fp, UINT lno )
  533. {
  534.  BRK          *p;
  535.  
  536.  for(p=pnode->allbrks; p ; p=p->next)
  537.   if( (p->lno == lno) && (p->mid == fp->mid) )
  538.    break;
  539.  
  540.  return( (p)?p:NULL );
  541. }
  542.  
  543. /*****************************************************************************/
  544. /* IfBrkOnAddr()                                                             */
  545. /*                                                                           */
  546. /* Description:                                                              */
  547. /*                                                                           */
  548. /*   Is there a break point on this address.                                 */
  549. /*                                                                           */
  550. /* Parameters:                                                               */
  551. /*                                                                           */
  552. /*   address    breakpoint address we're testing for.                        */
  553. /*                                                                           */
  554. /* Return Value:                                                             */
  555. /*                                                                           */
  556. /*   p or NULL  return a ptr to the BRK node if there is a bp for this line. */
  557. /*                                                                           */
  558. /* Assumptions:                                                              */
  559. /*                                                                           */
  560. /*****************************************************************************/
  561. BRK *IfBrkOnAddr( UINT address )
  562. {
  563.  BRK *p = NULL;
  564.  
  565.  for( p = pnode->allbrks; p ; p = p->next )
  566.  {
  567.   if( p->brkat == address ){
  568.    return( p );
  569.   }
  570.  }
  571.  return( p);
  572. }
  573.  
  574. /*****************************************************************************/
  575. /* IsDeferredBrk()                                                           */
  576. /*                                                                           */
  577. /* Description:                                                              */
  578. /*                                                                           */
  579. /*   Is there a deferred break point defined.                                */
  580. /*                                                                           */
  581. /* Parameters:                                                               */
  582. /*                                                                           */
  583. /* Return:                                                                   */
  584. /*                                                                           */
  585. /*   TRUE or FALSE                                                           */
  586. /*                                                                           */
  587. /* Assumptions:                                                              */
  588. /*                                                                           */
  589. /*****************************************************************************/
  590. int  IsDeferredBrk( void )
  591. {
  592.  BRK *p = NULL;
  593.  
  594.  for( p = pnode->allbrks; p ; p = p->next )
  595.  {
  596.   if( p->flag.DorI == BP_DEFR )
  597.    return( TRUE );
  598.  }
  599.  return( FALSE );
  600. }
  601.