Files
eden/src/core/arm/arm_interface.cpp
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.7 KiB
C++
Raw Normal View History

// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/logging/log.h"
#include "core/arm/arm_interface.h"
2023-11-28 14:30:39 -05:00
#include "core/arm/debug.h"
2019-05-17 21:43:26 -04:00
#include "core/core.h"
2022-04-08 23:53:42 -04:00
#include "core/hle/kernel/k_process.h"
namespace Core {
2019-05-17 21:43:26 -04:00
void ArmInterface::LogBacktrace(Kernel::KProcess* process) const {
2023-11-28 14:30:39 -05:00
Kernel::Svc::ThreadContext ctx;
this->GetContext(ctx);
LOG_ERROR(Core_ARM, "Backtrace, sp={:016X}, pc={:016X}", ctx.sp, ctx.pc);
LOG_ERROR(Core_ARM, "{:20}{:20}{:20}{:20}{}", "Module Name", "Address", "Original Address", "Offset", "Symbol");
auto const backtrace = GetBacktraceFromContext(process, ctx);
for (auto const& entry : backtrace)
LOG_ERROR(Core_ARM, "{:20}{:016X} {:016X} {:016X} {}", entry.module, entry.address, entry.original_address, entry.offset, entry.name);
2019-05-17 21:43:26 -04:00
}
2023-11-28 14:30:39 -05:00
const Kernel::DebugWatchpoint* ArmInterface::MatchingWatchpoint(
2023-03-17 21:26:04 -04:00
u64 addr, u64 size, Kernel::DebugWatchpointType access_type) const {
2023-11-28 14:30:39 -05:00
if (!m_watchpoints) {
2022-06-06 12:56:01 -04:00
return nullptr;
}
2023-03-17 21:26:04 -04:00
const u64 start_address{addr};
const u64 end_address{addr + size};
2022-06-06 12:56:01 -04:00
for (size_t i = 0; i < Core::Hardware::NUM_WATCHPOINTS; i++) {
2023-11-28 14:30:39 -05:00
const auto& watch{(*m_watchpoints)[i]};
2022-06-06 12:56:01 -04:00
2023-03-17 21:26:04 -04:00
if (end_address <= GetInteger(watch.start_address)) {
2022-06-06 12:56:01 -04:00
continue;
}
2023-03-17 21:26:04 -04:00
if (start_address >= GetInteger(watch.end_address)) {
2022-06-06 12:56:01 -04:00
continue;
}
if ((access_type & watch.type) == Kernel::DebugWatchpointType::None) {
continue;
}
return &watch;
}
return nullptr;
}
2018-12-30 20:41:30 -05:00
} // namespace Core