66//
77// ===----------------------------------------------------------------------===//
88
9- #include < fcntl.h>
10- #include < sstream>
11- #include < sys/procfs.h>
129#include " lldb/Host/Host.h"
1310#include " lldb/Host/linux/Support.h"
1411#include " lldb/Utility/LLDBLog.h"
1512#include " lldb/Utility/Log.h"
1613#include " lldb/Utility/ProcessInfo.h"
1714#include " lldb/Utility/Status.h"
1815#include " llvm/BinaryFormat/XCOFF.h"
16+ #include < sys/procfs.h>
1917
2018using namespace llvm ;
2119using namespace lldb ;
@@ -101,12 +99,12 @@ static bool GetExePathAndArch(::pid_t pid, ProcessInstanceInfo &process_info) {
10199 auto BufferOrError = getProcFile (pid, " psinfo" );
102100 if (!BufferOrError)
103101 return false ;
104-
102+
105103 std::unique_ptr<llvm::MemoryBuffer> PsinfoBuffer = std::move (*BufferOrError);
106104 // Ensure there's enough data for psinfoData
107- if (PsinfoBuffer->getBufferSize () < sizeof (psinfoData))
105+ if (PsinfoBuffer->getBufferSize () < sizeof (psinfoData))
108106 return false ;
109-
107+
110108 std::memcpy (&psinfoData, PsinfoBuffer->getBufferStart (), sizeof (psinfoData));
111109 llvm::StringRef PathRef (&(psinfoData.pr_psargs [0 ]));
112110 if (!PathRef.empty ()) {
@@ -128,7 +126,7 @@ static bool GetProcessAndStatInfo(::pid_t pid,
128126 process_info.Clear ();
129127 process_info.SetProcessID (pid);
130128
131- if (!GetExePathAndArch (pid, process_info))
129+ if (!GetExePathAndArch (pid, process_info))
132130 return false ;
133131 // Get User and Group IDs and get tracer pid.
134132 if (!GetStatusInfo (pid, process_info, State, tracerpid, tgid))
0 commit comments