mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-02 23:59:49 -04:00
ams: globally prefer R_RETURN to return for ams::Result
This commit is contained in:
parent
dd78ede99f
commit
bbf22b4c60
325 changed files with 1955 additions and 1993 deletions
|
@ -48,7 +48,7 @@ namespace ams::dmnt {
|
|||
AMS_DMNT2_GDB_LOG_DEBUG("BreakPointManager::SetBreakPoint %p 0x%lx !!! Fail 0x%08x !!!\n", bp, bp->m_address, result.GetValue());
|
||||
}
|
||||
|
||||
return result;
|
||||
R_RETURN(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace ams::dmnt {
|
|||
for (size_t i = 0; (bp = static_cast<BreakPointBase *>(this->GetBreakPoint(i))) != nullptr; ++i) {
|
||||
if (bp->m_in_use && bp->m_address == address) {
|
||||
AMS_ABORT_UNLESS(bp->m_size == size);
|
||||
return bp->Clear(m_debug_process);
|
||||
R_RETURN(bp->Clear(m_debug_process));
|
||||
}
|
||||
}
|
||||
R_SUCCEED();
|
||||
|
|
|
@ -281,24 +281,24 @@ namespace ams::dmnt {
|
|||
}
|
||||
|
||||
Result DebugProcess::GetThreadContext(svc::ThreadContext *out, u64 thread_id, u32 flags) {
|
||||
return svc::GetDebugThreadContext(out, m_debug_handle, thread_id, flags);
|
||||
R_RETURN(svc::GetDebugThreadContext(out, m_debug_handle, thread_id, flags));
|
||||
}
|
||||
|
||||
Result DebugProcess::SetThreadContext(const svc::ThreadContext *ctx, u64 thread_id, u32 flags) {
|
||||
return svc::SetDebugThreadContext(m_debug_handle, thread_id, ctx, flags);
|
||||
R_RETURN(svc::SetDebugThreadContext(m_debug_handle, thread_id, ctx, flags));
|
||||
}
|
||||
|
||||
Result DebugProcess::ReadMemory(void *dst, uintptr_t address, size_t size) {
|
||||
return svc::ReadDebugProcessMemory(reinterpret_cast<uintptr_t>(dst), m_debug_handle, address, size);
|
||||
R_RETURN(svc::ReadDebugProcessMemory(reinterpret_cast<uintptr_t>(dst), m_debug_handle, address, size));
|
||||
}
|
||||
|
||||
Result DebugProcess::WriteMemory(const void *src, uintptr_t address, size_t size) {
|
||||
return svc::WriteDebugProcessMemory(m_debug_handle, reinterpret_cast<uintptr_t>(src), address, size);
|
||||
R_RETURN(svc::WriteDebugProcessMemory(m_debug_handle, reinterpret_cast<uintptr_t>(src), address, size));
|
||||
}
|
||||
|
||||
Result DebugProcess::QueryMemory(svc::MemoryInfo *out, uintptr_t address) {
|
||||
svc::PageInfo dummy;
|
||||
return svc::QueryDebugProcessMemory(out, std::addressof(dummy), m_debug_handle, address);
|
||||
R_RETURN(svc::QueryDebugProcessMemory(out, std::addressof(dummy), m_debug_handle, address));
|
||||
}
|
||||
|
||||
Result DebugProcess::Continue() {
|
||||
|
@ -333,7 +333,7 @@ namespace ams::dmnt {
|
|||
|
||||
Result DebugProcess::Step() {
|
||||
AMS_DMNT2_GDB_LOG_DEBUG("DebugProcess::Step() all\n");
|
||||
return this->Step(this->GetLastThreadId());
|
||||
R_RETURN(this->Step(this->GetLastThreadId()));
|
||||
}
|
||||
|
||||
Result DebugProcess::Step(u64 thread_id) {
|
||||
|
@ -385,7 +385,7 @@ namespace ams::dmnt {
|
|||
Result DebugProcess::Break() {
|
||||
if (this->GetStatus() == ProcessStatus_Running) {
|
||||
AMS_DMNT2_GDB_LOG_DEBUG("DebugProcess::Break\n");
|
||||
return svc::BreakDebugProcess(m_debug_handle);
|
||||
R_RETURN(svc::BreakDebugProcess(m_debug_handle));
|
||||
} else {
|
||||
AMS_DMNT2_GDB_LOG_ERROR("DebugProcess::Break called on non-running process!\n");
|
||||
R_SUCCEED();
|
||||
|
@ -467,7 +467,7 @@ namespace ams::dmnt {
|
|||
}
|
||||
|
||||
Result DebugProcess::SetBreakPoint(uintptr_t address, size_t size, bool is_step) {
|
||||
return m_software_breakpoints.SetBreakPoint(address, size, is_step);
|
||||
R_RETURN(m_software_breakpoints.SetBreakPoint(address, size, is_step));
|
||||
}
|
||||
|
||||
Result DebugProcess::ClearBreakPoint(uintptr_t address, size_t size) {
|
||||
|
@ -476,7 +476,7 @@ namespace ams::dmnt {
|
|||
}
|
||||
|
||||
Result DebugProcess::SetHardwareBreakPoint(uintptr_t address, size_t size, bool is_step) {
|
||||
return m_hardware_breakpoints.SetBreakPoint(address, size, is_step);
|
||||
R_RETURN(m_hardware_breakpoints.SetBreakPoint(address, size, is_step));
|
||||
}
|
||||
|
||||
Result DebugProcess::ClearHardwareBreakPoint(uintptr_t address, size_t size) {
|
||||
|
@ -485,15 +485,15 @@ namespace ams::dmnt {
|
|||
}
|
||||
|
||||
Result DebugProcess::SetWatchPoint(u64 address, u64 size, bool read, bool write) {
|
||||
return m_hardware_watchpoints.SetWatchPoint(address, size, read, write);
|
||||
R_RETURN(m_hardware_watchpoints.SetWatchPoint(address, size, read, write));
|
||||
}
|
||||
|
||||
Result DebugProcess::ClearWatchPoint(u64 address, u64 size) {
|
||||
return m_hardware_watchpoints.ClearBreakPoint(address, size);
|
||||
R_RETURN(m_hardware_watchpoints.ClearBreakPoint(address, size));
|
||||
}
|
||||
|
||||
Result DebugProcess::GetWatchPointInfo(u64 address, bool &read, bool &write) {
|
||||
return m_hardware_watchpoints.GetWatchPointInfo(address, read, write);
|
||||
R_RETURN(m_hardware_watchpoints.GetWatchPointInfo(address, read, write));
|
||||
}
|
||||
|
||||
bool DebugProcess::IsValidWatchPoint(u64 address, u64 size) {
|
||||
|
|
|
@ -957,7 +957,7 @@ namespace ams::dmnt {
|
|||
|
||||
s32 dummy = -1;
|
||||
svc::Handle handle = m_debug_process.GetHandle();
|
||||
return svc::WaitSynchronization(std::addressof(dummy), std::addressof(handle), 1, TimeSpan::FromMilliSeconds(20).GetNanoSeconds());
|
||||
R_RETURN(svc::WaitSynchronization(std::addressof(dummy), std::addressof(handle), 1, TimeSpan::FromMilliSeconds(20).GetNanoSeconds()));
|
||||
}();
|
||||
|
||||
/* Check if we're killed. */
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace ams::dmnt {
|
|||
result = HardwareBreakPointManager::SetExecutionBreakPoint(m_reg, m_ctx, 0);
|
||||
this->Reset();
|
||||
}
|
||||
return result;
|
||||
R_RETURN(result);
|
||||
}
|
||||
|
||||
Result HardwareBreakPoint::Set(DebugProcess *debug_process, uintptr_t address, size_t size, bool is_step) {
|
||||
|
@ -159,7 +159,7 @@ namespace ams::dmnt {
|
|||
AMS_DMNT2_GDB_LOG_ERROR("SetContextBreakPoint FAIL 0x%08x ctx=%d\n", result.GetValue(), ctx);
|
||||
}
|
||||
|
||||
return result;
|
||||
R_RETURN(result);
|
||||
}
|
||||
|
||||
svc::HardwareBreakPointRegisterName HardwareBreakPointManager::GetWatchPointContextRegister() {
|
||||
|
@ -176,7 +176,7 @@ namespace ams::dmnt {
|
|||
AMS_DMNT2_GDB_LOG_ERROR("SetContextBreakPoint FAIL 0x%08x reg=%d, ctx=%d, address=%lx\n", result.GetValue(), reg, ctx, address);
|
||||
}
|
||||
|
||||
return result;
|
||||
R_RETURN(result);
|
||||
}
|
||||
|
||||
void HardwareBreakPointManager::CountBreakPointRegisters() {
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace ams::dmnt {
|
|||
if (R_FAILED(result)) {
|
||||
AMS_DMNT2_GDB_LOG_ERROR("SetDataBreakPoint FAIL 0x%08x, reg=%d, address=0x%lx\n", result.GetValue(), reg, address);
|
||||
}
|
||||
return result;
|
||||
R_RETURN(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ namespace ams::dmnt {
|
|||
result = SetDataBreakPoint(m_reg, m_ctx, 0, 0, false, false);
|
||||
this->Reset();
|
||||
}
|
||||
return result;
|
||||
R_RETURN(result);
|
||||
}
|
||||
|
||||
Result WatchPoint::Set(DebugProcess *debug_process, uintptr_t address, size_t size, bool read, bool write) {
|
||||
|
@ -143,7 +143,7 @@ namespace ams::dmnt {
|
|||
R_UNLESS(bp != nullptr, svc::ResultOutOfHandles());
|
||||
|
||||
/* Set the watchpoint. */
|
||||
return bp->Set(m_debug_process, address, size, read, write);
|
||||
R_RETURN(bp->Set(m_debug_process, address, size, read, write));
|
||||
}
|
||||
|
||||
Result HardwareWatchPointManager::GetWatchPointInfo(u64 address, bool &read, bool &write) {
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace ams::dmnt {
|
|||
AMS_DMNT2_GDB_LOG_ERROR("SoftwareBreakPoint::Clear %p 0x%lx, insn=0x%x, !!! Null Address !!!\n", this, m_address, m_insn);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
R_RETURN(result);
|
||||
}
|
||||
|
||||
Result SoftwareBreakPoint::Set(DebugProcess *debug_process, uintptr_t address, size_t size, bool is_step) {
|
||||
|
@ -76,7 +76,7 @@ namespace ams::dmnt {
|
|||
m_in_use = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
R_RETURN(result);
|
||||
}
|
||||
|
||||
SoftwareBreakPointManager::SoftwareBreakPointManager(DebugProcess *debug_process) : BreakPointManager(debug_process) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue