diff options
-rw-r--r-- | lldb/include/lldb/Core/ValueObject.h | 4 | ||||
-rw-r--r-- | lldb/source/Core/Debugger.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Core/ValueObject.cpp | 13 |
3 files changed, 22 insertions, 1 deletions
diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h index 49c61988145..26fa3aad61d 100644 --- a/lldb/include/lldb/Core/ValueObject.h +++ b/lldb/include/lldb/Core/ValueObject.h @@ -80,7 +80,9 @@ public: eValueObjectRepresentationStyleLanguageSpecific, eValueObjectRepresentationStyleLocation, eValueObjectRepresentationStyleChildrenCount, - eValueObjectRepresentationStyleType + eValueObjectRepresentationStyleType, + eValueObjectRepresentationStyleName, + eValueObjectRepresentationStyleExpressionPath }; enum ExpressionPathScanEndReason diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index 2be1dbbafa0..4a6477f280a 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -1232,6 +1232,12 @@ ScanFormatDescriptor (const char* var_name_begin, case 'T': // if this is a 'T', print the type *val_obj_display = ValueObject::eValueObjectRepresentationStyleType; break; + case 'N': // if this is a 'N', print the name + *val_obj_display = ValueObject::eValueObjectRepresentationStyleName; + break; + case '>': // if this is a '>', print the name + *val_obj_display = ValueObject::eValueObjectRepresentationStyleExpressionPath; + break; default: if (log) log->Printf("ScanFormatDescriptor] %s is an error, leaving the previous value alone", format_name.c_str()); diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 67b46bbf74b..e2a87d4270b 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -1693,6 +1693,10 @@ ValueObject::DumpPrintableRepresentation(Stream& s, { const char *cstr = NULL; + + // this is a local stream that we are using to ensure that the data pointed to by cstr survives + // long enough for us to copy it to its destination - it is necessary to have this temporary storage + // area for cases where our desired output is not backed by some other longer-term storage StreamString strm; if (custom_format != eFormatInvalid) @@ -1724,6 +1728,15 @@ ValueObject::DumpPrintableRepresentation(Stream& s, case eValueObjectRepresentationStyleType: cstr = GetTypeName().AsCString(); break; + + case eValueObjectRepresentationStyleName: + cstr = GetName().AsCString(); + break; + + case eValueObjectRepresentationStyleExpressionPath: + GetExpressionPath(strm, false); + cstr = strm.GetString().c_str(); + break; } if (!cstr) |