Revert "[lldb] [gdb-remote] Support getting siginfo via API"
This reverts commit 1a8f60f5f5.
The API requires further work.
This commit is contained in:
@@ -1317,50 +1317,3 @@ lldb_private::Thread *SBThread::operator->() {
|
||||
lldb_private::Thread *SBThread::get() {
|
||||
return m_opaque_sp->GetThreadSP().get();
|
||||
}
|
||||
|
||||
SBValue SBThread::GetSiginfo(SBError &error) {
|
||||
LLDB_INSTRUMENT_VA(this, error);
|
||||
|
||||
SBValue value;
|
||||
SBProcess process = GetProcess();
|
||||
if (!process.IsValid()) {
|
||||
error.SetErrorString("no process");
|
||||
return value;
|
||||
}
|
||||
SBTarget target = process.GetTarget();
|
||||
if (!target.IsValid()) {
|
||||
error.SetErrorString("unable to get target");
|
||||
return value;
|
||||
}
|
||||
SBPlatform platform = target.GetPlatform();
|
||||
if (!platform.IsValid()) {
|
||||
error.SetErrorString("unable to get platform");
|
||||
return value;
|
||||
}
|
||||
CompilerType type = platform.GetSP()->GetSiginfoType(
|
||||
target.GetSP()->GetArchitecture().GetTriple());
|
||||
if (!type.IsValid()) {
|
||||
error.SetErrorString("no siginfo_t for the platform");
|
||||
return value;
|
||||
}
|
||||
llvm::Optional<uint64_t> type_size = type.GetByteSize(nullptr);
|
||||
assert(type_size);
|
||||
ThreadSP thread_sp = m_opaque_sp->GetThreadSP();
|
||||
if (!thread_sp) {
|
||||
error.SetErrorString("unable to get thread");
|
||||
return value;
|
||||
}
|
||||
llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>> data =
|
||||
thread_sp->GetSiginfo(type_size.getValue());
|
||||
if (!data) {
|
||||
error.SetErrorString(llvm::toString(data.takeError()).c_str());
|
||||
return value;
|
||||
}
|
||||
SBData sb_data;
|
||||
sb_data.SetData(error, data.get()->getBufferStart(),
|
||||
data.get()->getBufferSize(), process.GetByteOrder(), 0);
|
||||
if (!sb_data.IsValid())
|
||||
return value;
|
||||
|
||||
return target.CreateValueFromData("siginfo", sb_data, type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user