Skip to content

Commit 634a63c

Browse files
Handle exception when generating string for stack frame.
1 parent 2e6dbce commit 634a63c

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

DbgProvider/public/Debugger/DbgStackFrameInfo.cs

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,14 @@ public string SymbolName
118118
{
119119
get
120120
{
121-
if( null == Function )
121+
if( null != Function )
122122
{
123-
return DbgProvider.FormatAddress( InstructionPointer,
124-
Debugger.TargetIs32Bit,
125-
useTick: true );
123+
return Function.ModuleQualifiedName;
126124
}
127-
return Function.ModuleQualifiedName;
125+
126+
return DbgProvider.FormatAddress( InstructionPointer,
127+
Debugger.TargetIs32Bit,
128+
useTick: true );
128129
}
129130
} // end property SymbolName
130131

@@ -326,10 +327,21 @@ public override string ToString()
326327
}
327328
} // end if( !Function )
328329

329-
if( Displacement == 0 )
330-
return SymbolName;
331-
else
332-
return Util.Sprintf( "{0}+0x{1:x}", SymbolName, Displacement );
330+
try
331+
{
332+
if( Displacement == 0 )
333+
return SymbolName;
334+
else
335+
return Util.Sprintf( "{0}+0x{1:x}", SymbolName, Displacement );
336+
}
337+
catch( DbgProviderException dpe )
338+
{
339+
LogManager.Trace( "Could not get symbol name: {0}", Util.GetExceptionMessages( dpe ) );
340+
}
341+
342+
return DbgProvider.FormatAddress( InstructionPointer,
343+
Debugger.TargetIs32Bit,
344+
useTick: true );
333345
} // end ToString()
334346

335347

0 commit comments

Comments
 (0)