/*
* 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"
#include "disasm.h"
/*
* I don't like this global but it's a work-around for the
* poor disassemble interface for now.
*/
/*
* This routine converts 'address' into it's closest symbol
* representation.
*
* The following flags are used to effect the output:
*
* FLG_PAP_SONAME
* embed the SONAME in the symbol name
* FLG_PAP_NOHEXNAME
* if no symbol found return a null string
* If this flag is not set return a string displaying
* the 'hex' value of address.
* FLG_PAP_PLTDECOM
* decompose the PLT symbol if possible
*/
char *
{
char *str;
if (flags & FLG_PAP_SONAME) {
/*
* Embed SOName in symbol name
*/
} else
} else
buf[0] = '\0';
if ((flags & FLG_PAP_PLTDECOM) &&
sizeof (pstatus), 0) == -1)
perr("pap: reading pstatus");
char *_str;
"%s0x%lx:plt(%s)",
return (buf);
}
}
}
return (buf);
} else {
else
return (buf);
}
} else {
if (flags & FLG_PAP_NOHEXNAME)
buf[0] = '\0';
else
return (buf);
}
}
char *
{
}
{
offset += 4) {
char *instr_str;
unsigned int instr;
sizeof (unsigned)) != PS_OK)
perror("da: ps_pread");
vers);
}
return (RET_OK);
}
void
{
perr("disasm: PIOCSTATUS");
}