- Add "log2lines" tool by Jan Roeloffzen. Bug #4342.

- Fix indentation in rsym.h.

svn path=/trunk/; revision=40652
This commit is contained in:
Dmitry Gorbachev 2009-04-22 16:50:44 +00:00
parent d3936f5816
commit 540dda3633
4 changed files with 1330 additions and 257 deletions

1034
reactos/tools/log2lines.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,41 @@
LOG2LINES_BASE = $(TOOLS_BASE)
LOG2LINES_BASE_ = $(LOG2LINES_BASE)$(SEP)
LOG2LINES_INT = $(INTERMEDIATE_)$(LOG2LINES_BASE)
LOG2LINES_INT_ = $(LOG2LINES_INT)$(SEP)
LOG2LINES_OUT = $(OUTPUT_)$(LOG2LINES_BASE)
LOG2LINES_OUT_ = $(LOG2LINES_OUT)$(SEP)
LOG2LINES_TARGET = \
$(LOG2LINES_OUT_)log2lines$(EXEPOSTFIX)
LOG2LINES_SOURCES = \
$(LOG2LINES_BASE_)log2lines.c \
$(LOG2LINES_BASE_)rsym_common.c
LOG2LINES_OBJECTS = \
$(addprefix $(INTERMEDIATE_), $(LOG2LINES_SOURCES:.c=.o))
LOG2LINES_HOST_CFLAGS = $(TOOLS_CFLAGS)
LOG2LINES_HOST_LFLAGS = $(TOOLS_LFLAGS)
.PHONY: log2lines
log2lines: $(LOG2LINES_TARGET)
$(LOG2LINES_TARGET): $(LOG2LINES_OBJECTS) | $(LOG2LINES_OUT)
$(ECHO_HOSTLD)
${host_gcc} $(LOG2LINES_OBJECTS) $(LOG2LINES_HOST_LFLAGS) -o $@
$(LOG2LINES_INT_)log2lines.o: $(LOG2LINES_BASE_)log2lines.c | $(LOG2LINES_INT)
$(ECHO_HOSTCC)
${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@
#$(LOG2LINES_INT_)rsym_common.o: $(LOG2LINES_BASE_)rsym_common.c | $(LOG2LINES_INT)
# $(ECHO_HOSTCC)
# ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@
.PHONY: log2lines_clean
log2lines_clean:
-@$(rm) $(LOG2LINES_TARGET) $(LOG2LINES_OBJECTS) 2>$(NUL)
clean: log2lines_clean

View file

@ -4,19 +4,21 @@
#define RSYM_H #define RSYM_H
#define IMAGE_DOS_MAGIC 0x5a4d #define IMAGE_DOS_MAGIC 0x5a4d
#define IMAGE_PE_MAGIC 0x00004550 #define IMAGE_PE_MAGIC 0x00004550
#define IMAGE_SIZEOF_SHORT_NAME 8 #define IMAGE_SIZEOF_SHORT_NAME 8
#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 #define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004
#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 #define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008
#define IMAGE_FILE_DEBUG_STRIPPED 0x0200 #define IMAGE_FILE_DEBUG_STRIPPED 0x0200
#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 #define IMAGE_DIRECTORY_ENTRY_BASERELOC 5
#define IMAGE_SCN_TYPE_NOLOAD 0x00000002 #define IMAGE_SCN_TYPE_NOLOAD 0x00000002
#define IMAGE_SCN_LNK_REMOVE 0x00000800 #define IMAGE_SCN_LNK_REMOVE 0x00000800
#define IMAGE_SCN_MEM_READ 0x40000000 #define IMAGE_SCN_MEM_READ 0x40000000
#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 #define IMAGE_SCN_MEM_DISCARDABLE 0x02000000
#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
@ -38,121 +40,119 @@ typedef unsigned long DWORD;
typedef unsigned __int64 ULONG_PTR; typedef unsigned __int64 ULONG_PTR;
#else #else
#if defined(__x86_64__) && defined(unix) #if defined(__x86_64__) && defined(unix)
typedef unsigned int ULONG_PTR; typedef unsigned int ULONG_PTR;
#else #else
typedef unsigned long ULONG_PTR; typedef unsigned long ULONG_PTR;
#endif #endif
#endif #endif
#pragma pack(push,2) #pragma pack(push,2)
typedef struct _IMAGE_DOS_HEADER { typedef struct _IMAGE_DOS_HEADER {
WORD e_magic; WORD e_magic;
WORD e_cblp; WORD e_cblp;
WORD e_cp; WORD e_cp;
WORD e_crlc; WORD e_crlc;
WORD e_cparhdr; WORD e_cparhdr;
WORD e_minalloc; WORD e_minalloc;
WORD e_maxalloc; WORD e_maxalloc;
WORD e_ss; WORD e_ss;
WORD e_sp; WORD e_sp;
WORD e_csum; WORD e_csum;
WORD e_ip; WORD e_ip;
WORD e_cs; WORD e_cs;
WORD e_lfarlc; WORD e_lfarlc;
WORD e_ovno; WORD e_ovno;
WORD e_res[4]; WORD e_res[4];
WORD e_oemid; WORD e_oemid;
WORD e_oeminfo; WORD e_oeminfo;
WORD e_res2[10]; WORD e_res2[10];
LONG e_lfanew; LONG e_lfanew;
} IMAGE_DOS_HEADER,*PIMAGE_DOS_HEADER; } IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER;
#pragma pack(pop) #pragma pack(pop)
#pragma pack(push,4) #pragma pack(push,4)
typedef struct _IMAGE_FILE_HEADER { typedef struct _IMAGE_FILE_HEADER {
WORD Machine; WORD Machine;
WORD NumberOfSections; WORD NumberOfSections;
DWORD TimeDateStamp; DWORD TimeDateStamp;
DWORD PointerToSymbolTable; DWORD PointerToSymbolTable;
DWORD NumberOfSymbols; DWORD NumberOfSymbols;
WORD SizeOfOptionalHeader; WORD SizeOfOptionalHeader;
WORD Characteristics; WORD Characteristics;
} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; } IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
#pragma pack(pop) #pragma pack(pop)
typedef struct _IMAGE_DATA_DIRECTORY { typedef struct _IMAGE_DATA_DIRECTORY {
DWORD VirtualAddress; DWORD VirtualAddress;
DWORD Size; DWORD Size;
} IMAGE_DATA_DIRECTORY,*PIMAGE_DATA_DIRECTORY; } IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;
typedef struct _IMAGE_OPTIONAL_HEADER32 { typedef struct _IMAGE_OPTIONAL_HEADER32 {
WORD Magic; WORD Magic;
BYTE MajorLinkerVersion; BYTE MajorLinkerVersion;
BYTE MinorLinkerVersion; BYTE MinorLinkerVersion;
DWORD SizeOfCode; DWORD SizeOfCode;
DWORD SizeOfInitializedData; DWORD SizeOfInitializedData;
DWORD SizeOfUninitializedData; DWORD SizeOfUninitializedData;
DWORD AddressOfEntryPoint; DWORD AddressOfEntryPoint;
DWORD BaseOfCode; DWORD BaseOfCode;
DWORD BaseOfData; DWORD BaseOfData;
DWORD ImageBase; DWORD ImageBase;
DWORD SectionAlignment; DWORD SectionAlignment;
DWORD FileAlignment; DWORD FileAlignment;
WORD MajorOperatingSystemVersion; WORD MajorOperatingSystemVersion;
WORD MinorOperatingSystemVersion; WORD MinorOperatingSystemVersion;
WORD MajorImageVersion; WORD MajorImageVersion;
WORD MinorImageVersion; WORD MinorImageVersion;
WORD MajorSubsystemVersion; WORD MajorSubsystemVersion;
WORD MinorSubsystemVersion; WORD MinorSubsystemVersion;
DWORD Win32VersionValue; DWORD Win32VersionValue;
DWORD SizeOfImage; DWORD SizeOfImage;
DWORD SizeOfHeaders; DWORD SizeOfHeaders;
DWORD CheckSum; DWORD CheckSum;
WORD Subsystem; WORD Subsystem;
WORD DllCharacteristics; WORD DllCharacteristics;
DWORD SizeOfStackReserve; DWORD SizeOfStackReserve;
DWORD SizeOfStackCommit; DWORD SizeOfStackCommit;
DWORD SizeOfHeapReserve; DWORD SizeOfHeapReserve;
DWORD SizeOfHeapCommit; DWORD SizeOfHeapCommit;
DWORD LoaderFlags; DWORD LoaderFlags;
DWORD NumberOfRvaAndSizes; DWORD NumberOfRvaAndSizes;
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
} IMAGE_OPTIONAL_HEADER32,*PIMAGE_OPTIONAL_HEADER32; } IMAGE_OPTIONAL_HEADER32, *PIMAGE_OPTIONAL_HEADER32;
typedef struct _IMAGE_OPTIONAL_HEADER64 { typedef struct _IMAGE_OPTIONAL_HEADER64 {
WORD Magic; WORD Magic;
BYTE MajorLinkerVersion; BYTE MajorLinkerVersion;
BYTE MinorLinkerVersion; BYTE MinorLinkerVersion;
DWORD SizeOfCode; DWORD SizeOfCode;
DWORD SizeOfInitializedData; DWORD SizeOfInitializedData;
DWORD SizeOfUninitializedData; DWORD SizeOfUninitializedData;
DWORD AddressOfEntryPoint; DWORD AddressOfEntryPoint;
DWORD BaseOfCode; DWORD BaseOfCode;
ULONGLONG ImageBase; ULONGLONG ImageBase;
DWORD SectionAlignment; DWORD SectionAlignment;
DWORD FileAlignment; DWORD FileAlignment;
WORD MajorOperatingSystemVersion; WORD MajorOperatingSystemVersion;
WORD MinorOperatingSystemVersion; WORD MinorOperatingSystemVersion;
WORD MajorImageVersion; WORD MajorImageVersion;
WORD MinorImageVersion; WORD MinorImageVersion;
WORD MajorSubsystemVersion; WORD MajorSubsystemVersion;
WORD MinorSubsystemVersion; WORD MinorSubsystemVersion;
DWORD Win32VersionValue; DWORD Win32VersionValue;
DWORD SizeOfImage; DWORD SizeOfImage;
DWORD SizeOfHeaders; DWORD SizeOfHeaders;
DWORD CheckSum; DWORD CheckSum;
WORD Subsystem; WORD Subsystem;
WORD DllCharacteristics; WORD DllCharacteristics;
ULONGLONG SizeOfStackReserve; ULONGLONG SizeOfStackReserve;
ULONGLONG SizeOfStackCommit; ULONGLONG SizeOfStackCommit;
ULONGLONG SizeOfHeapReserve; ULONGLONG SizeOfHeapReserve;
ULONGLONG SizeOfHeapCommit; ULONGLONG SizeOfHeapCommit;
DWORD LoaderFlags; DWORD LoaderFlags;
DWORD NumberOfRvaAndSizes; DWORD NumberOfRvaAndSizes;
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
} IMAGE_OPTIONAL_HEADER64,*PIMAGE_OPTIONAL_HEADER64; } IMAGE_OPTIONAL_HEADER64, *PIMAGE_OPTIONAL_HEADER64;
#ifdef _TARGET_PE64 #ifdef _TARGET_PE64
typedef IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER; typedef IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER;
@ -163,195 +163,192 @@ typedef PIMAGE_OPTIONAL_HEADER32 PIMAGE_OPTIONAL_HEADER;
#endif #endif
typedef struct _IMAGE_SECTION_HEADER { typedef struct _IMAGE_SECTION_HEADER {
BYTE Name[IMAGE_SIZEOF_SHORT_NAME]; BYTE Name[IMAGE_SIZEOF_SHORT_NAME];
union { union {
DWORD PhysicalAddress; DWORD PhysicalAddress;
DWORD VirtualSize; DWORD VirtualSize;
} Misc; } Misc;
DWORD VirtualAddress; DWORD VirtualAddress;
DWORD SizeOfRawData; DWORD SizeOfRawData;
DWORD PointerToRawData; DWORD PointerToRawData;
DWORD PointerToRelocations; DWORD PointerToRelocations;
DWORD PointerToLinenumbers; DWORD PointerToLinenumbers;
WORD NumberOfRelocations; WORD NumberOfRelocations;
WORD NumberOfLinenumbers; WORD NumberOfLinenumbers;
DWORD Characteristics; DWORD Characteristics;
} IMAGE_SECTION_HEADER,*PIMAGE_SECTION_HEADER; } IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;
#pragma pack(push,4) #pragma pack(push,4)
typedef struct _IMAGE_BASE_RELOCATION { typedef struct _IMAGE_BASE_RELOCATION {
DWORD VirtualAddress; DWORD VirtualAddress;
DWORD SizeOfBlock; DWORD SizeOfBlock;
WORD TypeOffset[1]; WORD TypeOffset[1];
} IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION; } IMAGE_BASE_RELOCATION, *PIMAGE_BASE_RELOCATION;
#pragma pack(pop) #pragma pack(pop)
typedef struct { typedef struct {
USHORT f_magic; /* magic number */ USHORT f_magic; /* magic number */
USHORT f_nscns; /* number of sections */ USHORT f_nscns; /* number of sections */
ULONG f_timdat; /* time & date stamp */ ULONG f_timdat; /* time & date stamp */
ULONG f_symptr; /* file pointer to symtab */ ULONG f_symptr; /* file pointer to symtab */
ULONG f_nsyms; /* number of symtab entries */ ULONG f_nsyms; /* number of symtab entries */
USHORT f_opthdr; /* sizeof(optional hdr) */ USHORT f_opthdr; /* sizeof(optional hdr) */
USHORT f_flags; /* flags */ USHORT f_flags; /* flags */
} FILHDR; } FILHDR;
typedef struct { typedef struct {
char s_name[8]; /* section name */ char s_name[8]; /* section name */
ULONG s_paddr; /* physical address, aliased s_nlib */ ULONG s_paddr; /* physical address, aliased s_nlib */
ULONG s_vaddr; /* virtual address */ ULONG s_vaddr; /* virtual address */
ULONG s_size; /* section size */ ULONG s_size; /* section size */
ULONG s_scnptr; /* file ptr to raw data for section */ ULONG s_scnptr; /* file ptr to raw data for section */
ULONG s_relptr; /* file ptr to relocation */ ULONG s_relptr; /* file ptr to relocation */
ULONG s_lnnoptr; /* file ptr to line numbers */ ULONG s_lnnoptr; /* file ptr to line numbers */
USHORT s_nreloc; /* number of relocation entries */ USHORT s_nreloc; /* number of relocation entries */
USHORT s_nlnno; /* number of line number entries */ USHORT s_nlnno; /* number of line number entries */
ULONG s_flags; /* flags */ ULONG s_flags; /* flags */
} SCNHDR; } SCNHDR;
#pragma pack(4) #pragma pack(4)
typedef struct _SYMBOLFILE_HEADER { typedef struct _SYMBOLFILE_HEADER {
ULONG SymbolsOffset; ULONG SymbolsOffset;
ULONG SymbolsLength; ULONG SymbolsLength;
ULONG StringsOffset; ULONG StringsOffset;
ULONG StringsLength; ULONG StringsLength;
} SYMBOLFILE_HEADER, *PSYMBOLFILE_HEADER; } SYMBOLFILE_HEADER, *PSYMBOLFILE_HEADER;
typedef struct _STAB_ENTRY { typedef struct _STAB_ENTRY {
ULONG n_strx; /* index into string table of name */ ULONG n_strx; /* index into string table of name */
UCHAR n_type; /* type of symbol */ UCHAR n_type; /* type of symbol */
UCHAR n_other; /* misc info (usually empty) */ UCHAR n_other; /* misc info (usually empty) */
USHORT n_desc; /* description field */ USHORT n_desc; /* description field */
ULONG n_value; /* value of symbol */ ULONG n_value; /* value of symbol */
} STAB_ENTRY, *PSTAB_ENTRY; } STAB_ENTRY, *PSTAB_ENTRY;
/* http://www.math.utah.edu/docs/info/stabs_12.html */ /* http://www.math.utah.edu/docs/info/stabs_12.html */
#define N_GYSM 0x20
#define N_FNAME 0x22 #define N_GYSM 0x20
#define N_FUN 0x24 #define N_FNAME 0x22
#define N_STSYM 0x26 #define N_FUN 0x24
#define N_LCSYM 0x28 #define N_STSYM 0x26
#define N_MAIN 0x2A #define N_LCSYM 0x28
#define N_PC 0x30 #define N_MAIN 0x2A
#define N_NSYMS 0x32 #define N_PC 0x30
#define N_NOMAP 0x34 #define N_NSYMS 0x32
#define N_RSYM 0x40 #define N_NOMAP 0x34
#define N_M2C 0x42 #define N_RSYM 0x40
#define N_SLINE 0x44 #define N_M2C 0x42
#define N_DSLINE 0x46 #define N_SLINE 0x44
#define N_BSLINE 0x48 #define N_DSLINE 0x46
#define N_BROWS 0x48 #define N_BSLINE 0x48
#define N_DEFD 0x4A #define N_BROWS 0x48
#define N_EHDECL 0x50 #define N_DEFD 0x4A
#define N_MOD2 0x50 #define N_EHDECL 0x50
#define N_CATCH 0x54 #define N_MOD2 0x50
#define N_SSYM 0x60 #define N_CATCH 0x54
#define N_SO 0x64 #define N_SSYM 0x60
#define N_LSYM 0x80 #define N_SO 0x64
#define N_BINCL 0x82 #define N_LSYM 0x80
#define N_SOL 0x84 #define N_BINCL 0x82
#define N_PSYM 0xA0 #define N_SOL 0x84
#define N_EINCL 0xA2 #define N_PSYM 0xA0
#define N_ENTRY 0xA4 #define N_EINCL 0xA2
#define N_LBRAC 0xC0 #define N_ENTRY 0xA4
#define N_EXCL 0xC2 #define N_LBRAC 0xC0
#define N_SCOPE 0xC4 #define N_EXCL 0xC2
#define N_RBRAC 0xE0 #define N_SCOPE 0xC4
#define N_BCOMM 0xE2 #define N_RBRAC 0xE0
#define N_ECOMM 0xE4 #define N_BCOMM 0xE2
#define N_ECOML 0xE8 #define N_ECOMM 0xE4
#define N_LENG 0xFE #define N_ECOML 0xE8
#define N_LENG 0xFE
/* COFF symbol table */ /* COFF symbol table */
#define E_SYMNMLEN 8 /* # characters in a symbol name */ #define E_SYMNMLEN 8 /* # characters in a symbol name */
#define E_FILNMLEN 14 /* # characters in a file name */ #define E_FILNMLEN 14 /* # characters in a file name */
#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */ #define E_DIMNUM 4 /* # array dimensions in auxiliary entry */
#define N_BTMASK (0xf) #define N_BTMASK (0xf)
#define N_TMASK (0x30) #define N_TMASK (0x30)
#define N_BTSHFT (4) #define N_BTSHFT (4)
#define N_TSHIFT (2) #define N_TSHIFT (2)
/* derived types, in e_type */ /* derived types, in e_type */
#define DT_NON (0) /* no derived type */
#define DT_PTR (1) /* pointer */
#define DT_FCN (2) /* function */
#define DT_ARY (3) /* array */
#define BTYPE(x) ((x) & N_BTMASK) #define DT_NON (0) /* no derived type */
#define DT_PTR (1) /* pointer */
#define DT_FCN (2) /* function */
#define DT_ARY (3) /* array */
#define ISPTR(x) (((x) & N_TMASK) == (DT_PTR << N_BTSHFT)) #define BTYPE(x) ((x) & N_BTMASK)
#define ISFCN(x) (((x) & N_TMASK) == (DT_FCN << N_BTSHFT))
#define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT))
#define ISTAG(x) ((x)==C_STRTAG||(x)==C_UNTAG||(x)==C_ENTAG)
#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
#define C_EFCN 0xff /* physical end of function */ #define ISPTR(x) (((x) & N_TMASK) == (DT_PTR << N_BTSHFT))
#define C_NULL 0 #define ISFCN(x) (((x) & N_TMASK) == (DT_FCN << N_BTSHFT))
#define C_AUTO 1 /* automatic variable */ #define ISARY(x) (((x) & N_TMASK) == (DT_ARY << N_BTSHFT))
#define C_EXT 2 /* external symbol */ #define ISTAG(x) ((x) == C_STRTAG || (x) == C_UNTAG || (x) == C_ENTAG)
#define C_STAT 3 /* static */ #define DECREF(x) ((((x) >> N_TSHIFT) & ~N_BTMASK) | ((x) & N_BTMASK))
#define C_REG 4 /* register variable */
#define C_EXTDEF 5 /* external definition */ #define C_EFCN 0xff /* physical end of function */
#define C_LABEL 6 /* label */ #define C_NULL 0
#define C_ULABEL 7 /* undefined label */ #define C_AUTO 1 /* automatic variable */
#define C_MOS 8 /* member of structure */ #define C_EXT 2 /* external symbol */
#define C_ARG 9 /* function argument */ #define C_STAT 3 /* static */
#define C_STRTAG 10 /* structure tag */ #define C_REG 4 /* register variable */
#define C_MOU 11 /* member of union */ #define C_EXTDEF 5 /* external definition */
#define C_UNTAG 12 /* union tag */ #define C_LABEL 6 /* label */
#define C_TPDEF 13 /* type definition */ #define C_ULABEL 7 /* undefined label */
#define C_USTATIC 14 /* undefined static */ #define C_MOS 8 /* member of structure */
#define C_ENTAG 15 /* enumeration tag */ #define C_ARG 9 /* function argument */
#define C_MOE 16 /* member of enumeration */ #define C_STRTAG 10 /* structure tag */
#define C_REGPARM 17 /* register parameter */ #define C_MOU 11 /* member of union */
#define C_FIELD 18 /* bit field */ #define C_UNTAG 12 /* union tag */
#define C_AUTOARG 19 /* auto argument */ #define C_TPDEF 13 /* type definition */
#define C_LASTENT 20 /* dummy entry (end of block) */ #define C_USTATIC 14 /* undefined static */
#define C_BLOCK 100 /* ".bb" or ".eb" */ #define C_ENTAG 15 /* enumeration tag */
#define C_FCN 101 /* ".bf" or ".ef" */ #define C_MOE 16 /* member of enumeration */
#define C_EOS 102 /* end of structure */ #define C_REGPARM 17 /* register parameter */
#define C_FILE 103 /* file name */ #define C_FIELD 18 /* bit field */
#define C_LINE 104 /* line # reformatted as symbol table entry */ #define C_AUTOARG 19 /* auto argument */
#define C_ALIAS 105 /* duplicate tag */ #define C_LASTENT 20 /* dummy entry (end of block) */
#define C_HIDDEN 106 /* ext symbol in dmert public lib */ #define C_BLOCK 100 /* ".bb" or ".eb" */
#define C_FCN 101 /* ".bf" or ".ef" */
#define C_EOS 102 /* end of structure */
#define C_FILE 103 /* file name */
#define C_LINE 104 /* line# reformatted as symbol table entry */
#define C_ALIAS 105 /* duplicate tag */
#define C_HIDDEN 106 /* ext symbol in dmert public lib */
#pragma pack(1) #pragma pack(1)
typedef struct _COFF_SYMENT typedef struct _COFF_SYMENT {
{ union {
union char e_name[E_SYMNMLEN];
{ struct {
char e_name[E_SYMNMLEN]; ULONG e_zeroes;
struct ULONG e_offset;
{ } e;
ULONG e_zeroes; } e;
ULONG e_offset; ULONG e_value;
} short e_scnum;
e; USHORT e_type;
} UCHAR e_sclass;
e; UCHAR e_numaux;
ULONG e_value;
short e_scnum;
USHORT e_type;
UCHAR e_sclass;
UCHAR e_numaux;
} COFF_SYMENT, *PCOFF_SYMENT; } COFF_SYMENT, *PCOFF_SYMENT;
#pragma pack(4) #pragma pack(4)
typedef struct _ROSSYM_ENTRY { typedef struct _ROSSYM_ENTRY {
ULONG_PTR Address; ULONG_PTR Address;
ULONG FunctionOffset; ULONG FunctionOffset;
ULONG FileOffset; ULONG FileOffset;
ULONG SourceLine; ULONG SourceLine;
} ROSSYM_ENTRY, *PROSSYM_ENTRY; } ROSSYM_ENTRY, *PROSSYM_ENTRY;
#define ROUND_UP(N, S) (((N) + (S) - 1) & ~((S) - 1)) #define ROUND_UP(N, S) (((N) + (S) - 1) & ~((S) - 1))
extern char* extern char *
convert_path(const char* origpath); convert_path(const char *origpath);
extern void* extern void *
load_file ( const char* file_name, size_t* file_size ); load_file(const char *file_name, size_t *file_size);
#endif/*RSYM_H*/ #endif /* RSYM_H */

View file

@ -43,10 +43,11 @@ $(TOOLS_INT_)xml.o: $(TOOLS_BASE_)xml.cpp $(XML_SSPRINTF_HEADERS) | $(TOOLS_INT)
include tools/bin2c.mak include tools/bin2c.mak
include tools/buildno/buildno.mak include tools/buildno/buildno.mak
include tools/gendib/gendib.mak include tools/gendib/gendib.mak
include tools/log2lines.mak
include tools/nci/nci.mak
ifeq ($(ARCH),powerpc) ifeq ($(ARCH),powerpc)
include tools/ofw_interface/ofw_interface.mak include tools/ofw_interface/ofw_interface.mak
endif endif
include tools/nci/nci.mak
include tools/pefixup.mak include tools/pefixup.mak
include tools/raddr2line.mak include tools/raddr2line.mak
include tools/rbuild/rbuild.mak include tools/rbuild/rbuild.mak