@@ -332,6 +332,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in
332
332
}
333
333
}
334
334
if printing {
335
+ // assume skip=0 for printing
335
336
if (flags & _TraceRuntimeFrames ) != 0 || showframe (f , gp , nprint == 0 ) {
336
337
// Print during crash.
337
338
// main(0x1, 0x2, 0x3)
@@ -341,6 +342,21 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in
341
342
if (n > 0 || flags & _TraceTrap == 0 ) && frame .pc > f .entry && ! waspanic {
342
343
tracepc --
343
344
}
345
+ file , line := funcline (f , tracepc )
346
+ inldata := funcdata (f , _FUNCDATA_InlTree )
347
+ if inldata != nil {
348
+ inltree := (* [1 << 20 ]inlinedCall )(inldata )
349
+ ix := pcdatavalue (f , _PCDATA_InlTreeIndex , tracepc , nil )
350
+ for ix != - 1 {
351
+ name := funcnameFromNameoff (f , inltree [ix ].func_ )
352
+ print (name , "(...)\n " )
353
+ print ("\t " , file , ":" , line , "\n " )
354
+
355
+ file = funcfile (f , inltree [ix ].file )
356
+ line = inltree [ix ].line
357
+ ix = inltree [ix ].parent
358
+ }
359
+ }
344
360
name := funcname (f )
345
361
if name == "runtime.gopanic" {
346
362
name = "panic"
@@ -358,7 +374,6 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in
358
374
print (hex (argp [i ]))
359
375
}
360
376
print (")\n " )
361
- file , line := funcline (f , tracepc )
362
377
print ("\t " , file , ":" , line )
363
378
if frame .pc > f .entry {
364
379
print (" +" , hex (frame .pc - f .entry ))
0 commit comments