mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 10:58:11 +08:00
Revert "Add StructuredData plugin type; showcase with new DarwinLog feature"
This reverts commit 1d885845d1451e7b232f53fba2e36be67aadabd8. llvm-svn: 279200
This commit is contained in:
@@ -56,7 +56,6 @@
|
||||
#include "lldb/Target/RegisterContext.h"
|
||||
#include "lldb/Target/SectionLoadList.h"
|
||||
#include "lldb/Target/StopInfo.h"
|
||||
#include "lldb/Target/StructuredDataPlugin.h"
|
||||
#include "lldb/Target/Target.h"
|
||||
#include "lldb/Target/Thread.h"
|
||||
#include "lldb/Utility/AnsiTerminal.h"
|
||||
@@ -1477,15 +1476,14 @@ Debugger::GetProcessSTDERR (Process *process, Stream *stream)
|
||||
return total_bytes;
|
||||
}
|
||||
|
||||
|
||||
// This function handles events that were broadcast by the process.
|
||||
void
|
||||
Debugger::HandleProcessEvent (const EventSP &event_sp)
|
||||
{
|
||||
using namespace lldb;
|
||||
const uint32_t event_type = event_sp->GetType();
|
||||
ProcessSP process_sp = (event_type == Process::eBroadcastBitStructuredData)
|
||||
? EventDataStructuredData::GetProcessFromEvent(event_sp.get())
|
||||
: Process::ProcessEventData::GetProcessFromEvent(event_sp.get());
|
||||
ProcessSP process_sp = Process::ProcessEventData::GetProcessFromEvent(event_sp.get());
|
||||
|
||||
StreamSP output_stream_sp = GetAsyncOutputStream();
|
||||
StreamSP error_stream_sp = GetAsyncErrorStream();
|
||||
@@ -1500,9 +1498,6 @@ Debugger::HandleProcessEvent (const EventSP &event_sp)
|
||||
const bool got_state_changed = (event_type & Process::eBroadcastBitStateChanged) != 0;
|
||||
const bool got_stdout = (event_type & Process::eBroadcastBitSTDOUT) != 0;
|
||||
const bool got_stderr = (event_type & Process::eBroadcastBitSTDERR) != 0;
|
||||
const bool got_structured_data = (event_type &
|
||||
Process::eBroadcastBitStructuredData) != 0;
|
||||
|
||||
if (got_state_changed)
|
||||
{
|
||||
StateType event_state = Process::ProcessEventData::GetStateFromEvent (event_sp.get());
|
||||
@@ -1527,45 +1522,6 @@ Debugger::HandleProcessEvent (const EventSP &event_sp)
|
||||
GetProcessSTDERR (process_sp.get(), error_stream_sp.get());
|
||||
}
|
||||
|
||||
// Give structured data events an opportunity to display.
|
||||
if (got_structured_data)
|
||||
{
|
||||
StructuredDataPluginSP plugin_sp =
|
||||
EventDataStructuredData::GetPluginFromEvent(event_sp.get());
|
||||
if (plugin_sp)
|
||||
{
|
||||
auto structured_data_sp =
|
||||
EventDataStructuredData::GetObjectFromEvent(event_sp.get());
|
||||
if (output_stream_sp)
|
||||
{
|
||||
StreamString content_stream;
|
||||
Error error = plugin_sp->GetDescription(structured_data_sp,
|
||||
content_stream);
|
||||
if (error.Success())
|
||||
{
|
||||
if (!content_stream.GetString().empty())
|
||||
{
|
||||
// Add newline.
|
||||
content_stream.PutChar('\n');
|
||||
content_stream.Flush();
|
||||
|
||||
// Print it.
|
||||
output_stream_sp->PutCString(content_stream
|
||||
.GetString().c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error_stream_sp->Printf("Failed to print structured "
|
||||
"data with plugin %s: %s",
|
||||
plugin_sp->GetPluginName()
|
||||
.AsCString(),
|
||||
error.AsCString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Now display any stopped state changes after any STDIO
|
||||
if (got_state_changed && state_is_stopped)
|
||||
{
|
||||
@@ -1630,8 +1586,7 @@ Debugger::DefaultEventHandler()
|
||||
BroadcastEventSpec process_event_spec (broadcaster_class_process,
|
||||
Process::eBroadcastBitStateChanged |
|
||||
Process::eBroadcastBitSTDOUT |
|
||||
Process::eBroadcastBitSTDERR |
|
||||
Process::eBroadcastBitStructuredData);
|
||||
Process::eBroadcastBitSTDERR);
|
||||
|
||||
BroadcastEventSpec thread_event_spec (broadcaster_class_thread,
|
||||
Thread::eBroadcastBitStackChanged |
|
||||
|
||||
Reference in New Issue
Block a user