/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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
*/
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <procfs.h>
#include <libelf.h>
#include <stdarg.h>
#include "rdb.h"
static const char *fault_strings[] = {
"<null string>",
"illegal instruction",
"privileged instruction",
"breakpoint instruction",
"trace trap (single-step)",
"Memory access (e.g., alignment)",
"Memory bounds (invalid address)",
"Integer overflow",
"Integer zero divide"
"Floating-point exception",
"Irrecoverable stack faul",
"Recoverable page fault (no associated sig)"
};
{
;
/*
* already have break point set here.
*/
return (RET_OK);
}
/*
* insert at head
*/
return (RET_OK);
}
return (RET_OK);
}
static bptlist_t *
{
;
return ((bptlist_t *)-1);
return (cur);
}
static retc_t
{
;
return (RET_FAILED);
else
return (RET_OK);
}
void
{
(void) printf("no active breakpoints.\n");
return;
}
(void) printf("active breakpoints:\n");
}
}
static void
{
sizeof (bptinstr_t)) != PS_OK)
perr("sb: error setting breakpoint");
sizeof (bptinstr_t)) != PS_OK)
perr("sb1: error setting breakpoint\n");
}
}
static void
{
/*
* Restore all the original instructions
*/
sizeof (bptinstr_t)) != PS_OK)
perr("cb: error clearing breakpoint");
}
{
return (RET_OK);
if (prev)
if (prev)
return (RET_OK);
}
{
return (RET_FAILED);
return (RET_OK);
}
static void
{
return;
}
else
if ((rdb_flags & RDB_FL_EVENTS) == 0)
return;
(void) printf("dlactivity: state changed to: ");
case RD_CONSISTENT:
(void) printf("RD_CONSISTENT\n");
break;
case RD_ADD:
(void) printf("RD_ADD\n");
break;
case RD_DELETE:
(void) printf("RD_DELETE\n");
break;
default:
}
return;
}
if ((rdb_flags & RDB_FL_EVENTS) == 0)
return;
(void) printf("preinit reached\n");
return;
}
(void) printf("postinit reached\n");
}
unsigned
{
/*
* We step by the first instruction incase their was
* a break-point there.
*/
premptyset(&faults);
/* LINTED CONSTANT */
while (1) {
set_breaks(ph);
(void) printf("process terminated.\n");
return (0);
}
perr("ctb: PCWSTOP");
}
perr("ctb: reading status");
const char *fltmsg;
else
fltmsg = "<unknown error>";
"on why: 0x%x what: %s(0x%x)\n",
return (0);
}
perr("ctb: PCCFAULT");
(bptlist_t *)-1) {
"stopped at unregistered breakpoint! "
"addr: 0x%x\n",
break;
}
/*
* If this was a BP at which we should stop
*/
break;
}
(void) printf("break point reached at addr: 0x%x\n",
}
}
{
return ((ulong_t)0);
return (pltbase);
return ((ulong_t)0);
}
{
int i;
long oper;
long flags;
perr("stn: reading status");
premptyset(&faults);
for (i = 0; i < count; i++) {
}
if (flgs & FLG_SN_VERBOSE)
perr("stn: PCSFAULT");
perr("stn: PCRUN(PRSETP)");
perr("stn: PCWSTOP stepping");
perr("stn1: reading status");
return (RET_FAILED);
}
if ((flgs & FLG_SN_PLTSKIP) &&
"sn: rd_plt_resolution failed\n");
return (RET_FAILED);
}
unsigned bpflags;
if (bpflags & FLG_BP_PLTRES)
}
}
perr("stn: PRCFAULT");
}
return (RET_OK);
}
void
{
int count = 0;
perr("sta: reading status");
perr("sta1: reading status");
if ((count % 10000) == 0) {
}
count++;
}
(void) printf("address found %d instructions in: pc: 0x%lx addr: "
}