Пример #1
0
static void ActivateBreaks( struct TDebugThread *obj, struct TDebugBreak *BreakList, struct TDebugWatch *WatchList )
{
    struct TDebugBreak  *b = BreakList;
    struct TDebugWatch  *w = WatchList;
    opcode_type         brk_opcode = BRKPOINT;
    int                 bnum = 0;

    while( w ) {
        if (bnum < 4) {
            RdosSetWriteDataBreak( obj->ThreadID, bnum, w->Sel, w->Offset, w->Size );
            bnum++;
        }
        w = w->Next;
    }

    while( b ) {
        if ((b->Sel & 0x3) == 0x3) {
            RdosReadThreadMem( obj->ThreadID, b->Sel, b->Offset, (char *)&brk_opcode, sizeof( brk_opcode ) );
            b->Instr = brk_opcode;
            RdosWriteThreadMem( obj->ThreadID, b->Sel, b->Offset, (char *)&brk_opcode, sizeof( brk_opcode ) );
        } else {
            if (bnum < 4) {
                RdosSetCodeBreak( obj->ThreadID, bnum, b->Sel, b->Offset );
                bnum++;
            }
        }
        b = b->Next;
    }
}
Пример #2
0
static void ActivateBreaks( struct TDebugThread *obj, struct TDebugBreak *BreakList, struct TDebugWatch *WatchList )
{
    struct TDebugBreak *b = BreakList;
    struct TDebugWatch *w = WatchList;
    char brinstr = 0xCC;
    int bnum = 0;

    while( w ) {
        if (bnum < 4) {
            RdosSetWriteDataBreak( obj->ThreadID, bnum, w->Sel, w->Offset, w->Size );
            bnum++;
        }
        w = w->Next;
    }

    while( b ) {
        if ((b->Sel & 0x3) == 0x3) {
            RdosReadThreadMem( obj->ThreadID, b->Sel, b->Offset, &b->Instr, 1 );
            RdosWriteThreadMem( obj->ThreadID, b->Sel, b->Offset, &brinstr, 1 );
        } else {
            if (bnum < 4) {
                RdosSetCodeBreak( obj->ThreadID, bnum, b->Sel, b->Offset );
                bnum++;
            }
        }
        b = b->Next;
    }
}