예제 #1
0
bool ReportTrap( unsigned conditions, bool stack_cmds )
{
    bool    cmds_pushed;
    char        *p;

    if( conditions & COND_EXCEPTION ) {
        RecordMsgText( &conditions ); // get the 'access violation, etc' message
        p = StrCopy( LIT_ENG( Task_Exception ), TxtBuff );
        if( MsgText != NULL ) StrCopy( MsgText, p );
        MsgText = DbgRealloc( MsgText, strlen( TxtBuff ) + 1 );
        StrCopy( TxtBuff, MsgText );
        DUIMsgBox( MsgText );
    }
    if( conditions & (COND_EXCEPTION|COND_TERMINATE) ) {
        RingBell();
    }
    DisplayMsgText();
    if( conditions & COND_USER ) {
        DUIInfoBox( LIT_ENG( User_Interupt ) );
        PurgeInpStack();
        RecordAsynchEvent();
    } else if( conditions & COND_TERMINATE ) {
        DUIInfoBox( LIT_ENG( Task_Completed ) );
        _SwitchOff( SW_HAVE_TASK );
    } else if( conditions & COND_LIBRARIES ) {
        Format( TxtBuff, "%s '%s'", LIT_ENG( Break_on_DLL_Load ), GetLastImageName() );
        DUIInfoBox( TxtBuff );
    } else {
        DUIStatusText( LIT_ENG( Empty ) );
    }
    cmds_pushed = DispBPMsg( stack_cmds );
    DbgUpdate( UP_MEM_CHANGE | UP_CSIP_CHANGE | UP_REG_CHANGE |
               UP_CODE_EXECUTED | UP_THREAD_STATE );
    return( cmds_pushed );
}
예제 #2
0
bool DispBPMsg( bool stack_cmds )
{
    brkp        *bp;
    brkp        *next;
    char        *p;
    bool        ret;
    cmd_list    *cmds;

    ret = false;
    for( bp = BrkList; bp != NULL; bp = bp->next ) {
        if( !bp->status.b.hit )
            continue;
        if( !bp->status.b.silent ) {
            p = GetBPAddrText( bp, TxtBuff );
            if( !IS_BP_EXECUTE( bp->th ) ) {
                p = StrCopy( " - ", p );
                p = StrVal( LIT_ENG( OldVal ), bp, p );
                GetWPVal( bp );
                p = StrVal( LIT_ENG( NewVal ), bp, p );
                *p = NULLCHAR;
            }
            DUIInfoBox( TxtBuff );
        }
        if( stack_cmds && bp->status.b.resume ) {
            cmds = AllocCmdList( "go/keep", sizeof( "go/keep" ) );
            PushCmdList( cmds );
            TypeInpStack( INP_HOOK );
            FreeCmdList( cmds );
            ret = true;
        }
        if( stack_cmds && ( bp->cmds != NULL ) && bp->status.b.use_cmds ) {
            bp->status.b.cmds_pushed = true;
            PushCmdList( bp->cmds );
            TypeInpStack( INP_BREAK_POINT );
            ret = true;
        }
    }
    for( bp = BrkList; bp != NULL; bp = next ) {
        next = bp->next;
        if( bp->status.b.autodestruct ) {
            DUIRemoveBreak( bp );
        }
    }
    if( UserTmpBrk.status.b.hit ) {
        p = Format( TxtBuff, LIT_ENG( Break_on_execute ) );
        Format( p, BrkFmt(), UserTmpBrk.loc.addr );
        DUIDlgTxt( TxtBuff );
    }
    return( ret );
}