Skip to content

Commit b19beed

Browse files
Additional comments
1 parent 7c1d762 commit b19beed

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

lldb/source/Plugins/Platform/AIX/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
add_definitions("-D_ALL_SOURCE")
2-
31
add_lldb_library(lldbPluginPlatformAIX PLUGIN
42
PlatformAIX.cpp
53

@@ -11,3 +9,5 @@ add_lldb_library(lldbPluginPlatformAIX PLUGIN
119
lldbTarget
1210
lldbPluginPlatformPOSIX
1311
)
12+
13+
target_compile_definitions(lldbPluginPlatformAIX PRIVATE "-D_ALL_SOURCE")

lldb/source/Plugins/Platform/AIX/PlatformAIX.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ constexpr int MapAnonymous = 0x10;
3737
#include <sys/mman.h>
3838
static_assert(MapVariable == MAP_VARIABLE);
3939
static_assert(MapPrivate == MAP_PRIVATE);
40-
static_assert(MapAnonymous = MAP_ANONYMOUS);
40+
static_assert(MapAnonymous == MAP_ANONYMOUS);
4141
#endif
4242

4343
using namespace lldb;
@@ -142,10 +142,13 @@ MmapArgList PlatformAIX::GetMmapArgumentList(const ArchSpec &arch, addr_t addr,
142142
addr_t length, unsigned prot,
143143
unsigned flags, addr_t fd,
144144
addr_t offset) {
145-
unsigned flags_platform = 0;
146-
#if defined(_AIX)
147-
flags_platform = MapPrivate | MapVariable | MapAnon;
148-
#endif
145+
unsigned flags_platform = MapVariable;
146+
147+
if (flags & eMmapFlagsPrivate)
148+
flags_platform |= MapPrivate;
149+
if (flags & eMmapFlagsAnon)
150+
flags_platform |= MapAnonymous;
151+
149152
MmapArgList args({addr, length, prot, flags_platform, fd, offset});
150153
return args;
151154
}

lldb/source/Plugins/Platform/AIX/PlatformAIX.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
#include "Plugins/Platform/POSIX/PlatformPOSIX.h"
1313
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
1414

15-
namespace lldb_private {
16-
namespace platform_aix {
15+
namespace lldb_private::platform_aix {
1716

1817
class PlatformAIX : public PlatformPOSIX {
1918
public:
@@ -64,7 +63,6 @@ class PlatformAIX : public PlatformPOSIX {
6463
std::unique_ptr<TypeSystemClang> m_type_system_up;
6564
};
6665

67-
} // namespace platform_aix
68-
} // namespace lldb_private
66+
} // namespace lldb_private::platform_aix
6967

7068
#endif // LLDB_SOURCE_PLUGINS_PLATFORM_AIX_PLATFORMAIX_H

0 commit comments

Comments
 (0)