T-EMU  2
The Terma Emulator
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Typedefs | Functions
Loader.h File Reference
#include <stdint.h>
Include dependency graph for Loader.h:

Go to the source code of this file.

Typedefs

typedef void temu_DebugInfoCtxt
 

Functions

int temu_loadImage (void *mem, const char *file)
 Loads a binary image to the memory object. More...
 
int temu_loadRelocatedImage (void *mem, const char *file, uint64_t pa) __attribute__((deprecated))
 
int temu_loadBinaryImage (void *mem, const char *file, uint64_t pa)
 Loads a raw binary image to the memory object at the given address. More...
 
int temu_loadElfImage (void *mem, const char *file, uint64_t pa)
 Loads an ELF file without going through filetype detection. More...
 
int temu_loadDebugInfo (const char *File, temu_DebugInfoCtxt **DICtxt)
 Loads a debug info context from the given file. More...
 
void temu_disposeDebugInfo (temu_DebugInfoCtxt *DICtxt)
 Delete loaded debug info. More...
 
int temu_loadSrecImage (void *mem, const char *file, uint64_t pa)
 Loads an SREC file without going through filetype detection. More...
 

Typedef Documentation

typedef void temu_DebugInfoCtxt

Definition at line 47 of file Loader.h.

Function Documentation

void temu_disposeDebugInfo ( temu_DebugInfoCtxt DICtxt)

Delete loaded debug info.

int temu_loadBinaryImage ( void *  mem,
const char *  file,
uint64_t  pa 
)

Loads a raw binary image to the memory object at the given address.

The function will assume that the file is a raw binary. This way you can load an ELF file as is to memory (e.g. where it is expected by the boot loader).

Parameters
memMemory object, must conform to the mem interface.
filePath to file to load.
paPhysical address where to load the image.
Returns
0 on success, other values indicates errors.
int temu_loadDebugInfo ( const char *  File,
temu_DebugInfoCtxt **  DICtxt 
)

Loads a debug info context from the given file.

This function is EXPERIMENTAL! It is aimed at providing a way to load debug info data, e.g. DWARF or STABS from an elf file, or simply read a symbol file. Currently, the function is able to parse DWARF4 info in an elf-file.

Parameters
filePath to file to load.
DICtxtIf non-null, a DebugInfoCtxt object will be returned in the provided pointer.
Returns
0 on success, other values indicates errors.
int temu_loadElfImage ( void *  mem,
const char *  file,
uint64_t  pa 
)

Loads an ELF file without going through filetype detection.

Parameters
memMemory object, must conform to the mem interface.
filePath to file to load.
paUnused argument
Returns
0 on success, other values indicates errors
int temu_loadImage ( void *  mem,
const char *  file 
)

Loads a binary image to the memory object.

The function will autodetect the file type (based on extensions and magic headers in the file).

Binary images will be placed at address 0.

The image can be one of the supported file formats.

Parameters
memMemory object, must conform to the mem interface.
filePath to file to load.
Returns
0 on success, other values indicates errors.
int temu_loadRelocatedImage ( void *  mem,
const char *  file,
uint64_t  pa 
)
int temu_loadSrecImage ( void *  mem,
const char *  file,
uint64_t  pa 
)

Loads an SREC file without going through filetype detection.

Parameters
memMemory object, must conform to the mem interface.
filePath to file to load.
paUnused argument
Returns
0 on success, other values indicates errors