AsmGrader 0.0.0
Loading...
Searching...
No Matches
symbol_table.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <cstdint>
6#include <optional>
7#include <string_view>
8#include <vector>
9
10namespace asmgrader {
11
14{
15public:
16 explicit SymbolTable(const std::vector<Symbol>& symbols);
17
18 std::optional<Symbol> find(std::string_view name) const;
19
25 std::optional<Symbol> find_closest_above(std::uintptr_t address) const;
26
27private:
28 std::vector<Symbol> symbols_;
29};
30
31} // namespace asmgrader
A basic symbol table, for simple interaction with a number of symbols loaded from an ELF file.
Definition symbol_table.hpp:14
std::optional< Symbol > find_closest_above(std::uintptr_t address) const
Find the closest symbol at or below address If no symbol is at or above address, returns nullopt.
Definition symbol_table.cpp:31
SymbolTable(const std::vector< Symbol > &symbols)
Definition symbol_table.cpp:13
std::optional< Symbol > find(std::string_view name) const
Definition symbol_table.cpp:21
Definition asm_buffer.hpp:19