Merge remote-tracking branch 'origin/GT-3014_ghizard_Recover_PDB_stack_variables_from_recent_VS'

This commit is contained in:
Ryan Kurtz 2019-07-18 16:30:57 -04:00
commit 233cc48879
2 changed files with 11 additions and 4 deletions

View file

@ -208,12 +208,19 @@ void iterateClasses(PDBApiContext& ctx) {
// This method still leaks memory--seemingly in the pEnum->Next() for
// certain symbol types (e.g., tag == 32 (inline))
void dumpFunctionStackVariables( PDBApiContext& ctx, DWORD rva )
void dumpFunctionStackVariables(IDiaSymbol* symbol, IDiaSession& session )
{
CComPtr<IDiaSymbol> pBlock;
if ( FAILED(ctx.Session().findSymbolByRVA( rva, SymTagBlock, &pBlock ) ) ) {
const DWORD address = getRVA(*symbol);
HRESULT hr = session.findSymbolByRVA( address, SymTagBlock, &pBlock );
if( hr == S_FALSE ) {
pBlock = symbol;
}
else if ( FAILED(hr) ){
fatal( "Failed to find symbols by RVA" );
}
for ( ; pBlock != NULL; ) {
CComPtr<IDiaEnumSymbols> pEnum;
// Local data search
@ -348,7 +355,7 @@ void iterateFunctions(PDBApiContext& ctx) {
printf("%S<function name=\"%S\" address=\"0x%x\" length=\"0x%I64x\">\n", indent(8).c_str(), findMangledName(ctx, *pSymbol).c_str(), address, getLength(*pSymbol));
dumpFunctionStackVariables(ctx, address);
dumpFunctionStackVariables(pSymbol, ctx.Session());
dumpFunctionLines(*pSymbol, ctx.Session());
printf("%S</function>\n", indent(8).c_str());

View file

@ -65,7 +65,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OutputFile>$(TargetPath)</OutputFile>
</Link>