Exemplo n.º 1
0
/*
 * Return the name and value for a symbol.
 */
void
X_db_symbol_values(db_symtab_t *symtab, c_db_sym_t dbsym, const char **namep,
		   db_expr_t *valuep)
{
	c_linker_sym_t sym = (c_linker_sym_t) dbsym;
	linker_symval_t symval;

	symval.name = NULL;
	symval.value = NULL;
	linker_ddb_symbol_values(sym, &symval);
	if (namep)
	    *namep = (const char*) symval.name;
	if (valuep)
	    *valuep = (db_expr_t) symval.value;
}
Exemplo n.º 2
0
static int
stack_symbol_ddb(vm_offset_t pc, const char **name, long *offset)
{
	linker_symval_t symval;
	c_linker_sym_t sym;

	if (linker_ddb_search_symbol((caddr_t)pc, &sym, offset) != 0)
		goto out;
	if (linker_ddb_symbol_values(sym, &symval) != 0)
		goto out;
	if (symval.name != NULL) {
		*name = symval.name;
		return (0);
	}
 out:
	*offset = 0;
	*name = "??";
	return (ENOENT);
}