Initial
This commit is contained in:
commit
d4c558a59a
34 changed files with 3850 additions and 0 deletions
43
private/StackTrace.hpp
Normal file
43
private/StackTrace.hpp
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#pragma once
|
||||
|
||||
#include "common.h"
|
||||
|
||||
namespace tp {
|
||||
|
||||
struct CallStackSnapshots {
|
||||
|
||||
typedef alni FramePointer;
|
||||
typedef FramePointer* StackShapshot; // NULL Terminated Frames
|
||||
|
||||
StackShapshot capture();
|
||||
|
||||
void saveToFile(StackShapshot* snapshots, const char* filepath);
|
||||
StackShapshot* loadFromFile(const char* filepath);
|
||||
|
||||
private:
|
||||
|
||||
struct SnapshotsDict {
|
||||
SnapshotsDict();
|
||||
StackShapshot newStackSnapshot(ualni aDepth);
|
||||
void put(StackShapshot aPtr);
|
||||
StackShapshot getSlot(ualni aIdx);
|
||||
alni presents(StackShapshot aPtr);
|
||||
~SnapshotsDict();
|
||||
|
||||
private:
|
||||
StackShapshot* mTable = NULL;
|
||||
uhalni mSize = 512;
|
||||
uhalni mEntries = 0;
|
||||
|
||||
ualni hash(StackShapshot snapshot);
|
||||
bool compare(StackShapshot left, StackShapshot right);
|
||||
alni findSlotRead(StackShapshot key);
|
||||
ualni findSlotWrite(StackShapshot key);
|
||||
void resize();
|
||||
} mSnapshots;
|
||||
|
||||
StackShapshot getStack(ualni& len);
|
||||
};
|
||||
|
||||
extern CallStackSnapshots gCallStackSnapshots;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue