@@ -3559,6 +3559,7 @@ func pickInjectionPoint(
35593559 PC : ranges [0 ][0 ],
35603560 Frameless : frameless ,
35613561 HasAssociatedReturn : false ,
3562+ NoReturnReason : ir .NoReturnReasonInlined ,
35623563 })
35633564 } else {
35643565 call , err := pickCallInjectionPoint (arch , addr , frameless , lines )
@@ -3580,21 +3581,30 @@ func pickInjectionPoint(
35803581 return buf , nil , issue , nil
35813582 }
35823583
3583- // Add a workaround for the fact that single-instruction functions
3584- // would have the same entry and exit probes, but the ordering between
3585- // them would not be well-defined, so in this extremely uncommon case
3586- // the user doesn't get to see the return probe. It's okay because
3587- // there literally cannot be a return value.
3588- hasAssociatedReturn := ! skipReturnEvents
3589- if len (returnLocations ) == 1 && returnLocations [0 ].PC == call .pc {
3584+ var hasAssociatedReturn bool
3585+ var noReturnReason ir.NoReturnReason
3586+ if skipReturnEvents {
35903587 hasAssociatedReturn = false
3588+ noReturnReason = ir .NoReturnReasonReturnsDisabled
3589+ } else if len (returnLocations ) == 1 && returnLocations [0 ].PC == call .pc {
3590+ // Add a workaround for the fact that single-instruction
3591+ // functions would have the same entry and exit probes, but the
3592+ // ordering between them would not be well-defined, so in this
3593+ // extremely uncommon case the user doesn't get to see the
3594+ // return probe. It's okay because there literally cannot be a
3595+ // return value.
3596+ hasAssociatedReturn = false
3597+ noReturnReason = ir .NoReturnReasonNoBody
35913598 returnLocations = returnLocations [:0 ]
3599+ } else {
3600+ hasAssociatedReturn = true
35923601 }
35933602
35943603 buf = append (buf , ir.InjectionPoint {
35953604 PC : call .pc ,
35963605 Frameless : call .frameless ,
35973606 HasAssociatedReturn : hasAssociatedReturn ,
3607+ NoReturnReason : noReturnReason ,
35983608 TopPCOffset : call .topPCOffset ,
35993609 })
36003610 if hasAssociatedReturn {
@@ -3635,6 +3645,7 @@ func pickInjectionPoint(
36353645 PC : injectionPC ,
36363646 Frameless : frameless ,
36373647 HasAssociatedReturn : false ,
3648+ NoReturnReason : ir .NoReturnReasonLineProbe ,
36383649 })
36393650 }
36403651 return buf , returnEvent , ir.Issue {}, nil
@@ -3826,6 +3837,7 @@ func disassembleAmd64Function(
38263837 PC : epilogueStart ,
38273838 Frameless : frameless ,
38283839 HasAssociatedReturn : false ,
3840+ NoReturnReason : ir .NoReturnReasonIsReturn ,
38293841 })
38303842 }
38313843 }
@@ -3834,6 +3846,7 @@ func disassembleAmd64Function(
38343846 PC : addr + uint64 (offset ),
38353847 Frameless : frameless ,
38363848 HasAssociatedReturn : false ,
3849+ NoReturnReason : ir .NoReturnReasonIsReturn ,
38373850 })
38383851 }
38393852 offset += instruction .Len
0 commit comments