diff options
| author | Jim Ingham <jingham@apple.com> | 2010-09-10 23:12:17 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2010-09-10 23:12:17 +0000 |
| commit | 53c47f1e2f61c5ab5060970e49fc5dfc3cdaac9f (patch) | |
| tree | 97b684cb5064d6b325eaaa5d6d9ea9b720087b88 /lldb/source/Target | |
| parent | cc766a20d35a336802f0c7ba344956b90d1f715d (diff) | |
| download | llvm-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.cpp | 14 |
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; |
