mdb_module_load.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <unistd.h>
#include <strings.h>
#include <dlfcn.h>
#include <link.h>
#include <mdb/mdb_module.h>
#include <mdb/mdb_modapi.h>
#include <mdb/mdb_debug.h>
#include <mdb/mdb_string.h>
#include <mdb/mdb_frame.h>
int
{
const char *wformat = "no module '%s' could be found\n";
char buf[MAXPATHLEN], *p;
int i;
strbasename(name));
*p = '\0'; /* eliminate suffixes */
}
goto err;
goto err;
}
}
/*
* If a simple name is specified, search for it in the module path.
* The module path is searched in order, and for each element we
* look for the following files:
*
* 1. If the module name ends in ".so.[0-9]+", search for the literal
* name and then search for the name without the [0-9]+ suffix.
* 2. If the module name ends in ".so", search for the literal name.
* 3. Search for the module name with ".so" appended.
*
* Once a matching file is detected, we attempt to load that module
* and do not resume our search in the case of an error.
*/
"checking for %s\n", buf);
}
}
*p = '\0'; /* strip trailing digits */
"checking for %s\n", buf);
}
}
}
}
err:
if (!(mode & MDB_MOD_SILENT))
return (-1);
}
typedef struct mdb_modload_data {
int mld_first;
int mld_mode;
/*ARGSUSED*/
static int
{
}
}
return (0);
}
void
mdb_module_load_all(int mode)
{
}
int
{
return (mdb_module_unload_common(name));
}