FreeBSD/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c
/*
 * A pointer is generally printed as a fixed-size integer.  If we have a
 * function pointer, we try to look up its name.
 */
A pointer is generally printed as a fixed-size integer.  If we have a
function pointer, we try to look up its name.
A pointer is generally printed as a fixed - size integer . If we have a function pointer we try to look up its name .
static void
dt_print_ptr(ctf_id_t base, ulong_t off, dt_printarg_t *pap)
{
	FILE *fp = pap->pa_file;
	ctf_file_t *ctfp = pap->pa_ctfp;
	caddr_t addr = pap->pa_addr + off / NBBY;
	size_t size = ctf_type_size(ctfp, base);
	ctf_id_t bid = ctf_type_reference(ctfp, base);
	uint64_t pc;
	dtrace_syminfo_t dts;
	GElf_Sym sym;
	if (bid == CTF_ERR || ctf_type_kind(ctfp, bid) != CTF_K_FUNCTION) {
		dt_print_hex(fp, addr, size);
	} else {
		pc = *((uint64_t *)addr);
		if (dtrace_lookup_by_addr(pap->pa_dtp, pc, &sym, &dts) != 0) {
			dt_print_hex(fp, addr, size);
		} else {
			(void) fprintf(fp, "%s`%s", dts.dts_object,
			    dts.dts_name);
		}
	}
}
static void dt_print_ptr ( ctf_id_t base , ulong_t off , dt_printarg_t * pap ) { FILE * fp = pap -> pa_file ; ctf_file_t * ctfp = pap -> pa_ctfp ; caddr_t addr = pap -> pa_addr + off / NBBY ; size_t size = ctf_type_size ( ctfp , base ) ; ctf_id_t bid = ctf_type_reference ( ctfp , base ) ; uint64_t pc ; dtrace_syminfo_t dts ; GElf_Sym sym ; if ( bid == CTF_ERR || ctf_type_kind ( ctfp , bid ) != CTF_K_FUNCTION ) { dt_print_hex ( fp , addr , size ) ; } else { pc = * ( ( uint64_t * ) addr ) ; if ( dtrace_lookup_by_addr ( pap -> pa_dtp , pc , & sym , & dts ) != 0 ) { dt_print_hex ( fp , addr , size ) ; } else { ( void ) fprintf ( fp , " " , dts . dts_object , dts . dts_name ) ; } } }
A pointer is generally printed as a fixed-size integer.
A pointer is generally printed as a fixed - size integer .
/* LINTED - alignment */