Exemplo n.º 1
0
/* RxGetInfo function
 * returns a string in the following format
 * breakpoint status   program state
 * source file name (or NOSOURCE)   address range for source
 * line number range for source
 *
 */
BOOL	RXGetInfo(char *args) {
ULONG addr, line = 0, startaddr, endaddr;
long	info[2];    //	info[0] == lineBeg, info[1] == lineNo
int first = 0, last = 0, type;
short undef = TRUE, i;
DEBUG	*debug;

    if(*args) {
        addr = ParseExp(args, &undef, strlen(args));
    }
    if(undef)addr = programPC;
    debug = FindNearestDebug(addr);

    // give breakpoint info and program status first
    if(IsBreakpoint(addr))sprintf(RexxReplyString,"BP ");
    sprintf(RexxReplyString,"NOBP ");

    strcat(RexxReplyString,StateText(programState));

    if(debug) {	// we have source

        // find end of this source range
        type = CurrentMixedLine(&addr,&line,info);
	if (type == 0)type = NextMixedLine(&addr, &line, info);

        if(type == MIXTYPE_SOURCE) {
	    first = info[1];
	    // find end of range for the target range
	    while(NextMixedLine(&addr,&line,info) == MIXTYPE_SOURCE);
	    last = info[1];
	}

	// now find the address range for this line
	startaddr = endaddr = addr;
	while(NextMixedLine(&addr,&line,info) == MIXTYPE_DISM)endaddr=addr;

	// give source range, then address range
	i = strlen(RexxReplyString);
	sprintf(&RexxReplyString[i]," %d. %d. %08X %08X",first,last,startaddr,endaddr);

	// finally, give the file name
	strcat(RexxReplyString," ");
	strcat(RexxReplyString,DirBuf);
	strcat(RexxReplyString,debug->sourceName);
    }
    else {
	strcat(RexxReplyString," NOSOURCE 0. 0. 0 0 NOSOURCE"); 
    }
    return TRUE;
}
Exemplo n.º 2
0
WORD	RefreshRegisters(WORD maxLines, BOOL fullRefresh) {
	WORD	count = 0;

    if(CurDisplay->ds_RegFlag) {

	RefreshRegister("D0", programD0, lastD0);
	RefreshRegister("D1", programD1, lastD1);
	RefreshRegister("D2", programD2, lastD2);
	RefreshRegister("D3", programD3, lastD3);
	count++; 
	Newline(); 
	maxLines--; 
	if (!maxLines) return count;

	RefreshRegister("D4", programD4, lastD4);
	RefreshRegister("D5", programD5, lastD5);
	RefreshRegister("D6", programD6, lastD6);
	RefreshRegister("D7", programD7, lastD7);
	count++; Newline(); maxLines--; if (!maxLines) return count;

	RefreshRegister("A0", programA0, lastA0);
	RefreshRegister("A1", programA1, lastA1);
	RefreshRegister("A2", programA2, lastA2);
	RefreshRegister("A3", programA3, lastA3);
	count++; Newline(); maxLines--; if (!maxLines) return count;

	RefreshRegister("A4", programA4, lastA4);
	RefreshRegister("A5", programA5, lastA5);
	RefreshRegister("A6", programA6, lastA6);
	RefreshRegister("A7", programA7, lastA7);
	count++; Newline(); maxLines--; if (!maxLines) return count;

	RefreshRegister("PC", programPC, lastPC);
	ScrPlain();
	ScrPrintf("SR: ");
	if (programSR != lastSR)ScrHighlight();
	ScrPrintf("$%04X ", programSR);
	DisplayFlags();
	ScrPlain();
	ScrPrintf("STATE: ");
	if (programState != lastState)
	    ScrHighlight();
	ScrPrintf("%s", StateText(programState));
	count++; Newline(); maxLines--; if (!maxLines) return count;
    }
    return count;
}