/* This file is part of odin, a memory profiler with fragmentation analysis. Copyright (C) 2007 Chris Wilson Based on: MemProf -- memory profiler and leak detector Copyright 1999, 2000, 2001, Red Hat, Inc. Copyright 2002, Kristian Rietveld Sysprof -- Sampling, systemwide CPU profiler Copyright 2006, 2007, Soeren Sandmann odin is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. odin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with odin. If not, see / The GNU General Public License is contained in the file COPYING. */ #ifndef ELFPARSER_H #define ELFPARSER_H #include G_BEGIN_DECLS typedef struct _elf_sym ElfSym; typedef struct _elf_parser ElfParser; ElfParser * elf_parser_new_from_data (const guchar *data, gsize length); ElfParser * elf_parser_new (const char *filename, GError **err); void elf_parser_free (ElfParser *parser); const char * elf_parser_get_debug_link (ElfParser *parser, guint32 *crc32); guint32 elf_parser_get_crc32 (ElfParser *parser); const guchar *elf_parser_get_eh_frame (ElfParser *parser); gulong elf_parser_get_text_offset (ElfParser *parser); /* 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. */ gboolean elf_parser_lookup_symbol (ElfParser *parser, gulong address, const char **function, const char **file, const char **directory, guint *lineno); G_END_DECLS #endif /* ELFPARSER_H */