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