File tree 1 file changed +20
-7
lines changed 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -54,20 +54,33 @@ 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
+ while (true ) {
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 ;
66
+ }
63
67
AddressInfo &info = s->info ;
64
68
info.module_offset = cbctx.off ;
65
69
info.function = internal_strdup (cbctx.func ? cbctx.func : " ??" );
66
70
info.file = internal_strdup (cbctx.file ? cbctx.file : " -" );
67
71
info.line = cbctx.line ;
68
72
info.column = 0 ;
73
+
74
+ if (cbctx.pc == addr) { // outermost (non-inlined) function
75
+ break ;
76
+ }
77
+ addr = cbctx.pc ;
78
+ // Allocate a stack entry for the parent of the inlined function.
79
+ SymbolizedStack *s2 = SymbolizedStack::New (addr);
80
+ s->next = s2;
81
+ s = s2;
69
82
}
70
- return s ;
83
+ return first ;
71
84
}
72
85
73
86
struct SymbolizeDataContext {
You can’t perform that action at this time.
0 commit comments