1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #pragma ident "%Z%%M% %I% %E% SMI" 28 29 #ifndef WHO_DOT_H 30 #define WHO_DOT_H 31 32 #include <link.h> 33 #include <sys/regset.h> 34 #include <sys/frame.h> 35 #include <sys/elf.h> 36 37 #if defined(__sparcv9) 38 #define Elf_Ehdr Elf64_Ehdr 39 #define Elf_Phdr Elf64_Phdr 40 #define Elf_Shdr Elf64_Shdr 41 #define Elf_Sym Elf64_Sym 42 #define elf_getshdr elf64_getshdr 43 #else 44 #define Elf_Ehdr Elf32_Ehdr 45 #define Elf_Phdr Elf32_Phdr 46 #define Elf_Shdr Elf32_Shdr 47 #define Elf_Sym Elf32_Sym 48 #define elf_getshdr elf32_getshdr 49 #endif 50 51 52 typedef struct objinfo { 53 caddr_t o_lpc; /* low PC */ 54 caddr_t o_hpc; /* high PC */ 55 int o_fd; /* file descriptor */ 56 Elf * o_elf; /* Elf pointer */ 57 Elf_Sym * o_syms; /* symbol table */ 58 uint_t o_symcnt; /* # of symbols */ 59 const char * o_strs; /* symbol string table */ 60 Link_map * o_lmp; 61 uint_t o_flags; 62 struct objinfo * o_next; 63 } Objinfo; 64 65 #define FLG_OB_NOSYMS 0x0001 /* no symbols available for obj */ 66 #define FLG_OB_FIXED 0x0002 /* fixed address object */ 67 68 69 #if defined(__sparc) || defined(__sparcv9) 70 #define FLUSHWIN() asm("ta 3"); 71 #define FRAME_PTR_INDEX 1 72 #define SKIP_FRAMES 0 73 #endif 74 75 #if defined(__i386) || defined(__amd64) /* XX64 -- fix me? */ 76 #define FLUSHWIN() 77 #define FRAME_PTR_INDEX 3 78 #define SKIP_FRAMES 1 79 #endif 80 81 #ifndef STACK_BIAS 82 #define STACK_BIAS 0 83 #endif 84 85 #endif /* WHO_DOT_H */ 86