FreeBSD/sys/ddb/db_sym.c
/*
 * Find the closest symbol to val, and return its name
 * and the difference between val and the symbol found.
 */
Find the closest symbol to val, and return its name
and the difference between val and the symbol found.
Find the closest symbol to val and return its name and the difference between val and the symbol found .
c_db_sym_t
db_search_symbol(db_addr_t val, db_strategy_t strategy, db_expr_t *offp)
{
	register
	unsigned int	diff;
	size_t		newdiff;
	register int	i;
	c_db_sym_t	ret = C_DB_SYM_NULL, sym;
	newdiff = diff = ~0;
	for (i = 0; i < db_nsymtab; i++) {
	    sym = X_db_search_symbol(&db_symtabs[i], val, strategy, &newdiff);
	    if (newdiff < diff) {
		db_last_symtab = &db_symtabs[i];
		diff = newdiff;
		ret = sym;
	    }
	}
	*offp = diff;
	return ret;
}
c_db_sym_t db_search_symbol ( db_addr_t val , db_strategy_t strategy , db_expr_t * offp ) { register unsigned int diff ; size_t newdiff ; register int i ; c_db_sym_t ret = C_DB_SYM_NULL , sym ; newdiff = diff = ~ 0 ; for ( i = 0 ; i < db_nsymtab ; i ++ ) { sym = X_db_search_symbol ( & db_symtabs [ i ] , val , strategy , & newdiff ) ; if ( newdiff < diff ) { db_last_symtab = & db_symtabs [ i ] ; diff = newdiff ; ret = sym ; } } * offp = diff ; return ret ; }
Find the closest symbol to val, and return its name
 and the difference between val and the symbol found.
Find the closest symbol to val and return its name and the difference between val and the symbol found .