diff options
author | bunnei <ericbunnie@gmail.com> | 2014-05-01 05:46:06 +0200 |
---|---|---|
committer | bunnei <ericbunnie@gmail.com> | 2014-05-01 05:46:06 +0200 |
commit | 29da6e9ab57a37abafc9c91e00bb01daf451b3ad (patch) | |
tree | 842d84bacad354bd9c447dfe99c97785f1b618a8 /src/core/arm/disassembler/load_symbol_map.cpp | |
parent | fixed a bug where ExeFs code was being incorrectly masked (diff) | |
download | yuzu-29da6e9ab57a37abafc9c91e00bb01daf451b3ad.tar yuzu-29da6e9ab57a37abafc9c91e00bb01daf451b3ad.tar.gz yuzu-29da6e9ab57a37abafc9c91e00bb01daf451b3ad.tar.bz2 yuzu-29da6e9ab57a37abafc9c91e00bb01daf451b3ad.tar.lz yuzu-29da6e9ab57a37abafc9c91e00bb01daf451b3ad.tar.xz yuzu-29da6e9ab57a37abafc9c91e00bb01daf451b3ad.tar.zst yuzu-29da6e9ab57a37abafc9c91e00bb01daf451b3ad.zip |
Diffstat (limited to 'src/core/arm/disassembler/load_symbol_map.cpp')
-rw-r--r-- | src/core/arm/disassembler/load_symbol_map.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/core/arm/disassembler/load_symbol_map.cpp b/src/core/arm/disassembler/load_symbol_map.cpp new file mode 100644 index 000000000..d7fc0a042 --- /dev/null +++ b/src/core/arm/disassembler/load_symbol_map.cpp @@ -0,0 +1,33 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. + +#include <string> +#include <vector> + +#include "common/symbols.h" +#include "common/common_types.h" +#include "common/file_util.h" + +#include "core/arm/disassembler/load_symbol_map.h" + +/* + * Loads a symbol map file for use with the disassembler + * @param filename String filename path of symbol map file + */ +void LoadSymbolMap(std::string filename) { + std::ifstream infile(filename); + + std::string address_str, function_name, line; + u32 size, address; + + while (std::getline(infile, line)) { + std::istringstream iss(line); + if (!(iss >> address_str >> size >> function_name)) { + break; // Error parsing + } + u32 address = std::stoul(address_str, nullptr, 16); + + Symbols::Add(address, function_name, size, 2); + } +} |