@@ -784,7 +784,9 @@ class EntityResultVariable : public Materializer::Entity {
784
784
785
785
const lldb::addr_t load_addr = process_address + m_offset;
786
786
787
- ExecutionContextScope *exe_scope = map.GetBestExecutionContextScope ();
787
+ ExecutionContextScope *exe_scope = frame_sp.get ();
788
+ if (!exe_scope)
789
+ exe_scope = map.GetBestExecutionContextScope ();
788
790
789
791
llvm::Optional<uint64_t > byte_size = m_type.GetByteSize (exe_scope);
790
792
if (!byte_size) {
@@ -834,7 +836,9 @@ class EntityResultVariable : public Materializer::Entity {
834
836
lldb::addr_t frame_bottom, Status &err) override {
835
837
err.Clear ();
836
838
837
- ExecutionContextScope *exe_scope = map.GetBestExecutionContextScope ();
839
+ ExecutionContextScope *exe_scope = frame_sp.get ();
840
+ if (!exe_scope)
841
+ exe_scope = map.GetBestExecutionContextScope ();
838
842
839
843
if (!exe_scope) {
840
844
err.SetErrorString (" Couldn't dematerialize a result variable: invalid "
@@ -1062,7 +1066,9 @@ class EntitySymbol : public Materializer::Entity {
1062
1066
1063
1067
const Address sym_address = m_symbol.GetAddress ();
1064
1068
1065
- ExecutionContextScope *exe_scope = map.GetBestExecutionContextScope ();
1069
+ ExecutionContextScope *exe_scope = frame_sp.get ();
1070
+ if (!exe_scope)
1071
+ exe_scope = map.GetBestExecutionContextScope ();
1066
1072
1067
1073
lldb::TargetSP target_sp;
1068
1074
@@ -1346,7 +1352,6 @@ Materializer::DematerializerSP
1346
1352
Materializer::Materialize (lldb::StackFrameSP &frame_sp, IRMemoryMap &map,
1347
1353
lldb::addr_t process_address, Status &error) {
1348
1354
ExecutionContextScope *exe_scope = frame_sp.get ();
1349
-
1350
1355
if (!exe_scope)
1351
1356
exe_scope = map.GetBestExecutionContextScope ();
1352
1357
@@ -1397,7 +1402,9 @@ void Materializer::Dematerializer::Dematerialize(Status &error,
1397
1402
if (thread_sp)
1398
1403
frame_sp = thread_sp->GetFrameWithStackID (m_stack_id);
1399
1404
1400
- ExecutionContextScope *exe_scope = m_map->GetBestExecutionContextScope ();
1405
+ ExecutionContextScope *exe_scope = frame_sp.get ();
1406
+ if (!exe_scope)
1407
+ exe_scope = m_map->GetBestExecutionContextScope ();
1401
1408
1402
1409
if (!IsValid ()) {
1403
1410
error.SetErrorToGenericError ();
0 commit comments