-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsymbol_table.h
More file actions
40 lines (30 loc) · 822 Bytes
/
symbol_table.h
File metadata and controls
40 lines (30 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef __SYMBOL_TABLE_H__
#define __SYMBOL_TABLE_H__
#include <bfd.h>
struct frame_record_s {
const char *filename;
const char *functionname;
unsigned int line;
unsigned int discriminator;
};
typedef struct frame_record_s frame_record_t;
struct symbol_table_s {
bfd *abfd;
asymbol **syms;
};
typedef struct symbol_table_s symbol_table_t;
/*
* build program symbal table by binary path.
*
* On success, malloc asymbol object, return 0.
* On error, return -1.
*/
int symbol_table_build(char *path, symbol_table_t *table);
/*
* find symbal table by stack address, output fill frame_record_t.
*
* On success, fill frame_record_t fields return true.
* On error, return false.
*/
bfd_boolean symbol_table_find(symbol_table_t *table, void *addr, frame_record_t *out);
#endif