@@ -164,7 +164,7 @@ pub enum StackPopCleanup {
164164}
165165
166166/// State of a local variable including a memoized layout
167- #[ derive( Clone , PartialEq , Eq , HashStable ) ]
167+ #[ derive( Clone , Debug , PartialEq , Eq , HashStable ) ]
168168pub struct LocalState < ' tcx , Tag : Provenance = AllocId > {
169169 pub value : LocalValue < Tag > ,
170170 /// Don't modify if `Some`, this is only used to prevent computing the layout twice
@@ -714,13 +714,15 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
714714 self . size_and_align_of ( & mplace. meta , & mplace. layout )
715715 }
716716
717+ #[ instrument( skip( self , body, return_place, return_to_block) , level = "debug" ) ]
717718 pub fn push_stack_frame (
718719 & mut self ,
719720 instance : ty:: Instance < ' tcx > ,
720721 body : & ' mir mir:: Body < ' tcx > ,
721722 return_place : Option < & PlaceTy < ' tcx , M :: PointerTag > > ,
722723 return_to_block : StackPopCleanup ,
723724 ) -> InterpResult < ' tcx > {
725+ debug ! ( "body: {:#?}" , body) ;
724726 // first push a stack frame so we have access to the local substs
725727 let pre_frame = Frame {
726728 body,
@@ -824,6 +826,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
824826 /// `Drop` impls for any locals that have been initialized at this point.
825827 /// The cleanup block ends with a special `Resume` terminator, which will
826828 /// cause us to continue unwinding.
829+ #[ instrument( skip( self ) , level = "debug" ) ]
827830 pub ( super ) fn pop_stack_frame ( & mut self , unwinding : bool ) -> InterpResult < ' tcx > {
828831 info ! (
829832 "popping stack frame ({})" ,
@@ -876,6 +879,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
876879 return Ok ( ( ) ) ;
877880 }
878881
882+ debug ! ( "locals: {:#?}" , frame. locals) ;
883+
879884 // Cleanup: deallocate all locals that are backed by an allocation.
880885 for local in & frame. locals {
881886 self . deallocate_local ( local. value ) ?;
@@ -935,6 +940,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
935940 Ok ( ( ) )
936941 }
937942
943+ #[ instrument( skip( self ) , level = "debug" ) ]
938944 fn deallocate_local ( & mut self , local : LocalValue < M :: PointerTag > ) -> InterpResult < ' tcx > {
939945 if let LocalValue :: Live ( Operand :: Indirect ( MemPlace { ptr, .. } ) ) = local {
940946 // All locals have a backing allocation, even if the allocation is empty
0 commit comments