mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-27 15:14:31 +00:00
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:
1 parent
576105c322
commit
2dec82652e
20 files changed
+571
-3
No files matched your search
@@ -8,9 +8,11 @@
|
||||
|
||||
#include "lldb/API/SBPlatform.h"
|
||||
#include "SBReproducerPrivate.h"
|
||||
#include "lldb/API/SBEnvironment.h"
|
||||
#include "lldb/API/SBError.h"
|
||||
#include "lldb/API/SBFileSpec.h"
|
||||
#include "lldb/API/SBLaunchInfo.h"
|
||||
#include "lldb/API/SBPlatform.h"
|
||||
#include "lldb/API/SBUnixSignals.h"
|
||||
#include "lldb/Host/File.h"
|
||||
#include "lldb/Target/Platform.h"
|
||||
@@ -649,6 +651,17 @@ SBUnixSignals SBPlatform::GetUnixSignals() const {
|
||||
return LLDB_RECORD_RESULT(SBUnixSignals());
|
||||
}
|
||||
|
||||
SBEnvironment SBPlatform::GetEnvironment() {
|
||||
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBEnvironment, SBPlatform, GetEnvironment);
|
||||
PlatformSP platform_sp(GetSP());
|
||||
|
||||
if (platform_sp) {
|
||||
return LLDB_RECORD_RESULT(SBEnvironment(platform_sp->GetEnvironment()));
|
||||
}
|
||||
|
||||
return LLDB_RECORD_RESULT(SBEnvironment());
|
||||
}
|
||||
|
||||
namespace lldb_private {
|
||||
namespace repro {
|
||||
|
||||
@@ -740,6 +753,7 @@ void RegisterMethods<SBPlatform>(Registry &R) {
|
||||
(const char *));
|
||||
LLDB_REGISTER_METHOD(lldb::SBError, SBPlatform, SetFilePermissions,
|
||||
(const char *, uint32_t));
|
||||
LLDB_REGISTER_METHOD(lldb::SBEnvironment, SBPlatform, GetEnvironment, ());
|
||||
LLDB_REGISTER_METHOD_CONST(lldb::SBUnixSignals, SBPlatform, GetUnixSignals,
|
||||
());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user