summaryrefslogtreecommitdiff
path: root/src/core/arm/disassembler
diff options
context:
space:
mode:
authorGravatar bunnei2014-04-30 23:46:06 -0400
committerGravatar bunnei2014-04-30 23:46:06 -0400
commit29da6e9ab57a37abafc9c91e00bb01daf451b3ad (patch)
tree842d84bacad354bd9c447dfe99c97785f1b618a8 /src/core/arm/disassembler
parentfixed a bug where ExeFs code was being incorrectly masked (diff)
downloadyuzu-29da6e9ab57a37abafc9c91e00bb01daf451b3ad.tar.gz
yuzu-29da6e9ab57a37abafc9c91e00bb01daf451b3ad.tar.xz
yuzu-29da6e9ab57a37abafc9c91e00bb01daf451b3ad.zip
added a module to load symbol map files for debugging
Diffstat (limited to 'src/core/arm/disassembler')
-rw-r--r--src/core/arm/disassembler/load_symbol_map.cpp33
-rw-r--r--src/core/arm/disassembler/load_symbol_map.h13
2 files changed, 46 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 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2
3// Refer to the license.txt file included.
4
5#include <string>
6#include <vector>
7
8#include "common/symbols.h"
9#include "common/common_types.h"
10#include "common/file_util.h"
11
12#include "core/arm/disassembler/load_symbol_map.h"
13
14/*
15 * Loads a symbol map file for use with the disassembler
16 * @param filename String filename path of symbol map file
17 */
18void LoadSymbolMap(std::string filename) {
19 std::ifstream infile(filename);
20
21 std::string address_str, function_name, line;
22 u32 size, address;
23
24 while (std::getline(infile, line)) {
25 std::istringstream iss(line);
26 if (!(iss >> address_str >> size >> function_name)) {
27 break; // Error parsing
28 }
29 u32 address = std::stoul(address_str, nullptr, 16);
30
31 Symbols::Add(address, function_name, size, 2);
32 }
33}
diff --git a/src/core/arm/disassembler/load_symbol_map.h b/src/core/arm/disassembler/load_symbol_map.h
new file mode 100644
index 000000000..837cca99b
--- /dev/null
+++ b/src/core/arm/disassembler/load_symbol_map.h
@@ -0,0 +1,13 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <string>
8
9/*
10 * Loads a symbol map file for use with the disassembler
11 * @param filename String filename path of symbol map file
12 */
13void LoadSymbolMap(std::string filename);