diff options
| author | Pavel Labath <pavel@labath.sk> | 2021-10-05 08:29:16 +0200 |
|---|---|---|
| committer | Pavel Labath <pavel@labath.sk> | 2021-10-05 08:35:18 +0200 |
| commit | 93c1b3caf052f6575abffd29ae53441db2849534 (patch) | |
| tree | b020682d6a7d36c62bee7d7e1606686d86e93690 /lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | |
| parent | 3e9d04f7e422c3e62d9adac506df8e7d42acc206 (diff) | |
[lldb] Remove some anonymous namespaces
.. and reduce the scope of others. They don't follow llvm coding
standards (which say they should be used only when the same effect
cannot be achieved with the static keyword), and they set a bad example.
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index 8c45796ae0b3..279ffb1f2a9c 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -107,8 +107,7 @@ static bool ProcessVmReadvSupported() { return is_supported; } -namespace { -void MaybeLogLaunchInfo(const ProcessLaunchInfo &info) { +static void MaybeLogLaunchInfo(const ProcessLaunchInfo &info) { Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS)); if (!log) return; @@ -134,7 +133,7 @@ void MaybeLogLaunchInfo(const ProcessLaunchInfo &info) { LLDB_LOG(log, "arg {0}: '{1}'", i, *args); } -void DisplayBytes(StreamString &s, void *bytes, uint32_t count) { +static void DisplayBytes(StreamString &s, void *bytes, uint32_t count) { uint8_t *ptr = (uint8_t *)bytes; const uint32_t loop_count = std::min<uint32_t>(DEBUG_PTRACE_MAXBYTES, count); for (uint32_t i = 0; i < loop_count; i++) { @@ -143,7 +142,7 @@ void DisplayBytes(StreamString &s, void *bytes, uint32_t count) { } } -void PtraceDisplayBytes(int &req, void *data, size_t data_size) { +static void PtraceDisplayBytes(int &req, void *data, size_t data_size) { Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PTRACE)); if (!log) return; @@ -193,7 +192,6 @@ void PtraceDisplayBytes(int &req, void *data, size_t data_size) { static constexpr unsigned k_ptrace_word_size = sizeof(void *); static_assert(sizeof(long) >= k_ptrace_word_size, "Size of long must be larger than ptrace word size"); -} // end of anonymous namespace // Simple helper function to ensure flags are enabled on the given file // descriptor. |
