aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Target
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2010-09-10 23:12:17 +0000
committerJim Ingham <jingham@apple.com>2010-09-10 23:12:17 +0000
commit53c47f1e2f61c5ab5060970e49fc5dfc3cdaac9f (patch)
tree97b684cb5064d6b325eaaa5d6d9ea9b720087b88 /lldb/source/Target
parentcc766a20d35a336802f0c7ba344956b90d1f715d (diff)
downloadllvm-53c47f1e2f61c5ab5060970e49fc5dfc3cdaac9f.tar.gz
llvm-53c47f1e2f61c5ab5060970e49fc5dfc3cdaac9f.tar.bz2
llvm-53c47f1e2f61c5ab5060970e49fc5dfc3cdaac9f.zip
Move the "Object Description" into the ValueObject, and the add an API to
SBValue to access it. For now this is just the result of ObjC NSPrintForDebugger, but could be extended. Also store the results of the ObjC Object Printer in a Stream, not a ConstString. llvm-svn: 113660
Diffstat (limited to 'lldb/source/Target')
-rw-r--r--lldb/source/Target/ObjCObjectPrinter.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/lldb/source/Target/ObjCObjectPrinter.cpp b/lldb/source/Target/ObjCObjectPrinter.cpp
index 1e436d77edcb..72015e2d650d 100644
--- a/lldb/source/Target/ObjCObjectPrinter.cpp
+++ b/lldb/source/Target/ObjCObjectPrinter.cpp
@@ -38,7 +38,7 @@ ObjCObjectPrinter::~ObjCObjectPrinter ()
}
bool
-ObjCObjectPrinter::PrintObject (ConstString &str, Value &object_ptr, ExecutionContext &exe_ctx)
+ObjCObjectPrinter::PrintObject (Stream &str, Value &object_ptr, ExecutionContext &exe_ctx)
{
if (!exe_ctx.process)
return false;
@@ -64,8 +64,14 @@ ObjCObjectPrinter::PrintObject (ConstString &str, Value &object_ptr, ExecutionCo
lldb::addr_t wrapper_struct_addr = LLDB_INVALID_ADDRESS;
func.InsertFunction(exe_ctx, wrapper_struct_addr, error_stream);
// FIXME: Check result of ExecuteFunction.
- func.ExecuteFunction(exe_ctx, &wrapper_struct_addr, error_stream, true, 1000, true, ret);
-
+ ClangFunction::ExecutionResults results
+ = func.ExecuteFunction(exe_ctx, &wrapper_struct_addr, error_stream, true, 1000, true, ret);
+ if (results != ClangFunction::eExecutionCompleted)
+ {
+ str.Printf("Error evaluating Print Object function: %d.\n", results);
+ return false;
+ }
+
addr_t result_ptr = ret.GetScalar().ULongLong(LLDB_INVALID_ADDRESS);
// poor man's strcpy
@@ -86,7 +92,7 @@ ObjCObjectPrinter::PrintObject (ConstString &str, Value &object_ptr, ExecutionCo
if (!desc.empty())
{
- str.SetCString(&desc.front());
+ str.PutCString(&desc.front());
return true;
}
return false;