Create basic SBEnvironment class

Summary: Inspired by https://reviews.llvm.org/D74636, I'm introducing a basic version of Environment in the API. More functionalities can be added as needed.

Reviewers: labath, clayborg

Subscribers: mgorny, lldb-commits, diazhector98

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D76111
This commit is contained in:
Walter Erquinigo
2020-03-12 17:20:01 -07:00
parent 4ec6ebabfc
commit 34c0759f84
20 changed files with 572 additions and 3 deletions

View File

@@ -13,6 +13,7 @@
#include "lldb/API/SBBreakpoint.h"
#include "lldb/API/SBDebugger.h"
#include "lldb/API/SBEnvironment.h"
#include "lldb/API/SBEvent.h"
#include "lldb/API/SBExpressionOptions.h"
#include "lldb/API/SBFileSpec.h"
@@ -2388,6 +2389,17 @@ void SBTarget::SetLaunchInfo(const lldb::SBLaunchInfo &launch_info) {
m_opaque_sp->SetProcessLaunchInfo(launch_info.ref());
}
SBEnvironment SBTarget::GetEnvironment() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBEnvironment, SBTarget, GetEnvironment);
TargetSP target_sp(GetSP());
if (target_sp) {
return LLDB_RECORD_RESULT(SBEnvironment(target_sp->GetEnvironment()));
}
return LLDB_RECORD_RESULT(SBEnvironment());
}
namespace lldb_private {
namespace repro {
@@ -2643,6 +2655,7 @@ void RegisterMethods<SBTarget>(Registry &R) {
LLDB_REGISTER_METHOD(lldb::SBInstructionList, SBTarget,
GetInstructionsWithFlavor,
(lldb::addr_t, const char *, const void *, size_t));
LLDB_REGISTER_METHOD(lldb::SBEnvironment, SBTarget, GetEnvironment, ());
}
}