Changed "Error Value::GetValueAsData (...)" to set the data extractor byte

order and address size correctly when the value comes from a file address.
Values have "file" addresses when they are globals and the debug information
specifies that they live in the object file at a given address (DWARF will
represent this as a location "DW_OP_addr <addr>"). This causes global pointers
to correctly extract their children on 64 bit programs.

llvm-svn: 111380
This commit is contained in:
Greg Clayton 2010-08-18 18:28:52 +00:00
parent ea480e507c
commit ad3843c93b
1 changed files with 9 additions and 0 deletions

View File

@ -560,7 +560,16 @@ Value::GetValueAsData (ExecutionContext *exe_ctx, clang::ASTContext *ast_context
Address so_addr(file_addr, objfile->GetSectionList());
address = so_addr.GetLoadAddress (exe_ctx->process);
if (address != LLDB_INVALID_ADDRESS)
{
address_type = eAddressTypeLoad;
data.SetByteOrder(exe_ctx->process->GetByteOrder());
data.SetAddressByteSize(exe_ctx->process->GetAddressByteSize());
}
else
{
data.SetByteOrder(objfile->GetByteOrder());
data.SetAddressByteSize(objfile->GetAddressByteSize());
}
}
if (address_type == eAddressTypeFile)
error.SetErrorStringWithFormat ("%s is not loaded.\n", var_sc.module_sp->GetFileSpec().GetFilename().AsCString());