[lldb] Expose structured command diagnostics via the SBAPI. (#112109)
This allows IDEs to render LLDB expression diagnostics to their liking without relying on characterprecise ASCII art from LLDB. It is exposed as a versioned SBStructuredData object, since it is expected that this may need to be tweaked based on actual usage.
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
#include "lldb/API/SBError.h"
|
||||
#include "lldb/API/SBFile.h"
|
||||
#include "lldb/API/SBStream.h"
|
||||
#include "lldb/API/SBStructuredData.h"
|
||||
#include "lldb/Core/StructuredDataImpl.h"
|
||||
#include "lldb/Interpreter/CommandReturnObject.h"
|
||||
#include "lldb/Utility/ConstString.h"
|
||||
#include "lldb/Utility/Instrumentation.h"
|
||||
@@ -96,6 +98,15 @@ const char *SBCommandReturnObject::GetError() {
|
||||
return output.AsCString(/*value_if_empty*/ "");
|
||||
}
|
||||
|
||||
SBStructuredData SBCommandReturnObject::GetErrorData() {
|
||||
LLDB_INSTRUMENT_VA(this);
|
||||
|
||||
StructuredData::ObjectSP data(ref().GetErrorData());
|
||||
SBStructuredData sb_data;
|
||||
sb_data.m_impl_up->SetObjectSP(data);
|
||||
return sb_data;
|
||||
}
|
||||
|
||||
size_t SBCommandReturnObject::GetOutputSize() {
|
||||
LLDB_INSTRUMENT_VA(this);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user