mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Working around undocumented 0x1609 leaf type (and others)
This commit is contained in:
parent
bcc8389ae8
commit
a67a964142
2 changed files with 31 additions and 21 deletions
|
@ -1410,7 +1410,7 @@ DbgType* COFF::CvParseType(int tagIdx, bool ipi)
|
||||||
dbgType->mTypeName = name;
|
dbgType->mTypeName = name;
|
||||||
//SplitName(dbgType->mName, dbgType->mTypeName, dbgType->mTemplateParams);
|
//SplitName(dbgType->mName, dbgType->mTypeName, dbgType->mTemplateParams);
|
||||||
dbgType->mTypeCode = DbgType_Enum;
|
dbgType->mTypeCode = DbgType_Enum;
|
||||||
dbgType->mTypeParam = CvGetType(underlyingType);
|
dbgType->mTypeParam = CvGetTypeSafe(underlyingType);
|
||||||
dbgType->mIsIncomplete = true;
|
dbgType->mIsIncomplete = true;
|
||||||
|
|
||||||
if (dbgType->mTypeParam->GetByteCount() == 0)
|
if (dbgType->mTypeParam->GetByteCount() == 0)
|
||||||
|
@ -1448,7 +1448,7 @@ DbgType* COFF::CvParseType(int tagIdx, bool ipi)
|
||||||
|
|
||||||
DbgBitfieldType* bitfieldType = mAlloc.Alloc<DbgBitfieldType>();
|
DbgBitfieldType* bitfieldType = mAlloc.Alloc<DbgBitfieldType>();
|
||||||
dbgType = bitfieldType;
|
dbgType = bitfieldType;
|
||||||
dbgType->mTypeParam = CvGetType(bitfield.type);
|
dbgType->mTypeParam = CvGetTypeSafe(bitfield.type);
|
||||||
dbgType->mTypeCode = DbgType_Bitfield;
|
dbgType->mTypeCode = DbgType_Bitfield;
|
||||||
//bitfieldType->mPosition = (dbgType->mTypeParam->mSize * 8) - bitfield.position - bitfield.length;
|
//bitfieldType->mPosition = (dbgType->mTypeParam->mSize * 8) - bitfield.position - bitfield.length;
|
||||||
bitfieldType->mPosition = bitfield.position;
|
bitfieldType->mPosition = bitfield.position;
|
||||||
|
@ -1531,7 +1531,7 @@ DbgType* COFF::CvParseType(int tagIdx, bool ipi)
|
||||||
DbgType* baseType = NULL;
|
DbgType* baseType = NULL;
|
||||||
if (classInfo.derived != 0)
|
if (classInfo.derived != 0)
|
||||||
{
|
{
|
||||||
baseType = CvGetType(classInfo.derived);
|
baseType = CvGetTypeSafe(classInfo.derived);
|
||||||
BP_ALLOC_T(DbgBaseTypeEntry);
|
BP_ALLOC_T(DbgBaseTypeEntry);
|
||||||
DbgBaseTypeEntry* baseTypeEntry = mAlloc.Alloc<DbgBaseTypeEntry>();
|
DbgBaseTypeEntry* baseTypeEntry = mAlloc.Alloc<DbgBaseTypeEntry>();
|
||||||
baseTypeEntry->mBaseType = baseType;
|
baseTypeEntry->mBaseType = baseType;
|
||||||
|
@ -1560,7 +1560,7 @@ DbgType* COFF::CvParseType(int tagIdx, bool ipi)
|
||||||
|
|
||||||
if (classInfo.vshape != 0)
|
if (classInfo.vshape != 0)
|
||||||
{
|
{
|
||||||
CvGetType(classInfo.vshape);
|
CvGetTypeSafe(classInfo.vshape);
|
||||||
dbgType->mHasVTable = true;
|
dbgType->mHasVTable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1598,7 +1598,7 @@ DbgType* COFF::CvParseType(int tagIdx, bool ipi)
|
||||||
case LF_MODIFIER:
|
case LF_MODIFIER:
|
||||||
{
|
{
|
||||||
lfModifier& modifier = *(lfModifier*)dataStart;
|
lfModifier& modifier = *(lfModifier*)dataStart;
|
||||||
DbgType* outerType = CvGetType(modifier.type);
|
DbgType* outerType = CvGetTypeSafe(modifier.type);
|
||||||
dbgType = outerType;
|
dbgType = outerType;
|
||||||
|
|
||||||
if (modifier.attr.MOD_const)
|
if (modifier.attr.MOD_const)
|
||||||
|
@ -1672,10 +1672,10 @@ DbgType* COFF::CvParseType(int tagIdx, bool ipi)
|
||||||
{
|
{
|
||||||
lfArray* array = (lfArray*)dataStart;
|
lfArray* array = (lfArray*)dataStart;
|
||||||
|
|
||||||
DbgType* indexType = CvGetType(array->idxtype);
|
DbgType* indexType = CvGetTypeSafe(array->idxtype);
|
||||||
|
|
||||||
dbgType = CvCreateType();
|
dbgType = CvCreateType();
|
||||||
dbgType->mTypeParam = CvGetType(array->elemtype);
|
dbgType->mTypeParam = CvGetTypeSafe(array->elemtype);
|
||||||
dbgType->mTypeCode = DbgType_SizedArray;
|
dbgType->mTypeCode = DbgType_SizedArray;
|
||||||
dbgType->mLanguage = dbgType->mTypeParam->mLanguage;
|
dbgType->mLanguage = dbgType->mTypeParam->mLanguage;
|
||||||
data = (uint8*)&array->data;
|
data = (uint8*)&array->data;
|
||||||
|
@ -1698,7 +1698,7 @@ DbgType* COFF::CvParseType(int tagIdx, bool ipi)
|
||||||
lfProc* proc = (lfProc*)dataStart;
|
lfProc* proc = (lfProc*)dataStart;
|
||||||
|
|
||||||
dbgType->mTypeCode = DbgType_Subroutine;
|
dbgType->mTypeCode = DbgType_Subroutine;
|
||||||
dbgType->mTypeParam = CvGetType(proc->rvtype);
|
dbgType->mTypeParam = CvGetTypeSafe(proc->rvtype);
|
||||||
BP_ALLOC_T(DbgBlock);
|
BP_ALLOC_T(DbgBlock);
|
||||||
dbgType->mBlockParam = mAlloc.Alloc<DbgBlock>();
|
dbgType->mBlockParam = mAlloc.Alloc<DbgBlock>();
|
||||||
|
|
||||||
|
@ -1714,7 +1714,7 @@ DbgType* COFF::CvParseType(int tagIdx, bool ipi)
|
||||||
BP_ALLOC_T(DbgVariable);
|
BP_ALLOC_T(DbgVariable);
|
||||||
DbgVariable* arg = mAlloc.Alloc<DbgVariable>();
|
DbgVariable* arg = mAlloc.Alloc<DbgVariable>();
|
||||||
arg->mIsParam = true;
|
arg->mIsParam = true;
|
||||||
arg->mType = CvGetType(argTypes[paramIdx]);
|
arg->mType = CvGetTypeSafe(argTypes[paramIdx]);
|
||||||
arg->mName = "$arg";
|
arg->mName = "$arg";
|
||||||
dbgType->mBlockParam->mVariables.PushBack(arg);
|
dbgType->mBlockParam->mVariables.PushBack(arg);
|
||||||
}
|
}
|
||||||
|
@ -1729,7 +1729,7 @@ DbgType* COFF::CvParseType(int tagIdx, bool ipi)
|
||||||
lfMFunc* proc = (lfMFunc*)dataStart;
|
lfMFunc* proc = (lfMFunc*)dataStart;
|
||||||
|
|
||||||
dbgType->mTypeCode = DbgType_Subroutine;
|
dbgType->mTypeCode = DbgType_Subroutine;
|
||||||
dbgType->mTypeParam = CvGetType(proc->rvtype);
|
dbgType->mTypeParam = CvGetTypeSafe(proc->rvtype);
|
||||||
BP_ALLOC_T(DbgBlock);
|
BP_ALLOC_T(DbgBlock);
|
||||||
dbgType->mBlockParam = mAlloc.Alloc<DbgBlock>();
|
dbgType->mBlockParam = mAlloc.Alloc<DbgBlock>();
|
||||||
|
|
||||||
|
@ -1745,7 +1745,7 @@ DbgType* COFF::CvParseType(int tagIdx, bool ipi)
|
||||||
BP_ALLOC_T(DbgVariable);
|
BP_ALLOC_T(DbgVariable);
|
||||||
DbgVariable* arg = mAlloc.Alloc<DbgVariable>();
|
DbgVariable* arg = mAlloc.Alloc<DbgVariable>();
|
||||||
arg->mIsParam = true;
|
arg->mIsParam = true;
|
||||||
arg->mType = CvGetType(argTypes[paramIdx]);
|
arg->mType = CvGetTypeSafe(argTypes[paramIdx]);
|
||||||
arg->mName = "$arg";
|
arg->mName = "$arg";
|
||||||
dbgType->mBlockParam->mVariables.PushBack(arg);
|
dbgType->mBlockParam->mVariables.PushBack(arg);
|
||||||
}
|
}
|
||||||
|
@ -2328,7 +2328,7 @@ void COFF::ParseCompileUnit_Symbols(DbgCompileUnit* compileUnit, uint8* sectionD
|
||||||
|
|
||||||
DbgType* typeDefType = CvCreateType();
|
DbgType* typeDefType = CvCreateType();
|
||||||
typeDefType->mTypeCode = DbgType_TypeDef;
|
typeDefType->mTypeCode = DbgType_TypeDef;
|
||||||
typeDefType->mTypeParam = CvGetType(udtSym.typind);
|
typeDefType->mTypeParam = CvGetTypeSafe(udtSym.typind);
|
||||||
typeDefType->mName = DbgDupString((const char*)udtSym.name, "DbgDupString.S_UDT");
|
typeDefType->mName = DbgDupString((const char*)udtSym.name, "DbgDupString.S_UDT");
|
||||||
if (strncmp(typeDefType->mName, "_bf::", 5) == 0)
|
if (strncmp(typeDefType->mName, "_bf::", 5) == 0)
|
||||||
{
|
{
|
||||||
|
@ -2355,7 +2355,7 @@ void COFF::ParseCompileUnit_Symbols(DbgCompileUnit* compileUnit, uint8* sectionD
|
||||||
BP_ALLOC_T(DbgVariable);
|
BP_ALLOC_T(DbgVariable);
|
||||||
DbgVariable* constVar = mAlloc.Alloc<DbgVariable>();
|
DbgVariable* constVar = mAlloc.Alloc<DbgVariable>();
|
||||||
constVar->mName = DbgDupString((const char*)constSym.name, "DbgDupString.S_CONSTANT");
|
constVar->mName = DbgDupString((const char*)constSym.name, "DbgDupString.S_CONSTANT");
|
||||||
constVar->mType = CvGetType(constSym.typind);
|
constVar->mType = CvGetTypeSafe(constSym.typind);
|
||||||
constVar->mIsConst = true;
|
constVar->mIsConst = true;
|
||||||
constVar->mIsStatic = true;
|
constVar->mIsStatic = true;
|
||||||
constVar->mConstValue = constSym.value;
|
constVar->mConstValue = constSym.value;
|
||||||
|
@ -2414,7 +2414,7 @@ void COFF::ParseCompileUnit_Symbols(DbgCompileUnit* compileUnit, uint8* sectionD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DbgType* dbgType = CvGetType(dataSym.typind);
|
DbgType* dbgType = CvGetTypeSafe(dataSym.typind);
|
||||||
|
|
||||||
BP_ALLOC_T(DbgVariable);
|
BP_ALLOC_T(DbgVariable);
|
||||||
DbgVariable* variable = mAlloc.Alloc<DbgVariable>();
|
DbgVariable* variable = mAlloc.Alloc<DbgVariable>();
|
||||||
|
@ -2482,7 +2482,7 @@ void COFF::ParseCompileUnit_Symbols(DbgCompileUnit* compileUnit, uint8* sectionD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DbgType* dbgType = CvGetType(dataSym.typind);
|
DbgType* dbgType = CvGetTypeSafe(dataSym.typind);
|
||||||
|
|
||||||
BP_ALLOC_T(DbgVariable);
|
BP_ALLOC_T(DbgVariable);
|
||||||
DbgVariable* variable = mAlloc.Alloc<DbgVariable>();
|
DbgVariable* variable = mAlloc.Alloc<DbgVariable>();
|
||||||
|
@ -2697,7 +2697,7 @@ void COFF::ParseCompileUnit_Symbols(DbgCompileUnit* compileUnit, uint8* sectionD
|
||||||
BPRELSYM32* bpRel32 = (BPRELSYM32*)dataStart;
|
BPRELSYM32* bpRel32 = (BPRELSYM32*)dataStart;
|
||||||
|
|
||||||
const char* name = DbgDupString((const char*)bpRel32->name, "DbgDupString.S_BPREL32");
|
const char* name = DbgDupString((const char*)bpRel32->name, "DbgDupString.S_BPREL32");
|
||||||
DbgType* varType = CvGetType(bpRel32->typind);
|
DbgType* varType = CvGetTypeSafe(bpRel32->typind);
|
||||||
|
|
||||||
_NextUnrangedLocalVar(name, varType);
|
_NextUnrangedLocalVar(name, varType);
|
||||||
|
|
||||||
|
@ -2715,7 +2715,7 @@ void COFF::ParseCompileUnit_Symbols(DbgCompileUnit* compileUnit, uint8* sectionD
|
||||||
break;
|
break;
|
||||||
REGSYM* regSym = (REGSYM*)dataStart;
|
REGSYM* regSym = (REGSYM*)dataStart;
|
||||||
const char* name = DbgDupString((const char*)regSym->name);
|
const char* name = DbgDupString((const char*)regSym->name);
|
||||||
DbgType* varType = CvGetType(regSym->typind);
|
DbgType* varType = CvGetTypeSafe(regSym->typind);
|
||||||
|
|
||||||
_NextUnrangedLocalVar(name, varType);
|
_NextUnrangedLocalVar(name, varType);
|
||||||
|
|
||||||
|
@ -2733,7 +2733,7 @@ void COFF::ParseCompileUnit_Symbols(DbgCompileUnit* compileUnit, uint8* sectionD
|
||||||
break;
|
break;
|
||||||
REGREL32* regRel32 = (REGREL32*)dataStart;
|
REGREL32* regRel32 = (REGREL32*)dataStart;
|
||||||
const char* name = DbgDupString((const char*)regRel32->name);
|
const char* name = DbgDupString((const char*)regRel32->name);
|
||||||
DbgType* varType = CvGetType(regRel32->typind);
|
DbgType* varType = CvGetTypeSafe(regRel32->typind);
|
||||||
|
|
||||||
_NextUnrangedLocalVar(name, varType);
|
_NextUnrangedLocalVar(name, varType);
|
||||||
|
|
||||||
|
@ -7066,12 +7066,14 @@ NS_BF_DBG_BEGIN
|
||||||
// delete debugTarget;
|
// delete debugTarget;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
void TestPDB(const String& fileName)
|
void TestPDB(const StringImpl& fileName, WinDebugger* debugger)
|
||||||
{
|
{
|
||||||
DebugTarget* debugTarget = new DebugTarget(NULL);
|
DebugTarget* debugTarget = new DebugTarget(NULL);
|
||||||
COFF coff(debugTarget);
|
COFF coff(debugTarget);
|
||||||
|
coff.mDebugger = debugger;
|
||||||
uint8 wantGuid[16];
|
uint8 wantGuid[16];
|
||||||
coff.LoadPDB(fileName, wantGuid, -1);
|
coff.LoadPDB(fileName, wantGuid, -1);
|
||||||
|
coff.ParseTypeData();
|
||||||
coff.CvParseIPI();
|
coff.CvParseIPI();
|
||||||
coff.ParseGlobalsData();
|
coff.ParseGlobalsData();
|
||||||
coff.ParseSymbolData();
|
coff.ParseSymbolData();
|
||||||
|
|
|
@ -621,6 +621,12 @@ void SleepTest()
|
||||||
|
|
||||||
void WdAllocTest();
|
void WdAllocTest();
|
||||||
|
|
||||||
|
namespace BeefyDbg64
|
||||||
|
{
|
||||||
|
class WinDebugger;
|
||||||
|
void TestPDB(const StringImpl& fileName, WinDebugger* debugger);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef BF_PLATFORM_WINDOWS
|
#ifdef BF_PLATFORM_WINDOWS
|
||||||
static _CrtMemState gStartMemCheckpoint;
|
static _CrtMemState gStartMemCheckpoint;
|
||||||
#endif
|
#endif
|
||||||
|
@ -653,6 +659,8 @@ BF_EXPORT void BF_CALLTYPE Debugger_Create()
|
||||||
#ifdef BF_PLATFORM_WINDOWS
|
#ifdef BF_PLATFORM_WINDOWS
|
||||||
::AllowSetForegroundWindow(ASFW_ANY);
|
::AllowSetForegroundWindow(ASFW_ANY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//BeefyDbg64::TestPDB("c:\\temp\\dedkeni.pdb", (BeefyDbg64::WinDebugger*)gDebugManager->mDebugger64);
|
||||||
}
|
}
|
||||||
|
|
||||||
BF_EXPORT void BF_CALLTYPE Debugger_SetCallbacks(void* callback)
|
BF_EXPORT void BF_CALLTYPE Debugger_SetCallbacks(void* callback)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue