File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -54,20 +54,31 @@ struct SymbolizeCodeContext {
54
54
};
55
55
56
56
SymbolizedStack *SymbolizeCode (uptr addr) {
57
- SymbolizedStack *s = SymbolizedStack::New (addr);
58
- SymbolizeCodeContext cbctx;
59
- internal_memset (&cbctx, 0 , sizeof (cbctx));
60
- cbctx.pc = addr;
61
- go_runtime_cb (CallbackSymbolizeCode, &cbctx);
62
- if (cbctx.res ) {
57
+ SymbolizedStack *first = SymbolizedStack::New (addr);
58
+ SymbolizedStack *s = first;
59
+ for (;;) {
60
+ SymbolizeCodeContext cbctx;
61
+ internal_memset (&cbctx, 0 , sizeof (cbctx));
62
+ cbctx.pc = addr;
63
+ go_runtime_cb (CallbackSymbolizeCode, &cbctx);
64
+ if (cbctx.res == 0 )
65
+ break ;
63
66
AddressInfo &info = s->info ;
64
67
info.module_offset = cbctx.off ;
65
68
info.function = internal_strdup (cbctx.func ? cbctx.func : " ??" );
66
69
info.file = internal_strdup (cbctx.file ? cbctx.file : " -" );
67
70
info.line = cbctx.line ;
68
71
info.column = 0 ;
72
+
73
+ if (cbctx.pc == addr) // outermost (non-inlined) function
74
+ break ;
75
+ addr = cbctx.pc ;
76
+ // Allocate a stack entry for the parent of the inlined function.
77
+ SymbolizedStack *s2 = SymbolizedStack::New (addr);
78
+ s->next = s2;
79
+ s = s2;
69
80
}
70
- return s ;
81
+ return first ;
71
82
}
72
83
73
84
struct SymbolizeDataContext {
You can’t perform that action at this time.
0 commit comments