summaryrefslogtreecommitdiff
path: root/src/core/debugger
diff options
context:
space:
mode:
authorGravatar Liam2023-03-07 16:11:50 -0500
committerGravatar Liam2023-03-12 22:09:09 -0400
commit6bfb4c8f713323bb39b7e38a779c35583fc61bcc (patch)
tree6208bf4bbd1c303811384c8fe3d600560a4d3bfe /src/core/debugger
parentkernel: prefer std::addressof (diff)
downloadyuzu-6bfb4c8f713323bb39b7e38a779c35583fc61bcc.tar.gz
yuzu-6bfb4c8f713323bb39b7e38a779c35583fc61bcc.tar.xz
yuzu-6bfb4c8f713323bb39b7e38a779c35583fc61bcc.zip
kernel: convert KThread to new style
Diffstat (limited to 'src/core/debugger')
-rw-r--r--src/core/debugger/gdbstub.cpp12
-rw-r--r--src/core/debugger/gdbstub_arch.cpp4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/core/debugger/gdbstub.cpp b/src/core/debugger/gdbstub.cpp
index 18afe97e1..f39f2ca29 100644
--- a/src/core/debugger/gdbstub.cpp
+++ b/src/core/debugger/gdbstub.cpp
@@ -421,7 +421,7 @@ void GDBStub::HandleBreakpointRemove(std::string_view command) {
421static std::optional<std::string> GetNameFromThreadType32(Core::Memory::Memory& memory, 421static std::optional<std::string> GetNameFromThreadType32(Core::Memory::Memory& memory,
422 const Kernel::KThread* thread) { 422 const Kernel::KThread* thread) {
423 // Read thread type from TLS 423 // Read thread type from TLS
424 const VAddr tls_thread_type{memory.Read32(thread->GetTLSAddress() + 0x1fc)}; 424 const VAddr tls_thread_type{memory.Read32(thread->GetTlsAddress() + 0x1fc)};
425 const VAddr argument_thread_type{thread->GetArgument()}; 425 const VAddr argument_thread_type{thread->GetArgument()};
426 426
427 if (argument_thread_type && tls_thread_type != argument_thread_type) { 427 if (argument_thread_type && tls_thread_type != argument_thread_type) {
@@ -452,7 +452,7 @@ static std::optional<std::string> GetNameFromThreadType32(Core::Memory::Memory&
452static std::optional<std::string> GetNameFromThreadType64(Core::Memory::Memory& memory, 452static std::optional<std::string> GetNameFromThreadType64(Core::Memory::Memory& memory,
453 const Kernel::KThread* thread) { 453 const Kernel::KThread* thread) {
454 // Read thread type from TLS 454 // Read thread type from TLS
455 const VAddr tls_thread_type{memory.Read64(thread->GetTLSAddress() + 0x1f8)}; 455 const VAddr tls_thread_type{memory.Read64(thread->GetTlsAddress() + 0x1f8)};
456 const VAddr argument_thread_type{thread->GetArgument()}; 456 const VAddr argument_thread_type{thread->GetArgument()};
457 457
458 if (argument_thread_type && tls_thread_type != argument_thread_type) { 458 if (argument_thread_type && tls_thread_type != argument_thread_type) {
@@ -576,7 +576,7 @@ void GDBStub::HandleQuery(std::string_view command) {
576 const auto& threads = system.ApplicationProcess()->GetThreadList(); 576 const auto& threads = system.ApplicationProcess()->GetThreadList();
577 std::vector<std::string> thread_ids; 577 std::vector<std::string> thread_ids;
578 for (const auto& thread : threads) { 578 for (const auto& thread : threads) {
579 thread_ids.push_back(fmt::format("{:x}", thread->GetThreadID())); 579 thread_ids.push_back(fmt::format("{:x}", thread->GetThreadId()));
580 } 580 }
581 SendReply(fmt::format("m{}", fmt::join(thread_ids, ","))); 581 SendReply(fmt::format("m{}", fmt::join(thread_ids, ",")));
582 } else if (command.starts_with("sThreadInfo")) { 582 } else if (command.starts_with("sThreadInfo")) {
@@ -591,11 +591,11 @@ void GDBStub::HandleQuery(std::string_view command) {
591 for (const auto* thread : threads) { 591 for (const auto* thread : threads) {
592 auto thread_name{GetThreadName(system, thread)}; 592 auto thread_name{GetThreadName(system, thread)};
593 if (!thread_name) { 593 if (!thread_name) {
594 thread_name = fmt::format("Thread {:d}", thread->GetThreadID()); 594 thread_name = fmt::format("Thread {:d}", thread->GetThreadId());
595 } 595 }
596 596
597 buffer += fmt::format(R"(<thread id="{:x}" core="{:d}" name="{}">{}</thread>)", 597 buffer += fmt::format(R"(<thread id="{:x}" core="{:d}" name="{}">{}</thread>)",
598 thread->GetThreadID(), thread->GetActiveCore(), 598 thread->GetThreadId(), thread->GetActiveCore(),
599 EscapeXML(*thread_name), GetThreadState(thread)); 599 EscapeXML(*thread_name), GetThreadState(thread));
600 } 600 }
601 601
@@ -819,7 +819,7 @@ void GDBStub::HandleRcmd(const std::vector<u8>& command) {
819Kernel::KThread* GDBStub::GetThreadByID(u64 thread_id) { 819Kernel::KThread* GDBStub::GetThreadByID(u64 thread_id) {
820 const auto& threads{system.ApplicationProcess()->GetThreadList()}; 820 const auto& threads{system.ApplicationProcess()->GetThreadList()};
821 for (auto* thread : threads) { 821 for (auto* thread : threads) {
822 if (thread->GetThreadID() == thread_id) { 822 if (thread->GetThreadId() == thread_id) {
823 return thread; 823 return thread;
824 } 824 }
825 } 825 }
diff --git a/src/core/debugger/gdbstub_arch.cpp b/src/core/debugger/gdbstub_arch.cpp
index 831c48513..75c94a91a 100644
--- a/src/core/debugger/gdbstub_arch.cpp
+++ b/src/core/debugger/gdbstub_arch.cpp
@@ -259,7 +259,7 @@ void GDBStubA64::WriteRegisters(Kernel::KThread* thread, std::string_view regist
259std::string GDBStubA64::ThreadStatus(const Kernel::KThread* thread, u8 signal) const { 259std::string GDBStubA64::ThreadStatus(const Kernel::KThread* thread, u8 signal) const {
260 return fmt::format("T{:02x}{:02x}:{};{:02x}:{};{:02x}:{};thread:{:x};", signal, PC_REGISTER, 260 return fmt::format("T{:02x}{:02x}:{};{:02x}:{};{:02x}:{};thread:{:x};", signal, PC_REGISTER,
261 RegRead(thread, PC_REGISTER), SP_REGISTER, RegRead(thread, SP_REGISTER), 261 RegRead(thread, PC_REGISTER), SP_REGISTER, RegRead(thread, SP_REGISTER),
262 LR_REGISTER, RegRead(thread, LR_REGISTER), thread->GetThreadID()); 262 LR_REGISTER, RegRead(thread, LR_REGISTER), thread->GetThreadId());
263} 263}
264 264
265u32 GDBStubA64::BreakpointInstruction() const { 265u32 GDBStubA64::BreakpointInstruction() const {
@@ -469,7 +469,7 @@ void GDBStubA32::WriteRegisters(Kernel::KThread* thread, std::string_view regist
469std::string GDBStubA32::ThreadStatus(const Kernel::KThread* thread, u8 signal) const { 469std::string GDBStubA32::ThreadStatus(const Kernel::KThread* thread, u8 signal) const {
470 return fmt::format("T{:02x}{:02x}:{};{:02x}:{};{:02x}:{};thread:{:x};", signal, PC_REGISTER, 470 return fmt::format("T{:02x}{:02x}:{};{:02x}:{};{:02x}:{};thread:{:x};", signal, PC_REGISTER,
471 RegRead(thread, PC_REGISTER), SP_REGISTER, RegRead(thread, SP_REGISTER), 471 RegRead(thread, PC_REGISTER), SP_REGISTER, RegRead(thread, SP_REGISTER),
472 LR_REGISTER, RegRead(thread, LR_REGISTER), thread->GetThreadID()); 472 LR_REGISTER, RegRead(thread, LR_REGISTER), thread->GetThreadId());
473} 473}
474 474
475u32 GDBStubA32::BreakpointInstruction() const { 475u32 GDBStubA32::BreakpointInstruction() const {