Skip to content

Commit 02f5837

Browse files
committed
Thread ExecutionContextScope through GetByteSize where possible (NFC-ish)
This patch has no effect for C and C++. In more dynamic languages, such as Objective-C and Swift GetByteSize() needs to call into the language runtime, so it's important to pass one in where possible. My primary motivation for this is some work I'm doing on the Swift branch, however, it looks like we are also seeing warnings in Objective-C that this may resolve. Everything in the SymbolFile hierarchy still passes in nullptrs, because we don't have an execution context in SymbolFile, since SymbolFile transcends processes. Differential Revision: https://reviews.llvm.org/D84267
1 parent 4e171c9 commit 02f5837

29 files changed

+129
-100
lines changed

lldb/include/lldb/Symbol/CompilerType.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ class CompilerType {
177177

178178
/// Creating related types.
179179
/// \{
180-
CompilerType GetArrayElementType(uint64_t *stride = nullptr) const;
180+
CompilerType GetArrayElementType(ExecutionContextScope *exe_scope,
181+
uint64_t *stride = nullptr) const;
181182

182183
CompilerType GetArrayType(uint64_t size) const;
183184

@@ -383,7 +384,8 @@ class CompilerType {
383384
/// \}
384385

385386
bool GetValueAsScalar(const DataExtractor &data, lldb::offset_t data_offset,
386-
size_t data_byte_size, Scalar &value) const;
387+
size_t data_byte_size, Scalar &value,
388+
ExecutionContextScope *exe_scope) const;
387389
void Clear() {
388390
m_type = nullptr;
389391
m_type_system = nullptr;

lldb/include/lldb/Symbol/Type.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,15 @@ class Type : public std::enable_shared_from_this<Type>, public UserID {
114114
// Type instances. They can store a weak pointer to the Module;
115115
lldb::ModuleSP GetModule();
116116

117-
void GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_name);
117+
void GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_name,
118+
ExecutionContextScope *exe_scope);
118119

119120
SymbolFile *GetSymbolFile() { return m_symbol_file; }
120121
const SymbolFile *GetSymbolFile() const { return m_symbol_file; }
121122

122123
ConstString GetName();
123124

124-
llvm::Optional<uint64_t> GetByteSize();
125+
llvm::Optional<uint64_t> GetByteSize(ExecutionContextScope *exe_scope);
125126

126127
uint32_t GetNumChildren(bool omit_empty_base_classes);
127128

lldb/include/lldb/Symbol/TypeSystem.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,9 @@ class TypeSystem : public PluginInterface {
217217

218218
// Creating related types
219219

220-
virtual CompilerType GetArrayElementType(lldb::opaque_compiler_type_t type,
221-
uint64_t *stride) = 0;
220+
virtual CompilerType
221+
GetArrayElementType(lldb::opaque_compiler_type_t type, uint64_t *stride,
222+
ExecutionContextScope *exe_scope) = 0;
222223

223224
virtual CompilerType GetArrayType(lldb::opaque_compiler_type_t type,
224225
uint64_t size);

lldb/source/API/SBType.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ SBType SBType::GetArrayElementType() {
214214
return LLDB_RECORD_RESULT(SBType());
215215
CompilerType canonical_type =
216216
m_opaque_sp->GetCompilerType(true).GetCanonicalType();
217-
return LLDB_RECORD_RESULT(
218-
SBType(TypeImplSP(new TypeImpl(canonical_type.GetArrayElementType()))));
217+
return LLDB_RECORD_RESULT(SBType(
218+
TypeImplSP(new TypeImpl(canonical_type.GetArrayElementType(nullptr)))));
219219
}
220220

221221
SBType SBType::GetArrayType(uint64_t size) {

lldb/source/Commands/CommandObjectTarget.cpp

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,8 @@ static size_t LookupFunctionInModule(CommandInterpreter &interpreter,
16241624
return 0;
16251625
}
16261626

1627-
static size_t LookupTypeInModule(CommandInterpreter &interpreter, Stream &strm,
1627+
static size_t LookupTypeInModule(Target *target,
1628+
CommandInterpreter &interpreter, Stream &strm,
16281629
Module *module, const char *name_cstr,
16291630
bool name_is_regex) {
16301631
TypeList type_list;
@@ -1652,7 +1653,7 @@ static size_t LookupTypeInModule(CommandInterpreter &interpreter, Stream &strm,
16521653
// Resolve the clang type so that any forward references to types
16531654
// that haven't yet been parsed will get parsed.
16541655
type_sp->GetFullCompilerType();
1655-
type_sp->GetDescription(&strm, eDescriptionLevelFull, true);
1656+
type_sp->GetDescription(&strm, eDescriptionLevelFull, true, target);
16561657
// Print all typedef chains
16571658
TypeSP typedef_type_sp(type_sp);
16581659
TypeSP typedefed_type_sp(typedef_type_sp->GetTypedefType());
@@ -1661,7 +1662,8 @@ static size_t LookupTypeInModule(CommandInterpreter &interpreter, Stream &strm,
16611662
strm.Printf(" typedef '%s': ",
16621663
typedef_type_sp->GetName().GetCString());
16631664
typedefed_type_sp->GetFullCompilerType();
1664-
typedefed_type_sp->GetDescription(&strm, eDescriptionLevelFull, true);
1665+
typedefed_type_sp->GetDescription(&strm, eDescriptionLevelFull, true,
1666+
target);
16651667
typedef_type_sp = typedefed_type_sp;
16661668
typedefed_type_sp = typedef_type_sp->GetTypedefType();
16671669
}
@@ -1671,9 +1673,9 @@ static size_t LookupTypeInModule(CommandInterpreter &interpreter, Stream &strm,
16711673
return type_list.GetSize();
16721674
}
16731675

1674-
static size_t LookupTypeHere(CommandInterpreter &interpreter, Stream &strm,
1675-
Module &module, const char *name_cstr,
1676-
bool name_is_regex) {
1676+
static size_t LookupTypeHere(Target *target, CommandInterpreter &interpreter,
1677+
Stream &strm, Module &module,
1678+
const char *name_cstr, bool name_is_regex) {
16771679
TypeList type_list;
16781680
const uint32_t max_num_matches = UINT32_MAX;
16791681
bool name_is_fully_qualified = false;
@@ -1696,16 +1698,17 @@ static size_t LookupTypeHere(CommandInterpreter &interpreter, Stream &strm,
16961698
// Resolve the clang type so that any forward references to types that
16971699
// haven't yet been parsed will get parsed.
16981700
type_sp->GetFullCompilerType();
1699-
type_sp->GetDescription(&strm, eDescriptionLevelFull, true);
1700-
// Print all typedef chains
1701+
type_sp->GetDescription(&strm, eDescriptionLevelFull, true, target);
1702+
// Print all typedef chains.
17011703
TypeSP typedef_type_sp(type_sp);
17021704
TypeSP typedefed_type_sp(typedef_type_sp->GetTypedefType());
17031705
while (typedefed_type_sp) {
17041706
strm.EOL();
17051707
strm.Printf(" typedef '%s': ",
17061708
typedef_type_sp->GetName().GetCString());
17071709
typedefed_type_sp->GetFullCompilerType();
1708-
typedefed_type_sp->GetDescription(&strm, eDescriptionLevelFull, true);
1710+
typedefed_type_sp->GetDescription(&strm, eDescriptionLevelFull, true,
1711+
target);
17091712
typedef_type_sp = typedefed_type_sp;
17101713
typedefed_type_sp = typedef_type_sp->GetTypedefType();
17111714
}
@@ -3745,9 +3748,9 @@ class CommandObjectTargetModulesLookup : public CommandObjectParsed {
37453748
return false;
37463749
case eLookupTypeType:
37473750
if (!m_options.m_str.empty()) {
3748-
if (LookupTypeHere(m_interpreter, result.GetOutputStream(),
3749-
*sym_ctx.module_sp, m_options.m_str.c_str(),
3750-
m_options.m_use_regex)) {
3751+
if (LookupTypeHere(&GetSelectedTarget(), m_interpreter,
3752+
result.GetOutputStream(), *sym_ctx.module_sp,
3753+
m_options.m_str.c_str(), m_options.m_use_regex)) {
37513754
result.SetStatus(eReturnStatusSuccessFinishResult);
37523755
return true;
37533756
}
@@ -3817,9 +3820,9 @@ class CommandObjectTargetModulesLookup : public CommandObjectParsed {
38173820

38183821
case eLookupTypeType:
38193822
if (!m_options.m_str.empty()) {
3820-
if (LookupTypeInModule(m_interpreter, result.GetOutputStream(), module,
3821-
m_options.m_str.c_str(),
3822-
m_options.m_use_regex)) {
3823+
if (LookupTypeInModule(
3824+
&GetSelectedTarget(), m_interpreter, result.GetOutputStream(),
3825+
module, m_options.m_str.c_str(), m_options.m_use_regex)) {
38233826
result.SetStatus(eReturnStatusSuccessFinishResult);
38243827
return true;
38253828
}

lldb/source/Core/Value.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,9 @@ Scalar &Value::ResolveValue(ExecutionContext *exe_ctx) {
603603
Status error(GetValueAsData(exe_ctx, data, nullptr));
604604
if (error.Success()) {
605605
Scalar scalar;
606-
if (compiler_type.GetValueAsScalar(data, 0, data.GetByteSize(),
607-
scalar)) {
606+
if (compiler_type.GetValueAsScalar(
607+
data, 0, data.GetByteSize(), scalar,
608+
exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr)) {
608609
m_value = scalar;
609610
m_value_type = eValueTypeScalar;
610611
} else {

lldb/source/Core/ValueObjectMemory.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,12 @@ size_t ValueObjectMemory::CalculateNumChildren(uint32_t max) {
140140
}
141141

142142
uint64_t ValueObjectMemory::GetByteSize() {
143+
ExecutionContext exe_ctx(GetExecutionContextRef());
143144
if (m_type_sp)
144-
return m_type_sp->GetByteSize().getValueOr(0);
145-
return m_compiler_type.GetByteSize(nullptr).getValueOr(0);
145+
return m_type_sp->GetByteSize(exe_ctx.GetBestExecutionContextScope())
146+
.getValueOr(0);
147+
return m_compiler_type.GetByteSize(exe_ctx.GetBestExecutionContextScope())
148+
.getValueOr(0);
146149
}
147150

148151
lldb::ValueType ValueObjectMemory::GetValueType() const {

lldb/source/DataFormatters/FormatManager.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,9 @@ void FormatManager::GetPossibleMatches(
237237
// stripped.
238238
uint64_t array_size;
239239
if (compiler_type.IsArrayType(nullptr, &array_size, nullptr)) {
240-
CompilerType element_type = compiler_type.GetArrayElementType();
240+
ExecutionContext exe_ctx(valobj.GetExecutionContextRef());
241+
CompilerType element_type = compiler_type.GetArrayElementType(
242+
exe_ctx.GetBestExecutionContextScope());
241243
if (element_type.IsTypedefType()) {
242244
// Get the stripped element type and compute the stripped array type
243245
// from it.

lldb/source/Expression/Materializer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ class EntityVariable : public Materializer::Entity {
514514
return;
515515
}
516516

517-
if (data.GetByteSize() < m_variable_sp->GetType()->GetByteSize()) {
517+
if (data.GetByteSize() < m_variable_sp->GetType()->GetByteSize(scope)) {
518518
if (data.GetByteSize() == 0 &&
519519
!m_variable_sp->LocationExpression().IsValid()) {
520520
err.SetErrorStringWithFormat("the variable '%s' has no location, "
@@ -525,7 +525,7 @@ class EntityVariable : public Materializer::Entity {
525525
"size of variable %s (%" PRIu64
526526
") is larger than the ValueObject's size (%" PRIu64 ")",
527527
m_variable_sp->GetName().AsCString(),
528-
m_variable_sp->GetType()->GetByteSize().getValueOr(0),
528+
m_variable_sp->GetType()->GetByteSize(scope).getValueOr(0),
529529
data.GetByteSize());
530530
}
531531
return;

lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,8 @@ static bool LoadValueFromConsecutiveGPRRegisters(
492492
uint32_t &NGRN, // NGRN (see ABI documentation)
493493
uint32_t &NSRN, // NSRN (see ABI documentation)
494494
DataExtractor &data) {
495-
llvm::Optional<uint64_t> byte_size = value_type.GetByteSize(nullptr);
495+
llvm::Optional<uint64_t> byte_size =
496+
value_type.GetByteSize(exe_ctx.GetBestExecutionContextScope());
496497
if (!byte_size || *byte_size == 0)
497498
return false;
498499

@@ -509,7 +510,8 @@ static bool LoadValueFromConsecutiveGPRRegisters(
509510
if (NSRN < 8 && (8 - NSRN) >= homogeneous_count) {
510511
if (!base_type)
511512
return false;
512-
llvm::Optional<uint64_t> base_byte_size = base_type.GetByteSize(nullptr);
513+
llvm::Optional<uint64_t> base_byte_size =
514+
base_type.GetByteSize(exe_ctx.GetBestExecutionContextScope());
513515
if (!base_byte_size)
514516
return false;
515517
uint32_t data_offset = 0;
@@ -646,7 +648,7 @@ ValueObjectSP ABIMacOSX_arm64::GetReturnValueObjectImpl(
646648
return return_valobj_sp;
647649

648650
llvm::Optional<uint64_t> byte_size =
649-
return_compiler_type.GetByteSize(nullptr);
651+
return_compiler_type.GetByteSize(&thread);
650652
if (!byte_size)
651653
return return_valobj_sp;
652654

lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,8 @@ static bool LoadValueFromConsecutiveGPRRegisters(
466466
uint32_t &NGRN, // NGRN (see ABI documentation)
467467
uint32_t &NSRN, // NSRN (see ABI documentation)
468468
DataExtractor &data) {
469-
llvm::Optional<uint64_t> byte_size = value_type.GetByteSize(nullptr);
469+
llvm::Optional<uint64_t> byte_size =
470+
value_type.GetByteSize(exe_ctx.GetBestExecutionContextScope());
470471

471472
if (byte_size || *byte_size == 0)
472473
return false;
@@ -484,7 +485,8 @@ static bool LoadValueFromConsecutiveGPRRegisters(
484485
if (NSRN < 8 && (8 - NSRN) >= homogeneous_count) {
485486
if (!base_type)
486487
return false;
487-
llvm::Optional<uint64_t> base_byte_size = base_type.GetByteSize(nullptr);
488+
llvm::Optional<uint64_t> base_byte_size =
489+
base_type.GetByteSize(exe_ctx.GetBestExecutionContextScope());
488490
if (!base_byte_size)
489491
return false;
490492
uint32_t data_offset = 0;
@@ -614,7 +616,7 @@ ValueObjectSP ABISysV_arm64::GetReturnValueObjectImpl(
614616
return return_valobj_sp;
615617

616618
llvm::Optional<uint64_t> byte_size =
617-
return_compiler_type.GetByteSize(nullptr);
619+
return_compiler_type.GetByteSize(&thread);
618620
if (!byte_size)
619621
return return_valobj_sp;
620622

lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ ABISysV_arc::GetReturnValueObjectSimple(Thread &thread,
458458
const uint32_t type_flags = compiler_type.GetTypeInfo();
459459
// Integer return type.
460460
if (type_flags & eTypeIsInteger) {
461-
const size_t byte_size = compiler_type.GetByteSize(nullptr).getValueOr(0);
461+
const size_t byte_size = compiler_type.GetByteSize(&thread).getValueOr(0);
462462
auto raw_value = ReadRawValue(reg_ctx, byte_size);
463463

464464
const bool is_signed = (type_flags & eTypeIsSigned) != 0;
@@ -482,7 +482,7 @@ ABISysV_arc::GetReturnValueObjectSimple(Thread &thread,
482482

483483
if (compiler_type.IsFloatingPointType(float_count, is_complex) &&
484484
1 == float_count && !is_complex) {
485-
const size_t byte_size = compiler_type.GetByteSize(nullptr).getValueOr(0);
485+
const size_t byte_size = compiler_type.GetByteSize(&thread).getValueOr(0);
486486
auto raw_value = ReadRawValue(reg_ctx, byte_size);
487487

488488
if (!SetSizedFloat(value.GetScalar(), raw_value, byte_size))

lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ ValueObjectSP ABISysV_arm::GetReturnValueObjectImpl(
17181718

17191719
if (homogeneous_count > 0 && homogeneous_count <= 4) {
17201720
llvm::Optional<uint64_t> base_byte_size =
1721-
base_type.GetByteSize(nullptr);
1721+
base_type.GetByteSize(&thread);
17221722
if (base_type.IsVectorType(nullptr, nullptr)) {
17231723
if (base_byte_size &&
17241724
(*base_byte_size == 8 || *base_byte_size == 16)) {
@@ -1747,7 +1747,7 @@ ValueObjectSP ABISysV_arm::GetReturnValueObjectImpl(
17471747

17481748
if (base_type.IsFloatingPointType(float_count, is_complex)) {
17491749
llvm::Optional<uint64_t> base_byte_size =
1750-
base_type.GetByteSize(nullptr);
1750+
base_type.GetByteSize(&thread);
17511751
if (float_count == 2 && is_complex) {
17521752
if (index != 0 && base_byte_size &&
17531753
vfp_byte_size != *base_byte_size)

lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ ValueObjectSP ABISysV_mips64::GetReturnValueObjectImpl(
753753
const ArchSpec target_arch = target->GetArchitecture();
754754
ByteOrder target_byte_order = target_arch.GetByteOrder();
755755
llvm::Optional<uint64_t> byte_size =
756-
return_compiler_type.GetByteSize(nullptr);
756+
return_compiler_type.GetByteSize(&thread);
757757
if (!byte_size)
758758
return return_valobj_sp;
759759
const uint32_t type_flags = return_compiler_type.GetTypeInfo(nullptr);
@@ -962,7 +962,7 @@ ValueObjectSP ABISysV_mips64::GetReturnValueObjectImpl(
962962
return_compiler_type.GetFieldAtIndex(
963963
idx, name, &field_bit_offset, nullptr, nullptr);
964964
llvm::Optional<uint64_t> field_byte_width =
965-
field_compiler_type.GetByteSize(nullptr);
965+
field_compiler_type.GetByteSize(&thread);
966966
if (!field_byte_width)
967967
return return_valobj_sp;
968968

@@ -1034,7 +1034,7 @@ ValueObjectSP ABISysV_mips64::GetReturnValueObjectImpl(
10341034
CompilerType field_compiler_type = return_compiler_type.GetFieldAtIndex(
10351035
idx, name, &field_bit_offset, nullptr, nullptr);
10361036
llvm::Optional<uint64_t> field_byte_width =
1037-
field_compiler_type.GetByteSize(nullptr);
1037+
field_compiler_type.GetByteSize(&thread);
10381038

10391039
// if we don't know the size of the field (e.g. invalid type), just
10401040
// bail out

lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ ValueObjectSP ABISysV_ppc::GetReturnValueObjectSimple(
527527
// Extract the register context so we can read arguments from registers
528528

529529
llvm::Optional<uint64_t> byte_size =
530-
return_compiler_type.GetByteSize(nullptr);
530+
return_compiler_type.GetByteSize(&thread);
531531
if (!byte_size)
532532
return return_valobj_sp;
533533
uint64_t raw_value = thread.GetRegisterContext()->ReadRegisterAsUnsigned(
@@ -574,7 +574,7 @@ ValueObjectSP ABISysV_ppc::GetReturnValueObjectSimple(
574574
// Don't handle complex yet.
575575
} else {
576576
llvm::Optional<uint64_t> byte_size =
577-
return_compiler_type.GetByteSize(nullptr);
577+
return_compiler_type.GetByteSize(&thread);
578578
if (byte_size && *byte_size <= sizeof(long double)) {
579579
const RegisterInfo *f1_info = reg_ctx->GetRegisterInfoByName("f1", 0);
580580
RegisterValue f1_value;
@@ -608,7 +608,7 @@ ValueObjectSP ABISysV_ppc::GetReturnValueObjectSimple(
608608
thread.GetStackFrameAtIndex(0).get(), value, ConstString(""));
609609
} else if (type_flags & eTypeIsVector) {
610610
llvm::Optional<uint64_t> byte_size =
611-
return_compiler_type.GetByteSize(nullptr);
611+
return_compiler_type.GetByteSize(&thread);
612612
if (byte_size && *byte_size > 0) {
613613
const RegisterInfo *altivec_reg = reg_ctx->GetRegisterInfoByName("v2", 0);
614614
if (altivec_reg) {

lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ class ReturnValueExtractor {
567567
ReturnValueExtractor(Thread &thread, CompilerType &type,
568568
RegisterContext *reg_ctx, ProcessSP process_sp)
569569
: m_thread(thread), m_type(type),
570-
m_byte_size(m_type.GetByteSize(nullptr).getValueOr(0)),
570+
m_byte_size(m_type.GetByteSize(&thread).getValueOr(0)),
571571
m_data_up(new DataBufferHeap(m_byte_size, 0)), m_reg_ctx(reg_ctx),
572572
m_process_sp(process_sp), m_byte_order(process_sp->GetByteOrder()),
573573
m_addr_size(
@@ -643,7 +643,7 @@ class ReturnValueExtractor {
643643
DataExtractor de(&raw_data, sizeof(raw_data), m_byte_order, m_addr_size);
644644

645645
offset_t offset = 0;
646-
llvm::Optional<uint64_t> byte_size = type.GetByteSize(nullptr);
646+
llvm::Optional<uint64_t> byte_size = type.GetByteSize(m_process_sp.get());
647647
if (!byte_size)
648648
return {};
649649
switch (*byte_size) {
@@ -777,7 +777,8 @@ class ReturnValueExtractor {
777777
CompilerType elem_type;
778778
if (m_type.IsHomogeneousAggregate(&elem_type)) {
779779
uint32_t type_flags = elem_type.GetTypeInfo();
780-
llvm::Optional<uint64_t> elem_size = elem_type.GetByteSize(nullptr);
780+
llvm::Optional<uint64_t> elem_size =
781+
elem_type.GetByteSize(m_process_sp.get());
781782
if (!elem_size)
782783
return {};
783784
if (type_flags & eTypeIsComplex || !(type_flags & eTypeIsFloat)) {

lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ ValueObjectSP ABISysV_s390x::GetReturnValueObjectSimple(
508508
if (type_flags & eTypeIsInteger) {
509509
// Extract the register context so we can read arguments from registers.
510510
llvm::Optional<uint64_t> byte_size =
511-
return_compiler_type.GetByteSize(nullptr);
511+
return_compiler_type.GetByteSize(&thread);
512512
if (!byte_size)
513513
return return_valobj_sp;
514514
uint64_t raw_value = thread.GetRegisterContext()->ReadRegisterAsUnsigned(
@@ -555,7 +555,7 @@ ValueObjectSP ABISysV_s390x::GetReturnValueObjectSimple(
555555
// Don't handle complex yet.
556556
} else {
557557
llvm::Optional<uint64_t> byte_size =
558-
return_compiler_type.GetByteSize(nullptr);
558+
return_compiler_type.GetByteSize(&thread);
559559
if (byte_size && *byte_size <= sizeof(long double)) {
560560
const RegisterInfo *f0_info = reg_ctx->GetRegisterInfoByName("f0", 0);
561561
RegisterValue f0_value;

0 commit comments

Comments
 (0)