summaryrefslogtreecommitdiffstats
path: root/src/core/arm
diff options
context:
space:
mode:
authorbunnei <ericbunnie@gmail.com>2014-05-01 05:46:06 +0200
committerbunnei <ericbunnie@gmail.com>2014-05-01 05:46:06 +0200
commit29da6e9ab57a37abafc9c91e00bb01daf451b3ad (patch)
tree842d84bacad354bd9c447dfe99c97785f1b618a8 /src/core/arm
parentfixed a bug where ExeFs code was being incorrectly masked (diff)
downloadyuzu-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')
-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 @@
+// 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);
+ }
+}
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 @@
+// Copyright 2014 Citra Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include <string>
+
+/*
+ * Loads a symbol map file for use with the disassembler
+ * @param filename String filename path of symbol map file
+ */
+void LoadSymbolMap(std::string filename);