Beispiel #1
0
void
proc_updatesyms(struct proc_handle *phdl)
{

	memset(phdl->mappings, 0, sizeof(*phdl->mappings) * phdl->maparrsz);
	rd_loadobj_iter(phdl->rdap, map_iter, phdl);
}
Beispiel #2
0
static void
kp_activate(mdb_tgt_t *t)
{
	kp_data_t *kp = t->t_data;

	mdb_prop_postmortem = TRUE;
	mdb_prop_kernel = FALSE;

	if (kp->kp_model == PR_MODEL_ILP32)
		mdb_prop_datamodel = MDB_TGT_MODEL_ILP32;
	else
		mdb_prop_datamodel = MDB_TGT_MODEL_LP64;

	/*
	 * Initialize our rtld_db agent and then iterate over the link map,
	 * instantiating kp_file objects as we go.
	 */
	if ((kp->kp_rap = rd_new((struct ps_prochandle *)t)) != NULL) {
		(void) rd_loadobj_iter(kp->kp_rap, (rl_iter_f *)
		    kp_iter_mapping, t);
	} else {
		mdb_warn("unable to initialize rtld_db agent for proc %p\n",
		    (void *)kp->kp_proc);
	}

	(void) mdb_tgt_register_dcmds(t, &kp_dcmds[0], MDB_MOD_FORCE);

	if (kp->kp_map_exec != NULL && kp->kp_map_exec->kpm_file != NULL)
		mdb_tgt_elf_export(kp->kp_map_exec->kpm_file->kpf_file);
	else
		mdb_tgt_elf_export(NULL);
}
Beispiel #3
0
void
proc_updatesyms(struct proc_handle *phdl)
{

	memset(phdl->rdobjs, 0, sizeof(*phdl->rdobjs) * phdl->rdobjsz);
	phdl->nobjs = 0;
	rd_loadobj_iter(phdl->rdap, map_iter, phdl);
}
Beispiel #4
0
rd_agent_t *
proc_rdagent(struct proc_handle *phdl)
{
	if (phdl->rdap == NULL && phdl->status != PS_UNDEAD &&
	    phdl->status != PS_IDLE) {
		if ((phdl->rdap = rd_new(phdl)) != NULL) {
			phdl->rdobjs = malloc(sizeof(*phdl->rdobjs) * 64);
			phdl->rdobjsz = 64;
			if (phdl->rdobjs == NULL)
				return (phdl->rdap);
			rd_loadobj_iter(phdl->rdap, map_iter, phdl);
		}
	}

	return (phdl->rdap);
}
Beispiel #5
0
rd_agent_t *
proc_rdagent(struct proc_handle *phdl)
{

	if (phdl->rdap == NULL && phdl->status != PS_UNDEAD &&
	    phdl->status != PS_IDLE) {
		if ((phdl->rdap = rd_new(phdl)) == NULL)
			return (NULL);

		phdl->maparrsz = 64;
		phdl->mappings = calloc(phdl->maparrsz,
		    sizeof(*phdl->mappings));
		if (phdl->mappings == NULL)
			return (phdl->rdap);
		if (rd_loadobj_iter(phdl->rdap, map_iter, phdl) != RD_OK)
			return (NULL);
	}
	return (phdl->rdap);
}