summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2017-05-07 14:56:23 -0700
committerGravatar Yuri Kunde Schlesner2017-05-07 15:33:07 -0700
commit6577bbc3c5c47d8e3868f1205284337c6c672744 (patch)
tree7837aa8fc199b519ac45fd1b8312f5fb0e02afa3 /src
parentcitra-qt: Remove callstack widget (diff)
downloadyuzu-6577bbc3c5c47d8e3868f1205284337c6c672744.tar.gz
yuzu-6577bbc3c5c47d8e3868f1205284337c6c672744.tar.xz
yuzu-6577bbc3c5c47d8e3868f1205284337c6c672744.zip
Remove ability to load symbol maps
This was now mostly unused except by thread creation, which used a symbol of the entrypoint, if available, to name the thread.
Diffstat (limited to 'src')
-rw-r--r--src/citra_qt/main.cpp13
-rw-r--r--src/citra_qt/main.h1
-rw-r--r--src/citra_qt/main.ui1
-rw-r--r--src/core/hle/svc.cpp10
-rw-r--r--src/core/loader/elf.cpp32
5 files changed, 2 insertions, 55 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 9beec69bc..d7fad555f 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -38,7 +38,6 @@
38#include "common/scm_rev.h" 38#include "common/scm_rev.h"
39#include "common/scope_exit.h" 39#include "common/scope_exit.h"
40#include "common/string_util.h" 40#include "common/string_util.h"
41#include "core/arm/disassembler/load_symbol_map.h"
42#include "core/core.h" 41#include "core/core.h"
43#include "core/file_sys/archive_source_sd_savedata.h" 42#include "core/file_sys/archive_source_sd_savedata.h"
44#include "core/gdbstub/gdbstub.h" 43#include "core/gdbstub/gdbstub.h"
@@ -253,8 +252,6 @@ void GMainWindow::ConnectWidgetEvents() {
253void GMainWindow::ConnectMenuEvents() { 252void GMainWindow::ConnectMenuEvents() {
254 // File 253 // File
255 connect(ui.action_Load_File, &QAction::triggered, this, &GMainWindow::OnMenuLoadFile); 254 connect(ui.action_Load_File, &QAction::triggered, this, &GMainWindow::OnMenuLoadFile);
256 connect(ui.action_Load_Symbol_Map, &QAction::triggered, this,
257 &GMainWindow::OnMenuLoadSymbolMap);
258 connect(ui.action_Select_Game_List_Root, &QAction::triggered, this, 255 connect(ui.action_Select_Game_List_Root, &QAction::triggered, this,
259 &GMainWindow::OnMenuSelectGameListRoot); 256 &GMainWindow::OnMenuSelectGameListRoot);
260 connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close); 257 connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close);
@@ -506,16 +503,6 @@ void GMainWindow::OnMenuLoadFile() {
506 } 503 }
507} 504}
508 505
509void GMainWindow::OnMenuLoadSymbolMap() {
510 QString filename = QFileDialog::getOpenFileName(
511 this, tr("Load Symbol Map"), UISettings::values.symbols_path, tr("Symbol Map (*.*)"));
512 if (!filename.isEmpty()) {
513 UISettings::values.symbols_path = QFileInfo(filename).path();
514
515 LoadSymbolMap(filename.toStdString());
516 }
517}
518
519void GMainWindow::OnMenuSelectGameListRoot() { 506void GMainWindow::OnMenuSelectGameListRoot() {
520 QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory")); 507 QString dir_path = QFileDialog::getExistingDirectory(this, tr("Select Directory"));
521 if (!dir_path.isEmpty()) { 508 if (!dir_path.isEmpty()) {
diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h
index ded089580..cb2e87cbd 100644
--- a/src/citra_qt/main.h
+++ b/src/citra_qt/main.h
@@ -116,7 +116,6 @@ private slots:
116 void OnGameListLoadFile(QString game_path); 116 void OnGameListLoadFile(QString game_path);
117 void OnGameListOpenSaveFolder(u64 program_id); 117 void OnGameListOpenSaveFolder(u64 program_id);
118 void OnMenuLoadFile(); 118 void OnMenuLoadFile();
119 void OnMenuLoadSymbolMap();
120 /// Called whenever a user selects the "File->Select Game List Root" menu item 119 /// Called whenever a user selects the "File->Select Game List Root" menu item
121 void OnMenuSelectGameListRoot(); 120 void OnMenuSelectGameListRoot();
122 void OnMenuRecentFile(); 121 void OnMenuRecentFile();
diff --git a/src/citra_qt/main.ui b/src/citra_qt/main.ui
index f64b878f0..b13d578f5 100644
--- a/src/citra_qt/main.ui
+++ b/src/citra_qt/main.ui
@@ -58,7 +58,6 @@
58 </property> 58 </property>
59 </widget> 59 </widget>
60 <addaction name="action_Load_File"/> 60 <addaction name="action_Load_File"/>
61 <addaction name="action_Load_Symbol_Map"/>
62 <addaction name="separator"/> 61 <addaction name="separator"/>
63 <addaction name="action_Select_Game_List_Root"/> 62 <addaction name="action_Select_Game_List_Root"/>
64 <addaction name="menu_recent_files"/> 63 <addaction name="menu_recent_files"/>
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 2db823c61..8538cfc9d 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -2,12 +2,12 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <cinttypes>
5#include <map> 6#include <map>
6#include "common/logging/log.h" 7#include "common/logging/log.h"
7#include "common/microprofile.h" 8#include "common/microprofile.h"
8#include "common/scope_exit.h" 9#include "common/scope_exit.h"
9#include "common/string_util.h" 10#include "common/string_util.h"
10#include "common/symbols.h"
11#include "core/arm/arm_interface.h" 11#include "core/arm/arm_interface.h"
12#include "core/core_timing.h" 12#include "core/core_timing.h"
13#include "core/hle/function_wrappers.h" 13#include "core/hle/function_wrappers.h"
@@ -524,13 +524,7 @@ static ResultCode CreateThread(Kernel::Handle* out_handle, s32 priority, u32 ent
524 u32 stack_top, s32 processor_id) { 524 u32 stack_top, s32 processor_id) {
525 using Kernel::Thread; 525 using Kernel::Thread;
526 526
527 std::string name; 527 std::string name = Common::StringFromFormat("unknown-%08" PRIX32, entry_point);
528 if (Symbols::HasSymbol(entry_point)) {
529 TSymbol symbol = Symbols::GetSymbol(entry_point);
530 name = symbol.name;
531 } else {
532 name = Common::StringFromFormat("unknown-%08x", entry_point);
533 }
534 528
535 if (priority > THREADPRIO_LOWEST) { 529 if (priority > THREADPRIO_LOWEST) {
536 return ResultCode(ErrorDescription::OutOfRange, ErrorModule::OS, 530 return ResultCode(ErrorDescription::OutOfRange, ErrorModule::OS,
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp
index 8eb5200ab..cfcde9167 100644
--- a/src/core/loader/elf.cpp
+++ b/src/core/loader/elf.cpp
@@ -8,7 +8,6 @@
8#include "common/common_types.h" 8#include "common/common_types.h"
9#include "common/file_util.h" 9#include "common/file_util.h"
10#include "common/logging/log.h" 10#include "common/logging/log.h"
11#include "common/symbols.h"
12#include "core/hle/kernel/process.h" 11#include "core/hle/kernel/process.h"
13#include "core/hle/kernel/resource_limit.h" 12#include "core/hle/kernel/resource_limit.h"
14#include "core/loader/elf.h" 13#include "core/loader/elf.h"
@@ -210,7 +209,6 @@ public:
210 return (u32)(header->e_flags); 209 return (u32)(header->e_flags);
211 } 210 }
212 SharedPtr<CodeSet> LoadInto(u32 vaddr); 211 SharedPtr<CodeSet> LoadInto(u32 vaddr);
213 bool LoadSymbols();
214 212
215 int GetNumSegments() const { 213 int GetNumSegments() const {
216 return (int)(header->e_phnum); 214 return (int)(header->e_phnum);
@@ -258,8 +256,6 @@ ElfReader::ElfReader(void* ptr) {
258 sections = (Elf32_Shdr*)(base + header->e_shoff); 256 sections = (Elf32_Shdr*)(base + header->e_shoff);
259 257
260 entryPoint = header->e_entry; 258 entryPoint = header->e_entry;
261
262 LoadSymbols();
263} 259}
264 260
265const char* ElfReader::GetSectionName(int section) const { 261const char* ElfReader::GetSectionName(int section) const {
@@ -362,34 +358,6 @@ SectionID ElfReader::GetSectionByName(const char* name, int firstSection) const
362 return -1; 358 return -1;
363} 359}
364 360
365bool ElfReader::LoadSymbols() {
366 bool hasSymbols = false;
367 SectionID sec = GetSectionByName(".symtab");
368 if (sec != -1) {
369 int stringSection = sections[sec].sh_link;
370 const char* stringBase = reinterpret_cast<const char*>(GetSectionDataPtr(stringSection));
371
372 // We have a symbol table!
373 const Elf32_Sym* symtab = reinterpret_cast<const Elf32_Sym*>(GetSectionDataPtr(sec));
374 unsigned int numSymbols = sections[sec].sh_size / sizeof(Elf32_Sym);
375 for (unsigned sym = 0; sym < numSymbols; sym++) {
376 int size = symtab[sym].st_size;
377 if (size == 0)
378 continue;
379
380 int type = symtab[sym].st_info & 0xF;
381
382 const char* name = stringBase + symtab[sym].st_name;
383
384 Symbols::Add(symtab[sym].st_value, name, size, type);
385
386 hasSymbols = true;
387 }
388 }
389
390 return hasSymbols;
391}
392
393//////////////////////////////////////////////////////////////////////////////////////////////////// 361////////////////////////////////////////////////////////////////////////////////////////////////////
394// Loader namespace 362// Loader namespace
395 363