@@ -334,14 +334,29 @@ static void DumpStackFrame(intptr_t frame_index, uword pc) {
334
334
uintptr_t start = 0 ;
335
335
char * native_symbol_name =
336
336
NativeSymbolResolver::LookupSymbolName (pc, &start);
337
- if (native_symbol_name == NULL ) {
338
- OS::PrintErr (" Frame[%" Pd " ] = `unknown symbol` [0x%" Px " ]\n " ,
339
- frame_index, pc);
340
- } else {
341
- OS::PrintErr (" Frame[%" Pd " ] = `%s` [0x%" Px " ]\n " ,
342
- frame_index, native_symbol_name, pc);
337
+ if (native_symbol_name != NULL ) {
338
+ OS::PrintErr (" %" Pp " [native] %s\n " , pc, native_symbol_name);
343
339
NativeSymbolResolver::FreeSymbolName (native_symbol_name);
340
+ return ;
341
+ }
342
+
343
+ Code& code = Code::Handle (Code::LookupCodeInVmIsolate (pc));
344
+ if (code.IsNull ()) {
345
+ code = Code::LookupCode (pc); // In current isolate.
346
+ }
347
+ if (code.IsNull ()) {
348
+ OS::PrintErr (" %" Pp " [unknown]\n " , pc);
349
+ return ;
350
+ }
351
+
352
+ const Object& owner = Object::Handle (code.owner ());
353
+ if (owner.IsFunction ()) {
354
+ OS::PrintErr (" %" Pp " [dart] %s\n " , pc,
355
+ Function::Cast (owner).ToFullyQualifiedCString ());
356
+ return ;
344
357
}
358
+
359
+ OS::PrintErr (" %" Pp " [stub] %s\n " , pc, code.ToCString ());
345
360
}
346
361
347
362
@@ -350,10 +365,17 @@ static void DumpStackFrame(intptr_t frame_index,
350
365
const Code& code) {
351
366
if (code.IsNull ()) {
352
367
DumpStackFrame (frame_index, pc);
353
- } else {
354
- OS::PrintErr (" Frame[%" Pd " ] = Dart:`%s` [0x%" Px " ]\n " ,
355
- frame_index, code.ToCString (), pc);
368
+ return ;
356
369
}
370
+
371
+ const Object& owner = Object::Handle (code.owner ());
372
+ if (owner.IsFunction ()) {
373
+ OS::PrintErr (" %" Pp " [dart] %s\n " , pc,
374
+ Function::Cast (owner).ToFullyQualifiedCString ());
375
+ return ;
376
+ }
377
+
378
+ OS::PrintErr (" %" Pp " [stub] %s\n " , pc, code.ToCString ());
357
379
}
358
380
359
381
0 commit comments