This is dis.h in view mode; [Download] [Up]
/* * $Id: dis.h,v 1.10 94/08/24 22:42:17 ediger Exp Locker: ediger $ */ #ifndef _DIS_H #define _DIS_H #include <sys/types.h> #include <stdlib.h> #include <libc.h> #include <mach-o/nlist.h> #include <mach-o/stab.h> #include <mach-o/ldsyms.h> #include <mach-o/reloc.h> #include <mach-o/loader.h> #include <mach/thread_status.h> #include <mach/m68k/thread_status.h> #include <mach/i386/thread_status.h> #include <mach/mach_error.h> #include <assert.h> #include <string.h> #include <pcc.h> #include <ansi.h> typedef char flag; #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif /* There are many different types of symbols. What type each is is defined by the type byte. When the linker links, all symbols with section not zero get their value updated to the relocation of that section. If NO_SECT appears after a type, then that type's value is not to be relocated (it is something other than an address). This is done by forcing the section number to be zero. The N_EXT bit is set, then that symbol is external, and cannot be duplicated, and an undefined in another file can find it. All types >=0x20 are debugger symbols, the linker just relocates them and preserves them. Gnu C does not seem to fill in the fields, it stores the type information in the name, and leaves the line numbers zero except for the SLINE types. */ #define NO_SECT 0 /* #define N_EXT 0 */ #define DISASM 0xFE /* a symbol used internally, name is how to disassemble it */ /* Values for the desc field, when the symbol is an actual label. These values are from pcc.h, except I shortened them by deleting a PCCT_ prefix, and I made perhaps incorrect assumptions about what some of them mean. Hopefully other programs will share these values. GCC always puts zero in the desc, so this must be the "unknown" type. */ #define UNKNOWN PCC_UNDEF /* unknown, prints as short data */ #define CODE PCCT_FARG /* PCCT_FARG, I use this to point to code */ #define CHAR PCCT_CHAR /* byte values, use STRTY to get ascii codes */ #define SHORT PCCT_SHORT #define INT PCCT_INT #define LONG PCCT_LONG #define FLOAT PCCT_FLOAT #define DOUBLE PCCT_DOUBLE #define STRTY PCCT_STRTY /* .ascii, make into 0-terminated quoted strings */ #define FLOAT12 9 /* internal representation for 12byte fp data */ #define UNIONTY PCCT_UNIONTY /* points at a structure or union, nyi */ #define ENUMTY PCCT_ENUMTY /* enumeration */ #define MOETY PCCT_MOETY /* member of enum (?) */ #define UCHAR PCCT_UCHAR #define USHORT PCCT_USHORT #define UNSIGNED PCCT_UNSIGNED #define ULONG PCCT_ULONG #define PTR PCCTM_PTR /* pointer to x, indicates labels */ #define FTN PCCTM_FTN /* function returning x (indicates code) */ #define ARY PCCTM_ARY /* array of x */ /*======================= dis fwd declarations ==========================*/ void pushsymbol(void); void popsymbol(void); struct nlist *currentsymbol(void); struct nlist *firstsymbol(unsigned address); struct nlist *findlabel(unsigned address); struct nlist *nextsymbol(void); struct nlist *prevsymbol(void); void addsymbol(struct nlist *new); struct nlist *createlabel(unsigned address, unsigned sn, unsigned type, char *name); unsigned int thread_prog_counter(struct segment_command *); void check_header(struct mach_header *); void disasmmappedfile(char *mappedaddress); void sortreltables(char *); int set_sections(struct segment_command *); void disasmsymbols(unsigned start, unsigned end, int rest); void disasmblock(struct segment_command *, struct section *, int , char *); void startline(long unsigned address); void startlinenoaddress(void); void endline(void); void fprint(const char *fmt, ...); int printsymbol(struct nlist *); void sprint(char *); void cprint(int c); void load_symbol_table(char *, struct symtab_command *, int); struct nlist *getlabel(unsigned long *address, void *pc, int pcrel); struct nlist *settype(struct nlist * s, int type, char *name); void printlabelcomment(struct nlist * n); #endif /* _DIS_H */
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.