diff options
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/k_process.cpp | 5 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_process.h | 8 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc/svc_debug_string.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc/svc_exception.cpp | 6 |
4 files changed, 17 insertions, 4 deletions
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp index 703049ede..4a099286b 100644 --- a/src/core/hle/kernel/k_process.cpp +++ b/src/core/hle/kernel/k_process.cpp | |||
| @@ -96,6 +96,7 @@ Result KProcess::Initialize(KProcess* process, Core::System& system, std::string | |||
| 96 | process->m_is_suspended = false; | 96 | process->m_is_suspended = false; |
| 97 | process->m_schedule_count = 0; | 97 | process->m_schedule_count = 0; |
| 98 | process->m_is_handle_table_initialized = false; | 98 | process->m_is_handle_table_initialized = false; |
| 99 | process->m_is_hbl = false; | ||
| 99 | 100 | ||
| 100 | // Open a reference to the resource limit. | 101 | // Open a reference to the resource limit. |
| 101 | process->m_resource_limit->Open(); | 102 | process->m_resource_limit->Open(); |
| @@ -351,12 +352,14 @@ Result KProcess::SetActivity(ProcessActivity activity) { | |||
| 351 | R_SUCCEED(); | 352 | R_SUCCEED(); |
| 352 | } | 353 | } |
| 353 | 354 | ||
| 354 | Result KProcess::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std::size_t code_size) { | 355 | Result KProcess::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std::size_t code_size, |
| 356 | bool is_hbl) { | ||
| 355 | m_program_id = metadata.GetTitleID(); | 357 | m_program_id = metadata.GetTitleID(); |
| 356 | m_ideal_core = metadata.GetMainThreadCore(); | 358 | m_ideal_core = metadata.GetMainThreadCore(); |
| 357 | m_is_64bit_process = metadata.Is64BitProgram(); | 359 | m_is_64bit_process = metadata.Is64BitProgram(); |
| 358 | m_system_resource_size = metadata.GetSystemResourceSize(); | 360 | m_system_resource_size = metadata.GetSystemResourceSize(); |
| 359 | m_image_size = code_size; | 361 | m_image_size = code_size; |
| 362 | m_is_hbl = is_hbl; | ||
| 360 | 363 | ||
| 361 | if (metadata.GetAddressSpaceType() == FileSys::ProgramAddressSpaceType::Is39Bit) { | 364 | if (metadata.GetAddressSpaceType() == FileSys::ProgramAddressSpaceType::Is39Bit) { |
| 362 | // For 39-bit processes, the ASLR region starts at 0x800'0000 and is ~512GiB large. | 365 | // For 39-bit processes, the ASLR region starts at 0x800'0000 and is ~512GiB large. |
diff --git a/src/core/hle/kernel/k_process.h b/src/core/hle/kernel/k_process.h index 4fdeaf11a..146e07a57 100644 --- a/src/core/hle/kernel/k_process.h +++ b/src/core/hle/kernel/k_process.h | |||
| @@ -338,7 +338,8 @@ public: | |||
| 338 | * @returns ResultSuccess if all relevant metadata was able to be | 338 | * @returns ResultSuccess if all relevant metadata was able to be |
| 339 | * loaded and parsed. Otherwise, an error code is returned. | 339 | * loaded and parsed. Otherwise, an error code is returned. |
| 340 | */ | 340 | */ |
| 341 | Result LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std::size_t code_size); | 341 | Result LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std::size_t code_size, |
| 342 | bool is_hbl); | ||
| 342 | 343 | ||
| 343 | /** | 344 | /** |
| 344 | * Starts the main application thread for this process. | 345 | * Starts the main application thread for this process. |
| @@ -368,6 +369,10 @@ public: | |||
| 368 | return GetProcessId(); | 369 | return GetProcessId(); |
| 369 | } | 370 | } |
| 370 | 371 | ||
| 372 | bool IsHbl() const { | ||
| 373 | return m_is_hbl; | ||
| 374 | } | ||
| 375 | |||
| 371 | bool IsSignaled() const override; | 376 | bool IsSignaled() const override; |
| 372 | 377 | ||
| 373 | void DoWorkerTaskImpl(); | 378 | void DoWorkerTaskImpl(); |
| @@ -525,6 +530,7 @@ private: | |||
| 525 | bool m_is_immortal{}; | 530 | bool m_is_immortal{}; |
| 526 | bool m_is_handle_table_initialized{}; | 531 | bool m_is_handle_table_initialized{}; |
| 527 | bool m_is_initialized{}; | 532 | bool m_is_initialized{}; |
| 533 | bool m_is_hbl{}; | ||
| 528 | 534 | ||
| 529 | std::atomic<u16> m_num_running_threads{}; | 535 | std::atomic<u16> m_num_running_threads{}; |
| 530 | 536 | ||
diff --git a/src/core/hle/kernel/svc/svc_debug_string.cpp b/src/core/hle/kernel/svc/svc_debug_string.cpp index 4c14ce668..00b65429b 100644 --- a/src/core/hle/kernel/svc/svc_debug_string.cpp +++ b/src/core/hle/kernel/svc/svc_debug_string.cpp | |||
| @@ -14,7 +14,7 @@ Result OutputDebugString(Core::System& system, u64 address, u64 len) { | |||
| 14 | 14 | ||
| 15 | std::string str(len, '\0'); | 15 | std::string str(len, '\0'); |
| 16 | GetCurrentMemory(system.Kernel()).ReadBlock(address, str.data(), str.size()); | 16 | GetCurrentMemory(system.Kernel()).ReadBlock(address, str.data(), str.size()); |
| 17 | LOG_DEBUG(Debug_Emulated, "{}", str); | 17 | LOG_INFO(Debug_Emulated, "{}", str); |
| 18 | 18 | ||
| 19 | R_SUCCEED(); | 19 | R_SUCCEED(); |
| 20 | } | 20 | } |
diff --git a/src/core/hle/kernel/svc/svc_exception.cpp b/src/core/hle/kernel/svc/svc_exception.cpp index 580cf2f75..c581c086b 100644 --- a/src/core/hle/kernel/svc/svc_exception.cpp +++ b/src/core/hle/kernel/svc/svc_exception.cpp | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include "core/core.h" | 4 | #include "core/core.h" |
| 5 | #include "core/debugger/debugger.h" | 5 | #include "core/debugger/debugger.h" |
| 6 | #include "core/hle/kernel/k_process.h" | ||
| 6 | #include "core/hle/kernel/k_thread.h" | 7 | #include "core/hle/kernel/k_thread.h" |
| 7 | #include "core/hle/kernel/svc.h" | 8 | #include "core/hle/kernel/svc.h" |
| 8 | #include "core/hle/kernel/svc_types.h" | 9 | #include "core/hle/kernel/svc_types.h" |
| @@ -107,7 +108,10 @@ void Break(Core::System& system, BreakReason reason, u64 info1, u64 info2) { | |||
| 107 | system.ArmInterface(static_cast<std::size_t>(thread_processor_id)).LogBacktrace(); | 108 | system.ArmInterface(static_cast<std::size_t>(thread_processor_id)).LogBacktrace(); |
| 108 | } | 109 | } |
| 109 | 110 | ||
| 110 | if (system.DebuggerEnabled()) { | 111 | const bool is_hbl = GetCurrentProcess(system.Kernel()).IsHbl(); |
| 112 | const bool should_break = is_hbl || !notification_only; | ||
| 113 | |||
| 114 | if (system.DebuggerEnabled() && should_break) { | ||
| 111 | auto* thread = system.Kernel().GetCurrentEmuThread(); | 115 | auto* thread = system.Kernel().GetCurrentEmuThread(); |
| 112 | system.GetDebugger().NotifyThreadStopped(thread); | 116 | system.GetDebugger().NotifyThreadStopped(thread); |
| 113 | thread->RequestSuspend(Kernel::SuspendType::Debug); | 117 | thread->RequestSuspend(Kernel::SuspendType::Debug); |