eathread_callstack_apple.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Copyright (c) Electronic Arts Inc. All rights reserved.
  3. ///////////////////////////////////////////////////////////////////////////////
  4. #if defined(EA_PRAGMA_ONCE_SUPPORTED)
  5. #pragma once // Some compilers (e.g. VC++) benefit significantly from using this. We've measured 3-4% build speed improvements in apps as a result.
  6. #endif
  7. #ifndef EATHREAD_CALLSTACK_APPLE_H
  8. #define EATHREAD_CALLSTACK_APPLE_H
  9. #include <eathread/eathread_callstack.h>
  10. namespace EA
  11. {
  12. namespace Thread
  13. {
  14. /// ModuleInfoApple
  15. ///
  16. /// This struct is based on the EACallstack ModuleInfo struct, but that can't be used here because
  17. /// this package is a lower level package than EACallstack.
  18. ///
  19. struct ModuleInfoApple
  20. {
  21. char8_t mPath[256]; /// File name or file path
  22. char8_t mName[256]; /// Module name. Usually the same as the file name without the extension.
  23. uint64_t mBaseAddress; /// Base address in memory.
  24. uint64_t mSize; /// Module size in memory.
  25. char mType[32]; /// The type field (e.g. __TEXT) from the vmmap output.
  26. char mPermissions[16]; /// The permissions "r--/rwx" kind of string from the vmmap output.
  27. };
  28. #if EATHREAD_APPLE_GETMODULEINFO_ENABLED
  29. /// GetModuleInfoApple
  30. ///
  31. /// This function exists for the purpose of being a central module/VM map info collecting function,
  32. /// used by a couple functions within this package.
  33. /// Writes as many entries as possible to the user-supplied array, up to the capacity of the array.
  34. /// Returns the required number of entries, which may be more than the user-supplied capacity in the
  35. /// case that the user didn't supply enough.
  36. ///
  37. size_t GetModuleInfoApple(ModuleInfoApple* pModuleInfoAppleArray, size_t moduleInfoAppleArrayCapacity,
  38. const char* pTypeFilter = NULL, bool bEnableCache = true);
  39. #endif
  40. } // namespace Callstack
  41. } // namespace EA
  42. #endif // Header include guard