49 lines
854 B
C
Raw Normal View History

2024-09-08 08:32:31 +06:00
#pragma once
#include <cstdint>
#include <string>
2024-09-08 08:32:31 +06:00
enum SymbolType
{
Symbol_None,
Symbol_Section,
Symbol_Function,
Symbol_Comment,
};
struct Symbol
{
mutable std::string name {};
size_t address {};
size_t size {};
mutable SymbolType type {};
2024-12-13 18:31:55 +03:00
Symbol()
{
}
Symbol(std::string name, size_t address, size_t size, SymbolType type)
: name(std::move(name)), address(address), size(size), type(type)
{
}
2024-09-08 08:32:31 +06:00
};
struct SymbolComparer
{
using is_transparent = void;
bool operator()(const Symbol& lhs, size_t rhs) const
{
return lhs.address < rhs;
2024-09-08 08:32:31 +06:00
}
bool operator()(size_t lhs, const Symbol& rhs) const
{
return lhs < rhs.address;
}
bool operator()(const Symbol& lhs, const Symbol& rhs) const
{
return lhs.address < rhs.address;
2024-09-08 08:32:31 +06:00
}
};