No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

StackTrace.h 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include <stdint.h>
  3. #include <vector>
  4. #include "il2cpp-config.h"
  5. #include "il2cpp-metadata.h"
  6. namespace il2cpp
  7. {
  8. namespace vm
  9. {
  10. typedef std::vector<Il2CppStackFrameInfo> StackFrames;
  11. class LIBIL2CPP_CODEGEN_API StackTrace
  12. {
  13. public:
  14. static void InitializeStackTracesForCurrentThread();
  15. static void CleanupStackTracesForCurrentThread();
  16. // Current thread functions
  17. static const StackFrames* GetStackFrames();
  18. static const StackFrames* GetCachedStackFrames(int32_t depth);
  19. static bool GetStackFrameAt(int32_t depth, Il2CppStackFrameInfo& frame);
  20. static void WalkFrameStack(Il2CppFrameWalkFunc callback, void* context);
  21. inline static size_t GetStackDepth() { return GetStackFrames()->size(); }
  22. inline static bool GetTopStackFrame(Il2CppStackFrameInfo& frame) { return GetStackFrameAt(0, frame); }
  23. static void PushFrame(Il2CppStackFrameInfo& frame);
  24. static void PopFrame();
  25. static const void* GetStackPointer();
  26. // Remote thread functions
  27. static bool GetThreadStackFrameAt(Il2CppThread* thread, int32_t depth, Il2CppStackFrameInfo& frame);
  28. static void WalkThreadFrameStack(Il2CppThread* thread, Il2CppFrameWalkFunc callback, void* context);
  29. static int32_t GetThreadStackDepth(Il2CppThread* thread);
  30. static bool GetThreadTopStackFrame(Il2CppThread* thread, Il2CppStackFrameInfo& frame);
  31. };
  32. }
  33. }