arm_interface.cpp 714 B

123456789101112131415161718192021222324252627
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "common/common_types.h"
  5. #include "common/logging/log.h"
  6. #include "core/arm/arm_interface.h"
  7. #include "core/memory.h"
  8. namespace Core {
  9. void ARM_Interface::LogBacktrace() const {
  10. VAddr fp = GetReg(29);
  11. VAddr lr = GetReg(30);
  12. const VAddr sp = GetReg(13);
  13. const VAddr pc = GetPC();
  14. LOG_ERROR(Core_ARM, "Backtrace, sp={:016X}, pc={:016X}", sp, pc);
  15. while (true) {
  16. LOG_ERROR(Core_ARM, "{:016X}", lr);
  17. if (!fp) {
  18. break;
  19. }
  20. lr = Memory::Read64(fp + 8) - 4;
  21. fp = Memory::Read64(fp);
  22. }
  23. }
  24. } // namespace Core