db_printf("bad name read of %x at line %d\n", ptr, __LINE__);
db_printf("bad name read of %lx at line %d\n", ptr, __LINE__);
db_task_name(){	static unsigned buffer[(DB_TASK_NAME_LEN + 5) / sizeof(unsigned)];	vaddr_t ptr = (vaddr_t)(TOP_OF_USER_STACK - 4);	vaddr_t limit = ptr - MAX_DISTANCE_TO_LOOK;	unsigned word;	int i;	/* skip zeros at the end */	while (ptr > limit &&	       (i = db_trace_get_val(ptr, &word)) && (word == 0)) {		ptr -= 4; /* continue looking for a non-null word */	}	if (ptr <= limit) {		db_printf("bad name at line %d\n", __LINE__);		return "<couldn't find 1>";	} else if (i != 1) {		return "<nostack>";	}	/* skip looking for null before all the text */	while (ptr > limit &&	       (i = db_trace_get_val(ptr, &word)) && (word != 0)) {		ptr -= 4; /* continue looking for a null word */	}	if (ptr <= limit) {		db_printf("bad name at line %d\n", __LINE__);		return "<couldn't find 2>";	} else if (i != 1) {		db_printf("bad name read of %x at line %d\n", ptr, __LINE__);		return "<bad read 2>";	}	ptr += 4; /* go back to the non-null word after this one */	for (i = 0; i < sizeof(buffer); i++, ptr += 4) {		buffer[i] = 0; /* just in case it's not read */		db_trace_get_val(ptr, &buffer[i]);	}	return (char *)buffer;}