-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfreebsd-symbolicator.h
58 lines (50 loc) · 1.28 KB
/
freebsd-symbolicator.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// freebsd-symbolicator.h
// drspin
//
// Created by Matt Jacobson on 6/7/22.
//
#include "util.h"
#include <stdint.h>
#include <string>
#include <vector>
#ifndef FREEBSD_SYMBOLICATOR_H
#define FREEBSD_SYMBOLICATOR_H
struct Symbol {
Symbol(std::string name, uintptr_t address, size_t size);
std::string name() const;
uintptr_t address() const;
size_t size() const;
private:
std::string _name;
uintptr_t _address;
size_t _size;
};
struct Library {
Library(std::string path, uintptr_t load_address);
std::string symbolicate(uintptr_t address) const;
std::string path() const;
std::string name() const;
uintptr_t load_address() const;
uintptr_t base_address() const;
private:
std::string _path;
uintptr_t _load_address;
uintptr_t _base_address;
std::vector<Symbol> _symbols;
};
struct FreeBSDSymbolicator : public Symbolicator {
std::string symbolicate(uintptr_t address);
void print_libraries() const;
protected:
std::vector<Library> _libraries;
};
struct FreeBSDUserSymbolicator : public FreeBSDSymbolicator {
FreeBSDUserSymbolicator(pid_t pid);
private:
pid_t _pid;
};
struct FreeBSDKernelSymbolicator : public FreeBSDSymbolicator {
FreeBSDKernelSymbolicator();
};
#endif /* FREEBSD_SYMBOLICATOR_H */