2019-08-23 11:56:54 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "BeefySysLib/Common.h"
|
|
|
|
#include "BeefySysLib/util/Hash.h"
|
|
|
|
#include "Compiler/BfUtil.h"
|
|
|
|
#include "DebugCommon.h"
|
|
|
|
#include "extern/toml/toml.h"
|
|
|
|
|
|
|
|
NS_BF_BEGIN
|
|
|
|
|
|
|
|
class DebugVisualizerEntry
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
class ExpandItem
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
String mName;
|
|
|
|
String mValue;
|
|
|
|
String mCondition;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DisplayStringEntry
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
String mCondition;
|
|
|
|
String mString;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum CollectionType
|
|
|
|
{
|
|
|
|
CollectionType_None,
|
|
|
|
CollectionType_Array,
|
|
|
|
CollectionType_IndexItems,
|
|
|
|
CollectionType_TreeItems,
|
|
|
|
CollectionType_LinkedList,
|
|
|
|
CollectionType_Delegate,
|
|
|
|
CollectionType_Dictionary,
|
2022-05-30 15:43:49 -07:00
|
|
|
CollectionType_ExpandedItem,
|
|
|
|
CollectionType_CallStackList
|
2019-08-23 11:56:54 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
|
|
|
String mName;
|
|
|
|
DbgFlavor mFlavor;
|
|
|
|
OwnedVector<DisplayStringEntry> mDisplayStrings;
|
|
|
|
OwnedVector<DisplayStringEntry> mStringViews;
|
|
|
|
String mAction;
|
|
|
|
|
|
|
|
OwnedVector<ExpandItem> mExpandItems;
|
|
|
|
CollectionType mCollectionType;
|
2022-07-26 13:27:03 -04:00
|
|
|
|
2019-08-23 11:56:54 -07:00
|
|
|
String mSize;
|
|
|
|
Array<String> mLowerDimSizes;
|
|
|
|
String mNextPointer;
|
|
|
|
String mHeadPointer;
|
|
|
|
String mEndPointer;
|
|
|
|
String mLeftPointer;
|
|
|
|
String mRightPointer;
|
|
|
|
String mValueType;
|
|
|
|
String mValuePointer;
|
2022-07-26 13:27:03 -04:00
|
|
|
String mTargetPointer;
|
2019-08-23 11:56:54 -07:00
|
|
|
String mCondition;
|
|
|
|
String mBuckets;
|
|
|
|
String mEntries;
|
2022-07-26 13:27:03 -04:00
|
|
|
String mKey;
|
2019-08-23 11:56:54 -07:00
|
|
|
bool mShowedError;
|
|
|
|
bool mShowElementAddrs;
|
|
|
|
|
|
|
|
String mDynValueType;
|
|
|
|
String mDynValueTypeIdAppend;
|
|
|
|
|
|
|
|
public:
|
|
|
|
DebugVisualizerEntry()
|
|
|
|
{
|
|
|
|
mFlavor = DbgFlavor_Unknown;
|
|
|
|
mCollectionType = CollectionType_None;
|
|
|
|
mShowedError = false;
|
|
|
|
mShowElementAddrs = false;
|
2022-07-26 13:27:03 -04:00
|
|
|
}
|
2019-08-23 11:56:54 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
class DebugVisualizers
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Val128 mHash;
|
|
|
|
String mErrorString;
|
|
|
|
String mCurFileName;
|
|
|
|
const char* mSrcStr;
|
|
|
|
OwnedVector<DebugVisualizerEntry> mDebugVisualizers;
|
2022-07-26 13:27:03 -04:00
|
|
|
|
2019-08-23 11:56:54 -07:00
|
|
|
void Fail(const StringImpl& error);
|
2022-07-26 13:27:03 -04:00
|
|
|
void Fail(const StringImpl& error, const toml::Value& value);
|
2019-08-23 11:56:54 -07:00
|
|
|
|
|
|
|
String ExpectString(const toml::Value& value);
|
|
|
|
bool ExpectBool(const toml::Value& value);
|
|
|
|
const toml::Table& ExpectTable(const toml::Value& value);
|
|
|
|
const toml::Array& ExpectArray(const toml::Value& value);
|
|
|
|
|
|
|
|
public:
|
|
|
|
DebugVisualizers();
|
|
|
|
|
|
|
|
bool ReadFileTOML(const StringImpl& fileName);
|
|
|
|
bool Load(const StringImpl& fileNamesStr);
|
|
|
|
DebugVisualizerEntry* FindEntryForType(const StringImpl& typeName, DbgFlavor wantFlavor, Array<String>* wildcardCaptures);
|
|
|
|
|
|
|
|
String DoStringReplace(const StringImpl& origStr, const Array<String>& wildcardCaptures);
|
|
|
|
};
|
|
|
|
|
|
|
|
NS_BF_END
|