Update autogen.sh and comment out --enable-compile-warnings
[memprof.git] / elfparser.h
blob41bc678ca485d33649b3c84dab934d591b28d4b3
1 /* Sysprof -- Sampling, systemwide CPU profiler
2 * Copyright 2006, 2007, Soeren Sandmann
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 #include <glib.h>
20 typedef struct ElfSym ElfSym;
21 typedef struct ElfParser ElfParser;
23 ElfParser * elf_parser_new_from_data (const guchar *data,
24 gsize length);
25 ElfParser * elf_parser_new (const char *filename,
26 GError **err);
27 void elf_parser_free (ElfParser *parser);
28 const char * elf_parser_get_debug_link (ElfParser *parser,
29 guint32 *crc32);
30 const guchar *elf_parser_get_eh_frame (ElfParser *parser);
31 gulong elf_parser_get_text_offset (ElfParser *parser);
34 /* Lookup a symbol in the file.
36 * The symbol returned is const, so don't free it it or anything. It
37 * will be valid until elf_parser_free() is called on the parser.
40 * The address should be given in "file coordinates". This means that
41 * if the file is mapped at address m and offset o, then an address a
42 * should be looked up as "a - (m - o)". (m - o) is where the start
43 * of the file would have been mapped, so a - (m - o) is the position
44 * in the file of a.
46 const ElfSym *elf_parser_lookup_symbol (ElfParser *parser,
47 gulong address);
48 guint32 elf_parser_get_crc32 (ElfParser *parser);
49 const char *elf_parser_get_sym_name (ElfParser *parser,
50 const ElfSym *sym);
51 gulong elf_parser_get_sym_address (ElfParser *parser,
52 const ElfSym *sym);
53 char *elf_demangle (const char *name);