Added the ability to log a value object just as a value would be display

when using the "frame variable" or "target variable" commands.

llvm-svn: 153266
This commit is contained in:
Greg Clayton 2012-03-22 18:15:37 +00:00
parent 1d1435d8a8
commit f830dbb77b
2 changed files with 33 additions and 1 deletions

View File

@ -881,7 +881,17 @@ public:
DumpValueObject (Stream &s,
ValueObject *valobj,
const DumpValueObjectOptions& options);
static void
LogValueObject (Log *log,
ValueObject *valobj);
static void
LogValueObject (Log *log,
ValueObject *valobj,
const DumpValueObjectOptions& options);
// returns true if this is a char* or a char[]
// if it is a char* and check_pointer is true,
// it also checks that the pointer is valid

View File

@ -3390,6 +3390,28 @@ DumpValueObject_Impl (Stream &s,
}
}
void
ValueObject::LogValueObject (Log *log,
ValueObject *valobj)
{
if (log && valobj)
return LogValueObject (log, valobj, DumpValueObjectOptions::DefaultOptions());
}
void
ValueObject::LogValueObject (Log *log,
ValueObject *valobj,
const DumpValueObjectOptions& options)
{
if (log && valobj)
{
StreamString s;
ValueObject::DumpValueObject (s, valobj, options);
if (s.GetSize())
log->PutCString(s.GetData());
}
}
void
ValueObject::DumpValueObject (Stream &s,
ValueObject *valobj)