зеркало из https://github.com/microsoft/DbgShell.git
Detect and display 'stripped' PDB symbol type.
This commit is contained in:
Родитель
895b202977
Коммит
9b0c0c0a99
|
@ -3764,6 +3764,32 @@ namespace MS.Dbg
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public static IMAGEHLP_MODULEW64 GetModuleInfo( WDebugClient debugClient,
|
||||
ulong address )
|
||||
{
|
||||
return DbgEngDebugger._GlobalDebugger.ExecuteOnDbgEngThread( () =>
|
||||
{
|
||||
return GetModuleInfo_naked( debugClient, address );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
private static unsafe IMAGEHLP_MODULEW64 GetModuleInfo_naked( WDebugClient debugClient, ulong address )
|
||||
{
|
||||
IntPtr hProcess = _GetHProcForDebugClient( debugClient );
|
||||
|
||||
IMAGEHLP_MODULEW64 modInfo = new IMAGEHLP_MODULEW64();
|
||||
modInfo.SizeOfStruct = (uint) Marshal.SizeOf( modInfo );
|
||||
|
||||
bool itWorked = NativeMethods.SymGetModuleInfo64( hProcess, address, &modInfo );
|
||||
|
||||
if( !itWorked )
|
||||
throw new DbgEngException( Marshal.GetLastWin32Error() );
|
||||
|
||||
return modInfo;
|
||||
} // end GetModuleInfo_naked()
|
||||
} // end class DbgHelp
|
||||
|
||||
|
||||
|
|
|
@ -570,8 +570,23 @@ namespace MS.Dbg
|
|||
{ DEBUG_SYMTYPE.SYM, new ColorString( "('sym' symbols)" ) .MakeReadOnly() },
|
||||
};
|
||||
|
||||
private static readonly ColorString s_strippedPdbStatusString = new ColorString( ConsoleColor.DarkGreen, "(pdb " )
|
||||
.AppendFg( ConsoleColor.DarkYellow ).Append( "(stripped)" )
|
||||
.AppendFg( ConsoleColor.DarkGreen ).Append( ")" )
|
||||
.MakeReadOnly();
|
||||
|
||||
private ColorString _GetSymbolTypeString()
|
||||
{
|
||||
if( SymbolType == DEBUG_SYMTYPE.PDB )
|
||||
{
|
||||
var modInfo = DbgHelp.GetModuleInfo( Debugger.DebuggerInterface, BaseAddress );
|
||||
if( modInfo.GlobalSymbols == 0 )
|
||||
{
|
||||
// Looks like a "stripped" PDB.
|
||||
return s_strippedPdbStatusString;
|
||||
}
|
||||
}
|
||||
|
||||
ColorString cs;
|
||||
if( !sm_symStatusStrings.TryGetValue( SymbolType, out cs ) )
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче