コード例 #1
0
ファイル: debug.c プロジェクト: chunhualiu/OpenNT
VOID
bd(
    CMD_ARGLIST
    )
{
    CMD_INIT();
    UpdateBreakPoint(2);
}
コード例 #2
0
ファイル: debug.c プロジェクト: chunhualiu/OpenNT
VOID
be(
    CMD_ARGLIST
    )
{
    CMD_INIT();
    UpdateBreakPoint(3);
}
コード例 #3
0
ファイル: debug.c プロジェクト: chunhualiu/OpenNT
VOID
bc(
    CMD_ARGLIST
    )
{
    CMD_INIT();
    UpdateBreakPoint(1);
}
コード例 #4
0
ファイル: trace.c プロジェクト: chunhualiu/OpenNT
VOID
traced(
    CMD_ARGLIST
    )
{
    CMD_INIT();

    DumpTrace(0);
}
コード例 #5
0
ファイル: trace.c プロジェクト: chunhualiu/OpenNT
VOID
tracedr(
    CMD_ARGLIST
    )
{
    CMD_INIT();

    DumpTrace(1);
}
コード例 #6
0
ファイル: trace.c プロジェクト: chunhualiu/OpenNT
VOID
tracet(
    CMD_ARGLIST
    )
/*++

Routine Description:

    This routine dumps LDT selectors.  The selectors are dumped from the
    user mode Ldt, rather than the system ldt.

Arguments:

    CurrentProcess -- Supplies a handle to the process to dump selectors for
    CurrentThread -- Supplies a handle to the thread to dump selectors for
    ArgumentString -- Supplies the arguments to the !sel command

Return Value

    None.

--*/
{

    PVOID pMem;
    BOOL bTrace;

    CMD_INIT();

    if (!ReadMemExpression("ntvdm!bDpmiTraceOn", &bTrace, 4)) {
        return;
    }
    pMem = (PVOID)EXPRESSION("ntvdm!bDpmiTraceOn");
    if (!pMem) {
        PRINTF("DPMI trace history not available\n");
        return;
    }

    if (!READMEM(pMem, &bTrace, 4)) {
        PRINTF("Error reading memory\n");
        return;
    }

    if (!bTrace) {
        int Count = 0;
        bTrace = 1;
        WRITEMEM(pMem, &bTrace, 4);
        pMem = (PVOID)EXPRESSION("ntvdm!bDpmiTraceCount");
        WRITEMEM(pMem, &Count, 4);
        PRINTF("Trace is now on and reset\n");
    } else {
        bTrace = 0;
        WRITEMEM(&pMem, &bTrace, 4);
        PRINTF("Trace is now off\n");
    }
}
コード例 #7
0
ファイル: dib.c プロジェクト: chunhualiu/OpenNT
VOID 
dhdib(
    CMD_ARGLIST
    )
{
// dump dib support chain
// dumps: dhdib @<address> - dump at address
// dumps: dhdib   - everything...
    
    CHAR* argv[3];
    int nArgs;
    BOOL fDumpDib = TRUE;
    static CHAR* symDibHead = "wow32!pDibInfoHead";
    PDIBINFO pdi;

    CMD_INIT();
    ASSERT_WOW_PRESENT;

    nArgs = WDParseArgStr(lpArgumentString, argv, 2);
    if (nArgs > 0) {

        CHAR* parg = argv[0];
        switch(toupper(*parg)) {  // dump at...
            case '@':
                // recover address and dump!
                {
                    CHAR* pch = *++parg ? 
                                    parg : 
                                    (nArgs >= 2 ? argv[1] : NULL);
                    if (pch) {
                        pdi = (PDIBINFO)WDahtoi(pch);
                        fDumpDib = FALSE;
                    }
                    else {
                        PRINTF("Invalid Parameter\n"); 
                    }
                }
                break;

            default:
                break;
        }
    }


    if (fDumpDib) {
        DumpDibChain(symDibHead, FALSE);
    }
    else {
        if (pdi) {
            DumpDibInfo(pdi, FALSE);
        }
    }
}
コード例 #8
0
ファイル: debug.c プロジェクト: chunhualiu/OpenNT
VOID
bp(
    CMD_ARGLIST
    )
{
    ULONG lpAddress, lpTmp;
    VDM_BREAKPOINT VdmBreakPoint;
    int BPNum;
    VDMCONTEXT      ThreadContext;
    WORD            selector;
    ULONG           offset;
    USHORT          count = 1;
    int mode;
    USHORT flags = 0;

    CMD_INIT();

    lpAddress = (*GetExpression)("ntvdm!VdmBreakPoints");

    if (!lpAddress) {
        PRINTF("Could not find symbol ntvdm!VdmBreakPoints\n");
        return;
    }

    mode = GetContext( &ThreadContext );

    if (!GetNextToken()) {
        PRINTF("Please enter an address\n");
        return;
    }

    if (!ParseIntelAddress(&mode, &selector, &offset)) {
        return;
    }

    if (mode == V86_MODE) {
        flags = VDMBP_V86;
    }

    //
    // first see if it's set already
    //
    for (lpTmp = lpAddress, BPNum = 0; BPNum < MAX_VDM_BREAKPOINTS;
                           BPNum++, lpTmp+=sizeof(VDM_BREAKPOINT)) {

        if (!READMEM((PVOID)lpTmp, &VdmBreakPoint, sizeof(VDM_BREAKPOINT))) {
            PRINTF("Error reading BP memory\n");
            return;
        }

        if (VdmBreakPoint.Flags & VDMBP_SET) {
            if ((VdmBreakPoint.Seg == selector) &&
                (VdmBreakPoint.Offset == offset) &&
                !(VdmBreakPoint.Flags ^ flags))
                                                 {

                VdmBreakPoint.Count = count;
                VdmBreakPoint.Flags |= VDMBP_FLUSH;

                if (!(VdmBreakPoint.Flags & VDMBP_ENABLED)) {
                    EnableBreakPoint(&VdmBreakPoint);
                }

                WRITEMEM((PVOID)lpTmp, &VdmBreakPoint, sizeof(VDM_BREAKPOINT));
                PRINTF("breakpoint %d redefined\n", BPNum);
                return;

            }
        }
    }


    for (lpTmp = lpAddress, BPNum = 0; BPNum < MAX_VDM_BREAKPOINTS;
                    BPNum++,lpTmp+=sizeof(VDM_BREAKPOINT)) {
        if (!READMEM((PVOID)lpTmp, &VdmBreakPoint, sizeof(VDM_BREAKPOINT))) {
            PRINTF("Error reading BP memory\n");
            return;
        }

        if (!(VdmBreakPoint.Flags & VDMBP_SET)) {
            VdmBreakPoint.Seg = selector;
            VdmBreakPoint.Offset = offset;
            VdmBreakPoint.Count = count;
            VdmBreakPoint.Flags = VDMBP_SET | VDMBP_FLUSH;
            EnableBreakPoint(&VdmBreakPoint);

            WRITEMEM((PVOID)lpTmp, &VdmBreakPoint, sizeof(VDM_BREAKPOINT));
            return;

        }
    }
}
コード例 #9
0
ファイル: debug.c プロジェクト: chunhualiu/OpenNT
VOID
bl(
    CMD_ARGLIST
    )
{
    ULONG lpAddress;
    VDM_BREAKPOINT VdmBreakPoint;
    int BPNum;
    int mode;
    DWORD dist;
    CHAR  sym_text[255];

    CMD_INIT();

    lpAddress = (*GetExpression)("ntvdm!VdmBreakPoints");

    if (!lpAddress) {
        PRINTF("Could not find symbol ntvdm!VdmBreakPoints\n");
        return;
    }

    for (BPNum = 0; BPNum < MAX_VDM_BREAKPOINTS;
                         BPNum++, lpAddress+=sizeof(VDM_BREAKPOINT)) {

        if (!READMEM((PVOID)lpAddress, &VdmBreakPoint, sizeof(VDM_BREAKPOINT))) {
            PRINTF("Error reading BP memory\n");
            return;
        }

        if (VdmBreakPoint.Flags & VDMBP_SET) {

            PRINTF("%d %s ", BPNum,
                    (VdmBreakPoint.Flags & VDMBP_ENABLED) ? "e" : "d");

            if (VdmBreakPoint.Flags & VDMBP_V86) {
                mode = V86_MODE;
                PRINTF("&");
            } else {
                mode = PROT_MODE;
                PRINTF("#");
            }

            PRINTF("%04X:", VdmBreakPoint.Seg);

            if (VdmBreakPoint.Offset > 0xffff) {
                PRINTF("%08X", VdmBreakPoint.Offset);
            } else {
                PRINTF("%04X", VdmBreakPoint.Offset);
            }

            PRINTF("   %04X:***", VdmBreakPoint.Count);


            if (FindSymbol(VdmBreakPoint.Seg, VdmBreakPoint.Offset,
                           sym_text, &dist, BEFORE, mode )) {

                if ( dist == 0 ) {
                    PRINTF(" %s\n", sym_text );
                } else {
                    PRINTF(" %s+0x%lx\n", sym_text, dist );
                }
            }
        }
    }
}
コード例 #10
0
/* FIXME: All modules should get params from mod_dispatch */
static int init_modules(igd_param_t *params, igd_context_t *context)
{
	unsigned int ret;

	EMGD_TRACE_ENTER;

	/*
	 * Reg module must be first so that the state of the device can be
	 * saved before anything else is touched.
	 */
	ret = REG_INIT(context, (params->preserve_regs)?IGD_DRIVER_SAVE_RESTORE:0);
	if (ret) {
		EMGD_DEBUG("Error initializing register module");
	}

	/*
	 *  GMM is not optional. Its init function must exist.
	 */
	ret = gmm_init(context, params->page_request, params->max_fb_size);
	if(ret) {
		EMGD_ERROR_EXIT("GMM Module Init Failed");
		return ret;
	}

	ret = CMD_INIT(context);
	if(ret) {
		EMGD_ERROR_EXIT("Command Module Init Failed");
		return ret;
	}

	/*
	 *  Mode is not optional. Its init function must exist.
	 */
	ret = mode_init(context);
	if (ret) {
		EMGD_ERROR_EXIT("Mode Module Init Failed");
		return ret;
	}

	ret = APPCONTEXT_INIT(context);
	if (ret) {
		EMGD_ERROR_EXIT("Appcontext Module Init Failed");
		return ret;
	}

	ret = OVERLAY_INIT(context, params);
	if(ret) {
		EMGD_ERROR_EXIT("Overlay Module Init Failed");
		return ret;
	}

	ret = PWR_INIT(context);
	if(ret) {
		EMGD_DEBUG("Error initializing power module");
	}

	ret = RESET_INIT(context);
	if(ret) {
		EMGD_DEBUG("Error initializing reset module");
	}

	ret = OS_INIT_INTERRUPT(context->device_context.did,
		context->device_context.virt_mmadr);
	if(ret) {
		EMGD_ERROR_EXIT("Interrupt Module Init Failed");
		return ret;
	}

	ret = BLEND_INIT(context);
	if(ret) {
		EMGD_DEBUG("Error initializing blend module");
	}

	ret = INIT_2D(context);
	if(ret) {
		EMGD_DEBUG("Error initializing 2d module");
	}

	EMGD_TRACE_EXIT;
	return 0;
}
コード例 #11
0
ファイル: cmd.c プロジェクト: badcodes/c
int cmd_init() {
   CMD_INIT(help);
   return 1;
}