File tree Expand file tree Collapse file tree 1 file changed +21
-11
lines changed
lldb/source/Plugins/Language/Swift Expand file tree Collapse file tree 1 file changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -240,23 +240,33 @@ class SwiftExceptionBreakpointFrameRecognizer : public StackFrameRecognizer {
240
240
if (!thread_sp)
241
241
return {};
242
242
243
- StackFrameSP frame_sp;
244
- StringRef name = m_frame_sp->GetFunctionName ();
245
- if (name == " swift_willThrow" )
246
- frame_sp = thread_sp->GetStackFrameAtIndex (1 );
247
- else if (name == " swift_willThrowTypedImpl" )
248
- frame_sp = thread_sp->GetStackFrameAtIndex (2 );
243
+ StringRef symbol_name;
244
+ {
245
+ SymbolContext sc = m_frame_sp->GetSymbolContext (eSymbolContextSymbol);
246
+ if (!sc.symbol )
247
+ return {};
248
+ symbol_name = sc.symbol ->GetName ();
249
+ }
250
+
251
+ StackFrameSP relevant_frame_sp;
252
+ if (symbol_name == " swift_willThrow" )
253
+ relevant_frame_sp = thread_sp->GetStackFrameAtIndex (1 );
254
+ else if (symbol_name == " swift_willThrowTypedImpl" )
255
+ relevant_frame_sp = thread_sp->GetStackFrameAtIndex (2 );
249
256
else {
250
257
assert (false && " unexpected frame name" );
251
258
return {};
252
259
}
253
260
254
- // Check if source is available for the identified frame.
255
- SymbolContext sc = frame_sp->GetSymbolContext (eSymbolContextCompUnit);
256
- if (!sc.comp_unit )
257
- return {};
261
+ {
262
+ // Check if source is available for the identified frame.
263
+ SymbolContext sc =
264
+ relevant_frame_sp->GetSymbolContext (eSymbolContextSymbol);
265
+ if (!sc.comp_unit )
266
+ return {};
267
+ }
258
268
259
- return frame_sp ;
269
+ return relevant_frame_sp ;
260
270
}
261
271
262
272
private:
You can’t perform that action at this time.
0 commit comments