@@ -164,7 +164,7 @@ pub enum StackPopCleanup {
164
164
}
165
165
166
166
/// State of a local variable including a memoized layout
167
- #[ derive( Clone , PartialEq , Eq , HashStable ) ]
167
+ #[ derive( Clone , Debug , PartialEq , Eq , HashStable ) ]
168
168
pub struct LocalState < ' tcx , Tag : Provenance = AllocId > {
169
169
pub value : LocalValue < Tag > ,
170
170
/// 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> {
714
714
self . size_and_align_of ( & mplace. meta , & mplace. layout )
715
715
}
716
716
717
+ #[ instrument( skip( self , body, return_place, return_to_block) , level = "debug" ) ]
717
718
pub fn push_stack_frame (
718
719
& mut self ,
719
720
instance : ty:: Instance < ' tcx > ,
720
721
body : & ' mir mir:: Body < ' tcx > ,
721
722
return_place : Option < & PlaceTy < ' tcx , M :: PointerTag > > ,
722
723
return_to_block : StackPopCleanup ,
723
724
) -> InterpResult < ' tcx > {
725
+ debug ! ( "body: {:#?}" , body) ;
724
726
// first push a stack frame so we have access to the local substs
725
727
let pre_frame = Frame {
726
728
body,
@@ -824,6 +826,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
824
826
/// `Drop` impls for any locals that have been initialized at this point.
825
827
/// The cleanup block ends with a special `Resume` terminator, which will
826
828
/// cause us to continue unwinding.
829
+ #[ instrument( skip( self ) , level = "debug" ) ]
827
830
pub ( super ) fn pop_stack_frame ( & mut self , unwinding : bool ) -> InterpResult < ' tcx > {
828
831
info ! (
829
832
"popping stack frame ({})" ,
@@ -876,6 +879,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
876
879
return Ok ( ( ) ) ;
877
880
}
878
881
882
+ debug ! ( "locals: {:#?}" , frame. locals) ;
883
+
879
884
// Cleanup: deallocate all locals that are backed by an allocation.
880
885
for local in & frame. locals {
881
886
self . deallocate_local ( local. value ) ?;
@@ -935,6 +940,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
935
940
Ok ( ( ) )
936
941
}
937
942
943
+ #[ instrument( skip( self ) , level = "debug" ) ]
938
944
fn deallocate_local ( & mut self , local : LocalValue < M :: PointerTag > ) -> InterpResult < ' tcx > {
939
945
if let LocalValue :: Live ( Operand :: Indirect ( MemPlace { ptr, .. } ) ) = local {
940
946
// All locals have a backing allocation, even if the allocation is empty
0 commit comments