diff options
| author | Tannin <devnull@localhost> | 2014-12-20 14:45:08 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2014-12-20 14:45:08 +0100 |
| commit | 7bfb48d6abb248d9739281ae46f8e9f52fcd16e3 (patch) | |
| tree | d9e954d5a0bbad8559e2ddefd6ec018d4e59c1f2 /src/shared/stackdata.h | |
| parent | 88817c7f3b259550741c5e203fb28f7f705ce30c (diff) | |
cleanup
Diffstat (limited to 'src/shared/stackdata.h')
| -rw-r--r-- | src/shared/stackdata.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/shared/stackdata.h b/src/shared/stackdata.h new file mode 100644 index 00000000..7151699c --- /dev/null +++ b/src/shared/stackdata.h @@ -0,0 +1,50 @@ +#ifndef STACKDATA_H
+#define STACKDATA_H
+
+
+#include <string>
+#include <Windows.h>
+
+
+namespace MOShared {
+
+
+class StackData {
+ friend bool operator==(const StackData &LHS, const StackData &RHS);
+ friend bool operator<(const StackData &LHS, const StackData &RHS);
+public:
+
+ StackData();
+ StackData(const char *function, int line);
+
+ std::string toString() const;
+
+private:
+
+ void load_modules(HANDLE process, DWORD processID);
+
+ void initTrace();
+
+private:
+
+ static const int FRAMES_TO_SKIP = 1;
+ static const int FRAMES_TO_CAPTURE = 20;
+
+private:
+
+ LPVOID m_Stack[FRAMES_TO_CAPTURE];
+ USHORT m_Count;
+ std::string m_Function;
+ int m_Line;
+
+};
+
+
+bool operator==(const StackData &LHS, const StackData &RHS);
+
+bool operator<(const StackData &LHS, const StackData &RHS);
+
+} // namespace MOShared
+
+
+#endif // STACKDATA_H
|
