plan 9 kernel history: overview | file list | diff list

1991/1113/gnot/trap.c (diff list | history)

1991/1112/sys/src/9/gnot/trap.c:68,811991/1113/sys/src/9/gnot/trap.c:68,85 (short | long | prev | next)
1990/03091    
}; 
 
char* 
excname(unsigned vo) 
1991/1113    
excname(unsigned vo, ulong pc) 
1990/03091    
{ 
	static char buf[32];	/* BUG: not reentrant! */ 
 
	vo &= 0x0FFF; 
	vo >>= 2; 
	if(vo < sizeof trapname/sizeof(char*)) 
1991/1113    
	if(vo < sizeof trapname/sizeof(char*)){ 
		/* special case, and pc will be o.k. */ 
		if(vo==4 && *(ushort*)pc==0x4848) 
			return "breakpoint"; 
1990/03091    
		return trapname[vo]; 
1991/1113    
	} 
1990/03091    
	sprint(buf, "offset 0x%ux", vo<<2); 
	return buf; 
} 
1991/1112/sys/src/9/gnot/trap.c:93,1021991/1113/sys/src/9/gnot/trap.c:97,106
1991/1112    
		u->dbgreg = ur; 
	} 
1990/03091    
	if(user){ 
1991/0705    
		sprint(buf, "sys: %s pc=0x%lux", excname(ur->vo), ur->pc); 
1991/1113    
		sprint(buf, "sys: %s pc=0x%lux", excname(ur->vo, ur->pc), ur->pc); 
1990/03091    
		postnote(u->p, 1, buf, NDebug); 
	}else{ 
1990/1127    
		print("kernel trap vo=0x%ux pc=0x%lux\n", ur->vo, ur->pc); 
1991/1113    
		print("kernel trap %s pc=0x%lux\n", excname(ur->vo, ur->pc), ur->pc); 
1990/03091    
		dumpregs(ur); 
		exit(); 
	} 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)