diff options
| author | 2019-05-17 21:41:33 -0400 | |
|---|---|---|
| committer | 2019-05-25 16:06:53 -0400 | |
| commit | 2179ad7483bde3c210bf4f638ae8801b3ba11214 (patch) | |
| tree | 27a139c66bb7917c6c2eb7075ecfb615425054f3 /src/core | |
| parent | Merge pull request #2513 from lioncash/string (diff) | |
| download | yuzu-2179ad7483bde3c210bf4f638ae8801b3ba11214.tar.gz yuzu-2179ad7483bde3c210bf4f638ae8801b3ba11214.tar.xz yuzu-2179ad7483bde3c210bf4f638ae8801b3ba11214.zip | |
core: Track load offsets of NSO modules
Needed for backtrace decomposition
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/core.cpp | 10 | ||||
| -rw-r--r-- | src/core/core.h | 5 | ||||
| -rw-r--r-- | src/core/loader/nso.cpp | 3 |
3 files changed, 18 insertions, 0 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 7106151bd..96ba6a569 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -270,6 +270,8 @@ struct System::Impl { | |||
| 270 | /// Telemetry session for this emulation session | 270 | /// Telemetry session for this emulation session |
| 271 | std::unique_ptr<Core::TelemetrySession> telemetry_session; | 271 | std::unique_ptr<Core::TelemetrySession> telemetry_session; |
| 272 | 272 | ||
| 273 | std::map<VAddr, std::string, std::greater<>> modules; | ||
| 274 | |||
| 273 | ResultStatus status = ResultStatus::Success; | 275 | ResultStatus status = ResultStatus::Success; |
| 274 | std::string status_details = ""; | 276 | std::string status_details = ""; |
| 275 | 277 | ||
| @@ -509,6 +511,14 @@ void System::ClearContentProvider(FileSys::ContentProviderUnionSlot slot) { | |||
| 509 | impl->content_provider->ClearSlot(slot); | 511 | impl->content_provider->ClearSlot(slot); |
| 510 | } | 512 | } |
| 511 | 513 | ||
| 514 | void System::RegisterNSOModule(std::string name, VAddr start_address) { | ||
| 515 | impl->modules.insert_or_assign(start_address, name); | ||
| 516 | } | ||
| 517 | |||
| 518 | const std::map<VAddr, std::string, std::greater<>>& System::GetRegisteredNSOModules() const { | ||
| 519 | return impl->modules; | ||
| 520 | } | ||
| 521 | |||
| 512 | System::ResultStatus System::Init(Frontend::EmuWindow& emu_window) { | 522 | System::ResultStatus System::Init(Frontend::EmuWindow& emu_window) { |
| 513 | return impl->Init(*this, emu_window); | 523 | return impl->Init(*this, emu_window); |
| 514 | } | 524 | } |
diff --git a/src/core/core.h b/src/core/core.h index a9a756a4c..10542ba21 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <memory> | 8 | #include <memory> |
| 9 | #include <string> | 9 | #include <string> |
| 10 | 10 | ||
| 11 | #include <map> | ||
| 11 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| 12 | #include "core/file_sys/vfs_types.h" | 13 | #include "core/file_sys/vfs_types.h" |
| 13 | #include "core/hle/kernel/object.h" | 14 | #include "core/hle/kernel/object.h" |
| @@ -285,6 +286,10 @@ public: | |||
| 285 | 286 | ||
| 286 | void ClearContentProvider(FileSys::ContentProviderUnionSlot slot); | 287 | void ClearContentProvider(FileSys::ContentProviderUnionSlot slot); |
| 287 | 288 | ||
| 289 | void RegisterNSOModule(std::string name, VAddr start_address); | ||
| 290 | |||
| 291 | const std::map<VAddr, std::string, std::greater<>>& GetRegisteredNSOModules() const; | ||
| 292 | |||
| 288 | private: | 293 | private: |
| 289 | System(); | 294 | System(); |
| 290 | 295 | ||
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 8592b1f44..7beeaaff3 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp | |||
| @@ -164,6 +164,9 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process, | |||
| 164 | // Register module with GDBStub | 164 | // Register module with GDBStub |
| 165 | GDBStub::RegisterModule(file.GetName(), load_base, load_base); | 165 | GDBStub::RegisterModule(file.GetName(), load_base, load_base); |
| 166 | 166 | ||
| 167 | // Register module for ARMInterface with System | ||
| 168 | Core::System::GetInstance().RegisterNSOModule(file.GetName(), load_base); | ||
| 169 | |||
| 167 | return load_base + image_size; | 170 | return load_base + image_size; |
| 168 | } | 171 | } |
| 169 | 172 | ||