summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Value.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-11-02 01:50:16 +0000
committerGreg Clayton <gclayton@apple.com>2010-11-02 01:50:16 +0000
commit7c8a966442a2c70e0017a6497b0db353c3164523 (patch)
tree614405a869aed05c3780b027ae5e19fbb3a44d34 /lldb/source/Core/Value.cpp
parent07072664c4c24d10b9563ec8293a902c4882398b (diff)
downloadbcm5719-llvm-7c8a966442a2c70e0017a6497b0db353c3164523.tar.gz
bcm5719-llvm-7c8a966442a2c70e0017a6497b0db353c3164523.zip
Print better error messages when memory reads fail when displaying variable
values. Always show the variable types for the top level items when dumping program variables. llvm-svn: 117999
Diffstat (limited to 'lldb/source/Core/Value.cpp')
-rw-r--r--lldb/source/Core/Value.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/lldb/source/Core/Value.cpp b/lldb/source/Core/Value.cpp
index de6500ef938..76f109744ff 100644
--- a/lldb/source/Core/Value.cpp
+++ b/lldb/source/Core/Value.cpp
@@ -498,7 +498,7 @@ Value::GetValueAsData (ExecutionContext *exe_ctx, clang::ASTContext *ast_context
switch (m_value_type)
{
default:
- error.SetErrorStringWithFormat("Invalid value type %i.\n", m_value_type);
+ error.SetErrorStringWithFormat("invalid value type %i", m_value_type);
break;
case eValueTypeScalar:
@@ -506,17 +506,17 @@ Value::GetValueAsData (ExecutionContext *exe_ctx, clang::ASTContext *ast_context
data.SetAddressByteSize(sizeof(void *));
if (m_value.GetData (data))
return error; // Success;
- error.SetErrorStringWithFormat("Extracting data from value failed.\n");
+ error.SetErrorStringWithFormat("extracting data from value failed");
break;
case eValueTypeLoadAddress:
if (exe_ctx == NULL)
{
- error.SetErrorString ("Can't read memory (no execution context).");
+ error.SetErrorString ("can't read memory (no execution context)");
}
else if (exe_ctx->process == NULL)
{
- error.SetErrorString ("Can't read memory (invalid process).");
+ error.SetErrorString ("can't read memory (invalid process)");
}
else
{
@@ -564,7 +564,7 @@ Value::GetValueAsData (ExecutionContext *exe_ctx, clang::ASTContext *ast_context
}
else
{
- error.SetErrorStringWithFormat ("Unable to resolve the module for file address 0x%llx for variable '%s'.\n", file_addr, variable->GetName().AsCString(""));
+ error.SetErrorStringWithFormat ("unable to resolve the module for file address 0x%llx for variable '%s'", file_addr, variable->GetName().AsCString(""));
}
}
else
@@ -576,7 +576,7 @@ Value::GetValueAsData (ExecutionContext *exe_ctx, clang::ASTContext *ast_context
{
// Can't convert a file address to anything valid without more
// context (which Module it came from)
- error.SetErrorString ("Can't read memory from file address without more context.");
+ error.SetErrorString ("can't read memory from file address without more context");
}
}
break;
@@ -595,7 +595,7 @@ Value::GetValueAsData (ExecutionContext *exe_ctx, clang::ASTContext *ast_context
if (address == LLDB_INVALID_ADDRESS)
{
- error.SetErrorStringWithFormat ("Invalid %s address.\n", address_type == eAddressTypeHost ? "host" : "load");
+ error.SetErrorStringWithFormat ("invalid %s address", address_type == eAddressTypeHost ? "host" : "load");
return error;
}
@@ -628,16 +628,18 @@ Value::GetValueAsData (ExecutionContext *exe_ctx, clang::ASTContext *ast_context
{
if (error.Success())
error.SetErrorStringWithFormat("read %u bytes of memory from 0x%llx failed", (uint64_t)address, byte_size);
+ else
+ error.SetErrorStringWithFormat("read memory from 0x%llx failed", (uint64_t)address);
}
}
else
{
- error.SetErrorStringWithFormat ("Unsupported lldb::AddressType value (%i).\n", address_type);
+ error.SetErrorStringWithFormat ("unsupported lldb::AddressType value (%i)", address_type);
}
}
else
{
- error.SetErrorStringWithFormat ("Out of memory.\n");
+ error.SetErrorStringWithFormat ("out of memory");
}
return error;
OpenPOWER on IntegriCloud