kmdb_ctf_open.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"
/*
*
* This interposition layer serves two purposes. First, it allows the
* introduction of a kmdb-specific implementation of ctf_open(). The normal
* ctf_open() call open(2)s a file, and reads the CTF data directly from it.
* No such facility is available in kmdb, as kmdb does not run in userland. We
* can, however, observe that kmdb uses this interface only to read CTF data
* from dmods. dmods, as viewed by kmdb, do have CTF data, but they have it
* in a form that is best accessed by ctf_bufopen(). This interposition layer
* allows us to translate ctf_open() calls into ctf_bufopen() calls.
*
* The second purpose of the interposition layer is to reduce the work needed
* to call mdb_ctf_bufopen.
*/
#include <libctf.h>
#include <ctf_impl.h>
#include <kmdb/kmdb_module.h>
#include <mdb/mdb_string.h>
#include <mdb/mdb_debug.h>
static kmdb_modctl_t *
mdb_ctf_name2ctl(const char *pathname)
{
mdb_var_t *v;
NULL)
return (NULL);
return ((kmdb_modctl_t *)MDB_NV_COOKIE(v));
}
{
return (NULL);
}
*errp = ECTF_NOCTFDATA;
return (NULL);
}
return (NULL);
return (ctfp);
}
void
{
}