/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1994, by Sun Microsytems, Inc.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Interfaces that deal with loadobjects (shared objects) in target
*/
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <link.h>
#include <unistd.h>
#include "tnfctl.h"
#include "prb_proc_int.h"
#include "dbg.h"
/*
* iterate over all loadobjects calling the callback function "obj_func"
* for every loadobject with information about the loadobject.
*/
{
int retval = 0;
"start prb_loadobj_iter; sunw%verbosity 1");
"prb_loadobj_iter: dbgaddr not set\n"));
return (PRB_STATUS_BADARG);
}
sizeof (dentry));
"prb_lmap_update: error in d_un.d_ptr\n"));
return (prbstat);
}
/* read in the debug struct that it points to */
if (prbstat)
return (prbstat);
/* if the link map is not consistent, bail now */
return (PRB_STATUS_BADLMAPSTATE);
if (prbstat)
return (prbstat);
/*
* client of this interface should deal with -1 for objfd,
* so no error checking is needed on this ioctl
*/
/* check for error */
if (retval == 1)
return (PRB_STATUS_BADARG);
}
"end prb_loadobj_iter; sunw%verbosity 1");
return (PRB_STATUS_OK);
}
/*
* Return a fd for the main executable and also the address of where
* it was mapped.
*/
{
int procfd;
int retfd;
if (retfd < 0) {
goto again;
"prb_mainobj_get: PIOCOPENM failed: %s\n",
return (prb_status_map(errno));
}
*baseaddr = 0;
return (PRB_STATUS_OK);
}