GDB (xrefs)
Classes | Defines | Functions | Variables
/home/stan/gdb/src/gdb/coff-pe-read.c File Reference
#include "defs.h"
#include "coff-pe-read.h"
#include "bfd.h"
#include "gdbtypes.h"
#include "command.h"
#include "gdbcmd.h"
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
#include "common/common-utils.h"
#include "coff/internal.h"
#include <ctype.h>

Go to the source code of this file.

Classes

struct  read_pe_section_data
struct  pe_sections_info

Defines

#define IMAGE_SCN_CNT_CODE   0x20
#define IMAGE_SCN_CNT_INITIALIZED_DATA   0x40
#define IMAGE_SCN_CNT_UNINITIALIZED_DATA   0x80
#define PE_SECTION_INDEX_TEXT   0
#define PE_SECTION_INDEX_DATA   1
#define PE_SECTION_INDEX_BSS   2
#define PE_SECTION_TABLE_SIZE   3
#define PE_SECTION_INDEX_INVALID   -1
#define DEFAULT_COFF_PE_TEXT_SECTION_OFFSET   0x1000

Functions

static int read_pe_section_index (const char *section_name)
static int get_pe_section_index (const char *section_name, struct read_pe_section_data *sections, int nb_sections)
static void get_section_vmas (bfd *abfd, asection *sectp, void *context)
static void add_pe_exported_sym (const char *sym_name, unsigned long func_rva, int ordinal, const struct read_pe_section_data *section_data, const char *dll_name, struct objfile *objfile)
static int add_pe_forwarded_sym (const char *sym_name, const char *forward_dll_name, const char *forward_func_name, int ordinal, const char *dll_name, struct objfile *objfile)
static void read_pe_truncate_name (char *dll_name)
static unsigned int pe_get16 (bfd *abfd, int where)
static unsigned int pe_get32 (bfd *abfd, int where)
static unsigned int pe_as16 (void *ptr)
static unsigned int pe_as32 (void *ptr)
void read_pe_exported_syms (struct objfile *objfile)
CORE_ADDR pe_text_section_offset (struct bfd *abfd)
static void show_debug_coff_pe_read (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void _initialize_coff_pe_read (void)

Variables

static unsigned int debug_coff_pe_read

Define Documentation

Definition at line 624 of file coff-pe-read.c.

Referenced by pe_text_section_offset().

#define IMAGE_SCN_CNT_CODE   0x20

Definition at line 59 of file coff-pe-read.c.

Referenced by read_pe_exported_syms().

#define IMAGE_SCN_CNT_INITIALIZED_DATA   0x40

Definition at line 60 of file coff-pe-read.c.

Referenced by read_pe_exported_syms().

Definition at line 61 of file coff-pe-read.c.

Referenced by read_pe_exported_syms().

#define PE_SECTION_INDEX_BSS   2

Definition at line 64 of file coff-pe-read.c.

Referenced by read_pe_exported_syms(), and read_pe_section_index().

#define PE_SECTION_INDEX_DATA   1

Definition at line 63 of file coff-pe-read.c.

Referenced by read_pe_exported_syms(), and read_pe_section_index().

#define PE_SECTION_INDEX_INVALID   -1
#define PE_SECTION_INDEX_TEXT   0

Definition at line 62 of file coff-pe-read.c.

Referenced by read_pe_exported_syms(), and read_pe_section_index().

#define PE_SECTION_TABLE_SIZE   3

Definition at line 65 of file coff-pe-read.c.

Referenced by read_pe_exported_syms().


Function Documentation

void _initialize_coff_pe_read ( void  )
static void add_pe_exported_sym ( const char *  sym_name,
unsigned long  func_rva,
int  ordinal,
const struct read_pe_section_data section_data,
const char *  dll_name,
struct objfile objfile 
) [static]
static int add_pe_forwarded_sym ( const char *  sym_name,
const char *  forward_dll_name,
const char *  forward_func_name,
int  ordinal,
const char *  dll_name,
struct objfile objfile 
) [static]
static int get_pe_section_index ( const char *  section_name,
struct read_pe_section_data sections,
int  nb_sections 
) [static]

Definition at line 101 of file coff-pe-read.c.

References PE_SECTION_INDEX_INVALID.

Referenced by get_section_vmas().

static void get_section_vmas ( bfd *  abfd,
asection *  sectp,
void *  context 
) [static]
static unsigned int pe_as16 ( void *  ptr) [static]

Definition at line 300 of file coff-pe-read.c.

Referenced by read_pe_exported_syms().

static unsigned int pe_as32 ( void *  ptr) [static]

Definition at line 308 of file coff-pe-read.c.

Referenced by read_pe_exported_syms().

static unsigned int pe_get16 ( bfd *  abfd,
int  where 
) [static]

Definition at line 280 of file coff-pe-read.c.

Referenced by pe_text_section_offset(), and read_pe_exported_syms().

static unsigned int pe_get32 ( bfd *  abfd,
int  where 
) [static]

Definition at line 290 of file coff-pe-read.c.

Referenced by pe_text_section_offset(), and read_pe_exported_syms().

CORE_ADDR pe_text_section_offset ( struct bfd *  abfd)

Definition at line 627 of file coff-pe-read.c.

References DEFAULT_COFF_PE_TEXT_SECTION_OFFSET, pe_get16(), and pe_get32().

Referenced by windows_xfer_shared_library().

void read_pe_exported_syms ( struct objfile objfile)
static int read_pe_section_index ( const char *  section_name) [static]
static void read_pe_truncate_name ( char *  dll_name) [static]

Definition at line 270 of file coff-pe-read.c.

References strrchr().

Referenced by read_pe_exported_syms().

static void show_debug_coff_pe_read ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
) [static]

Definition at line 682 of file coff-pe-read.c.

References _, and fprintf_filtered().


Variable Documentation

unsigned int debug_coff_pe_read [static]

Definition at line 47 of file coff-pe-read.c.

Referenced by add_pe_exported_sym(), add_pe_forwarded_sym(), and read_pe_exported_syms().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines