6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
8
9
- #include < fcntl.h>
10
- #include < sstream>
11
- #include < sys/procfs.h>
12
9
#include " lldb/Host/Host.h"
13
10
#include " lldb/Host/linux/Support.h"
14
11
#include " lldb/Utility/LLDBLog.h"
15
12
#include " lldb/Utility/Log.h"
16
13
#include " lldb/Utility/ProcessInfo.h"
17
14
#include " lldb/Utility/Status.h"
18
15
#include " llvm/BinaryFormat/XCOFF.h"
16
+ #include < sys/procfs.h>
19
17
20
18
using namespace llvm ;
21
19
using namespace lldb ;
@@ -101,12 +99,12 @@ static bool GetExePathAndArch(::pid_t pid, ProcessInstanceInfo &process_info) {
101
99
auto BufferOrError = getProcFile (pid, " psinfo" );
102
100
if (!BufferOrError)
103
101
return false ;
104
-
102
+
105
103
std::unique_ptr<llvm::MemoryBuffer> PsinfoBuffer = std::move (*BufferOrError);
106
104
// Ensure there's enough data for psinfoData
107
- if (PsinfoBuffer->getBufferSize () < sizeof (psinfoData))
105
+ if (PsinfoBuffer->getBufferSize () < sizeof (psinfoData))
108
106
return false ;
109
-
107
+
110
108
std::memcpy (&psinfoData, PsinfoBuffer->getBufferStart (), sizeof (psinfoData));
111
109
llvm::StringRef PathRef (&(psinfoData.pr_psargs [0 ]));
112
110
if (!PathRef.empty ()) {
@@ -128,7 +126,7 @@ static bool GetProcessAndStatInfo(::pid_t pid,
128
126
process_info.Clear ();
129
127
process_info.SetProcessID (pid);
130
128
131
- if (!GetExePathAndArch (pid, process_info))
129
+ if (!GetExePathAndArch (pid, process_info))
132
130
return false ;
133
131
// Get User and Group IDs and get tracer pid.
134
132
if (!GetStatusInfo (pid, process_info, State, tracerpid, tgid))
0 commit comments