Pisadep.c revision d9452f237f843c1321abb5810d2f9ee6cbeae43c
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic uchar_t int_syscall_instr[] = { 0xCD, T_SYSCALLINT };
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortePpltdest(struct ps_prochandle *P, uintptr_t pltaddr)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pltaddr - fp->file_plt_base >= fp->file_plt_size) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte i = (pltaddr - fp->file_plt_base) / M_PLT_ENTSIZE - M_PLT_XNumber;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (Pread(P, &r, sizeof (r), r_addr) == sizeof (r) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (i = ELF64_R_SYM(r.r_info)) < fp->file_dynsym.sym_symn) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Elf64_Sym *symp = &(((Elf64_Sym *)data->d_buf)[i]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (fp->file_dynsym.sym_strs + symp->st_name);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (Pread(P, &r, sizeof (r), r_addr) == sizeof (r) &&
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (i = ELF32_R_SYM(r.r_info)) < fp->file_dynsym.sym_symn) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Elf32_Sym *symp = &(((Elf32_Sym *)data->d_buf)[i]);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (fp->file_dynsym.sym_strs + symp->st_name);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortePissyscall(struct ps_prochandle *P, uintptr_t addr)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (Pread(P, instr, sizeof (syscall_instr), addr) !=
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte memcmp(instr, syscall_instr, sizeof (syscall_instr)) != 0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (Pread(P, instr, sizeof (int_syscall_instr), addr) !=
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (memcmp(instr, int_syscall_instr, sizeof (int_syscall_instr)) == 0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn FortePissyscall_prev(struct ps_prochandle *P, uintptr_t addr, uintptr_t *dst)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (Pissyscall(P, addr - sizeof (syscall_instr))) {
if (dst)
return (ret);
static ulong_t
return (max);
return (max);
switch (instr[0]) {
return (max);
int nfp = 0;
} frame;
int rv;
* signal frame. Refer to the comments in Pstack.c for more info
int signo;
} sf_t;
if (fp != 0 &&
argc = 0;
for (i = 0; i < argc; i++)
if (prevfp)
return (rv);
} frame;
int nfp = 0;
int rv = 0;
int argc;
* signal frame. Refer to the comments in Pstack.c for more info
} sigframe_t;
if (fp != 0 &&
sizeof (frame)) {
argc = 0;
argc = 0;
argc = 0;
== sizeof (uc)) {
if (prevfp)
return (rv);
return (sp);
if (pusharg > 0 &&