@@ -104,8 +104,10 @@ pub struct GlobalState {
104104 next_call_id : CallId ,
105105 /// Those call IDs corresponding to functions that are still running.
106106 active_calls : FxHashSet < CallId > ,
107- /// The id to trace in this execution run
107+ /// The pointer id to trace
108108 tracked_pointer_tag : Option < PtrId > ,
109+ /// The call id to trace
110+ tracked_call_id : Option < CallId > ,
109111}
110112/// Memory extra state gives us interior mutable access to the global state.
111113pub type MemoryExtra = Rc < RefCell < GlobalState > > ;
@@ -153,13 +155,14 @@ impl fmt::Display for RefKind {
153155
154156/// Utilities for initialization and ID generation
155157impl GlobalState {
156- pub fn new ( tracked_pointer_tag : Option < PtrId > ) -> Self {
158+ pub fn new ( tracked_pointer_tag : Option < PtrId > , tracked_call_id : Option < CallId > ) -> Self {
157159 GlobalState {
158160 next_ptr_id : NonZeroU64 :: new ( 1 ) . unwrap ( ) ,
159161 base_ptr_ids : FxHashMap :: default ( ) ,
160162 next_call_id : NonZeroU64 :: new ( 1 ) . unwrap ( ) ,
161163 active_calls : FxHashSet :: default ( ) ,
162164 tracked_pointer_tag,
165+ tracked_call_id,
163166 }
164167 }
165168
@@ -172,6 +175,9 @@ impl GlobalState {
172175 pub fn new_call ( & mut self ) -> CallId {
173176 let id = self . next_call_id ;
174177 trace ! ( "new_call: Assigning ID {}" , id) ;
178+ if Some ( id) == self . tracked_call_id {
179+ register_diagnostic ( NonHaltingDiagnostic :: CreatedCallId ( id) ) ;
180+ }
175181 assert ! ( self . active_calls. insert( id) ) ;
176182 self . next_call_id = NonZeroU64 :: new ( id. get ( ) + 1 ) . unwrap ( ) ;
177183 id
@@ -277,7 +283,7 @@ impl<'tcx> Stack {
277283 fn check_protector ( item : & Item , tag : Option < Tag > , global : & GlobalState ) -> InterpResult < ' tcx > {
278284 if let Tag :: Tagged ( id) = item. tag {
279285 if Some ( id) == global. tracked_pointer_tag {
280- register_diagnostic ( NonHaltingDiagnostic :: PoppedTrackedPointerTag ( item. clone ( ) ) ) ;
286+ register_diagnostic ( NonHaltingDiagnostic :: PoppedPointerTag ( item. clone ( ) ) ) ;
281287 }
282288 }
283289 if let Some ( call) = item. protector {
0 commit comments