Example #1
0
static	int
Methods( char *aStrCID )
{
	CKey	key ;
	int	i ;

	if ( aStrCID == NULL ) return( 1 ) ;

	if ( OzStrlen( aStrCID ) < 16 ) {
		key.cid = OzExecutorID | OzStrtoul( aStrCID, 0, 16 ) ;
	} else {
		key.cid = OzStrtoull( aStrCID, 0, 16 ) ;
	}
	key.code = NULL ;

	if ( ClMapCode( methods_sub, &key ) == 0 ) {
		OzOutput( -1, "Not found class %016lx.\n",  key.cid ) ;
		return( -1 ) ;
	}
	if ( key.code == NULL ) {
		OzOutput( -1, "Not loaded class %016lx.\n",  key.cid ) ;
		return( -1 ) ;
	}

	for ( i = 0 ; i < key.code->fp_table->number_of_entry ; i ++ ) {
		OzOutput( -1, "0x%08x", key.code->fp_table->functions[i] ) ;
		print_pc( (caddr_t)key.code->fp_table->functions[i] ) ;
		OzOutput( -1, "\n" ) ;
	}
	ClReleaseCode( key.code ) ;

	return( 0 ) ;
}
Example #2
0
void SEARCHER::print_board() {
    int i , j;
    print("\n");
    for(i = 7; i >= 0; i--) {
        print("\t");
        for(j = 0;j < 8; j++) {
            print("%c",piece_name[board[SQ(i,j)]]);
        }
        print("\n");
    }
#ifdef  _DEBUG
    print("play = %d opp = %d ep = %d\n",player,opponent,epsquare);
    PLIST current;
    char  str[4];
    for(i = wking;i <= bpawn;i++) {
        current = plist[i];
        print_pc(i);
        print(":");
        while(current) {
            sq_str(current->sq,str);
            print("%5s",str);
            current = current->next;
        }
        print("\n");
    }
#endif
}
Example #3
0
static	void
dump_stack( OZ_Thread t, int mode )
{
	int	signo ;
	int	code ;
	void	*pc ;
	frame_t	*sp ;
	frame_t	*fp ;
	void	*addr ;

	if ( t == ThrRunningThread ) {
		OzOutput( -1, "%d Running.\n", t->tid ) ;
		return ;
	}

#if	#system(bsd)
	pc = (void *)t->context[3] ;
	sp = (frame_t *)t->context[2] ;
#endif
#if	#system(svr4)
	pc = (void *)t->context[2] ;
	sp = (frame_t *)t->context[1] ;
#endif

	OzOutput( -1, "%d ", t->tid ) ;
	print_status( t->status, t->suspend_count ) ;
	if ( t->signal_stack.ss_onstack ) {
		fp = (frame_t *)sp->r_i6 ;
		signo = fp->r_i0 ;
		code = fp->r_i1 ;
		pc = (void *)fp->r_i2 ;
		sp = (frame_t *)fp->r_i3 ;
		addr = (void *)fp->r_i4 ;
		if ( mode ) {
			OzOutput( -1, " %s(%d)", OzStrsignal(signo), code ) ;
		} else {
			OzOutput( -1, " %s(code=%d,pc=0x%x,sp=0x%x,addr=0x%x)",
				OzStrsignal(signo), code, pc, sp, addr ) ;
		}
	} else signo = 0 ;

	if ( mode ) {
		int	user ;
		void	*top = pc ;
		void	*next ;
		user = DlIsCore( pc ) ? 0 : 1 ;
		for (;;) {
			if ( (caddr_t)sp < t->stack
				|| t->stack_bottom < (caddr_t)sp ) {
				OzOutput( -1, " stack overflow" ) ;
				break ;
			}
			next = (void *)sp->r_i7 ;
			sp = (frame_t *)sp->r_i6 ;
			if ( sp->r_i6 == 0 ) break ;
			if ( DlIsCore( next ) == 0 ) user = 1 ;
			else if ( user ) break ;
			pc = next ;
		}
		if ( top == pc ) {
			OzOutput( -1, " 0x%08x", pc ) ;
			print_pc( pc - (signo == 0 ? 8 : 0) ) ;
		} else {
			OzOutput( -1, " 0x%08x", pc+8 ) ;
			print_pc( pc ) ;
		}
		if ( t->channel != NULL ) {
			OzRecvChannel	rchan = (OzRecvChannel)t->channel ;
			OzOutput( -1, " on %016lx", rchan->pid ) ;
		}
		OzOutput( -1, "\n" ) ;
	} else {
		if ( t->channel != NULL ) {
			OzRecvChannel	rchan = (OzRecvChannel)t->channel ;
			OzOutput( -1, " on %016lx\n", rchan->pid ) ;
		} else OzOutput( -1, "\n" ) ;
		OzOutput( -1, "0x%08x", pc ) ;
		print_pc( pc - (signo == 0 ? 8 : 0) ) ;
		OzOutput( -1, "\n" ) ;
		for (;;) {
			if ( (caddr_t)sp < t->stack
				|| t->stack_bottom < (caddr_t)sp ) {
				OzOutput( -1, " stack overflow\n" ) ;
				break ;
			}
			pc = (void *)sp->r_i7 ;
			sp = (frame_t *)sp->r_i6 ;
			if ( sp->r_i6 == 0 ) break ;
			OzOutput( -1, "0x%08x", pc+8 ) ;
			print_pc( pc ) ;
			OzOutput( -1, "(0x%x)\n", sp->r_i0 ) ;
		}
	}
}
Example #4
0
static	void
dump_stack( OZ_Thread t, int mode )
{
	int	signo ;
	void	*pc ;
	frame_t	*sp ;

	if ( t == OzRunningThread ) {
		OzOutput( -1, "%d Running.\n", t->id ) ;
		return ;
	}

#if	#system(bsd)
	pc = (void *)t->context[3] ;
	sp = (frame_t *)t->context[2] ;
#endif
#if	#system(svr4)
	pc = (void *)t->context[2] ;
	sp = (frame_t *)t->context[1] ;
#endif

	if ( t->signal_stack.ss_onstack ) {
		sp = (frame_t *)sp->r_i6 ;
		signo = sp->r_i0 ;
		pc = (void *)sp->r_i1 ;
		sp = (frame_t *)sp->r_i2 ;
	} else signo = 0 ;
	OzOutput( -1, "%d ", t->id ) ;
	print_status( t->status, t->suspend_count ) ;
	if ( signo ) OzOutput( -1, " %s", OzStrsignal(signo) );

	if ( mode ) {
		int	user = 0 ;
		void	*top = pc ;
		void	*next ;
		for (;;) {
			next = (void *)sp->r_i7 ;
			sp = (frame_t *)sp->r_i6 ;
			if ( sp->r_i6 == 0 ) break ;
			if ( DlIsCore( next ) == 0 ) user = 1 ;
			else if ( user ) break ;
			pc = next ;
		}
		if ( top == pc ) {
			OzOutput( -1, " 0x%08x", pc ) ;
			print_pc( pc - (signo == 0 ? 8 : 0) ) ;
		} else {
			OzOutput( -1, " 0x%08x", pc+8 ) ;
			print_pc( pc ) ;
		}
		if ( t->channel != NULL ) {
			OzRecvChannel	rchan = (OzRecvChannel)t->channel ;
			OzOutput( -1, " on %016lx", rchan->pid ) ;
		}
		OzOutput( -1, "\n" ) ;
	} else {
		if ( t->channel != NULL ) {
			OzRecvChannel	rchan = (OzRecvChannel)t->channel ;
			OzOutput( -1, " on %016lx\n", rchan->pid ) ;
		} else OzOutput( -1, "\n" ) ;
		OzOutput( -1, "0x%08x", pc ) ;
		print_pc( pc - (signo == 0 ? 8 : 0) ) ;
		OzOutput( -1, "\n" ) ;
		for (;;) {
			pc = (void *)sp->r_i7 ;
			sp = (frame_t *)sp->r_i6 ;
			if ( sp->r_i6 == 0 ) break ;
			OzOutput( -1, "0x%08x", pc+8 ) ;
			print_pc( pc ) ;
			OzOutput( -1, "\n" ) ;
		}
	}
}