Files
sysprof/elfparser.h
Soren Sandmann a1bddd8d9f Pass map->bin_file to bin_symbol_get_name.
2006-08-21  Soren Sandmann <sandmann@redhat.com>

	* process.c (process_lookup_symbol): Pass map->bin_file to
	bin_symbol_get_name.

	* binfile.h (bin_symbol_get_name): Add BinFile parameter

	* elfparser.c (elf_demangle): Use options DMGL_PARAMS | DMGL_ANSI

	* TODO: Updates

	* binfile.c: Rewrite this file to use ElfParser instead of libbfd.

	* configure.ac: Drop dependencies on libbfd and libiberty.
2006-08-21 06:00:57 +00:00

31 lines
1.1 KiB
C

#include <glib.h>
typedef struct ElfSym ElfSym;
typedef struct ElfParser ElfParser;
ElfParser *elf_parser_new (const guchar *data,
gsize length);
ElfParser *elf_parser_new_from_file (const char *filename,
GError **err);
void elf_parser_free (ElfParser *parser);
const char *elf_parser_get_debug_link (ElfParser *parser, guint32 *crc32);
/* Lookup a symbol in the file.
*
* The symbol returned is const, so don't free it it or anything. It
* will be valid until elf_parser_free() is called on the parser.
*
*
* The address should be given in "file coordinates". This means that
* if the file is mapped at address m and offset o, then an address a
* should be looked up as "a - (m - o)". (m - o) is where the start
* of the file would have been mapped, so a - (m - o) is the position
* in the file of a.
*/
const ElfSym *elf_parser_lookup_symbol (ElfParser *parser,
gulong address);
guint32 elf_parser_get_crc32 (ElfParser *parser);
const char *elf_sym_get_name (const ElfSym *sym);
gulong elf_sym_get_address (const ElfSym *sym);
char *elf_demangle (const char *name);