aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Target/ProcessInfo.cpp
diff options
context:
space:
mode:
authorKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
committerKate Stone <katherine.stone@apple.com>2016-09-06 20:57:50 +0000
commitb9c1b51e45b845debb76d8658edabca70ca56079 (patch)
treedfcb5a13ef2b014202340f47036da383eaee74aa /lldb/source/Target/ProcessInfo.cpp
parentd5aa73376966339caad04013510626ec2e42c760 (diff)
downloadllvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip
llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz
llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.bz2
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
Diffstat (limited to 'lldb/source/Target/ProcessInfo.cpp')
-rw-r--r--lldb/source/Target/ProcessInfo.cpp189
1 files changed, 76 insertions, 113 deletions
diff --git a/lldb/source/Target/ProcessInfo.cpp b/lldb/source/Target/ProcessInfo.cpp
index b57fd23..be537c1 100644
--- a/lldb/source/Target/ProcessInfo.cpp
+++ b/lldb/source/Target/ProcessInfo.cpp
@@ -21,138 +21,101 @@
using namespace lldb;
using namespace lldb_private;
-ProcessInfo::ProcessInfo () :
- m_executable (),
- m_arguments (),
- m_environment (),
- m_uid (UINT32_MAX),
- m_gid (UINT32_MAX),
- m_arch(),
- m_pid (LLDB_INVALID_PROCESS_ID)
-{
+ProcessInfo::ProcessInfo()
+ : m_executable(), m_arguments(), m_environment(), m_uid(UINT32_MAX),
+ m_gid(UINT32_MAX), m_arch(), m_pid(LLDB_INVALID_PROCESS_ID) {}
+
+ProcessInfo::ProcessInfo(const char *name, const ArchSpec &arch,
+ lldb::pid_t pid)
+ : m_executable(name, false), m_arguments(), m_environment(),
+ m_uid(UINT32_MAX), m_gid(UINT32_MAX), m_arch(arch), m_pid(pid) {}
+
+void ProcessInfo::Clear() {
+ m_executable.Clear();
+ m_arguments.Clear();
+ m_environment.Clear();
+ m_uid = UINT32_MAX;
+ m_gid = UINT32_MAX;
+ m_arch.Clear();
+ m_pid = LLDB_INVALID_PROCESS_ID;
}
-ProcessInfo::ProcessInfo (const char *name, const ArchSpec &arch, lldb::pid_t pid) :
- m_executable (name, false),
- m_arguments (),
- m_environment(),
- m_uid (UINT32_MAX),
- m_gid (UINT32_MAX),
- m_arch (arch),
- m_pid (pid)
-{
+const char *ProcessInfo::GetName() const {
+ return m_executable.GetFilename().GetCString();
}
-void
-ProcessInfo::Clear ()
-{
- m_executable.Clear();
- m_arguments.Clear();
- m_environment.Clear();
- m_uid = UINT32_MAX;
- m_gid = UINT32_MAX;
- m_arch.Clear();
- m_pid = LLDB_INVALID_PROCESS_ID;
-}
-
-const char *
-ProcessInfo::GetName() const
-{
- return m_executable.GetFilename().GetCString();
+size_t ProcessInfo::GetNameLength() const {
+ return m_executable.GetFilename().GetLength();
}
-size_t
-ProcessInfo::GetNameLength() const
-{
- return m_executable.GetFilename().GetLength();
-}
+void ProcessInfo::Dump(Stream &s, Platform *platform) const {
+ s << "Executable: " << GetName() << "\n";
+ s << "Triple: ";
+ m_arch.DumpTriple(s);
+ s << "\n";
-void
-ProcessInfo::Dump (Stream &s, Platform *platform) const
-{
- s << "Executable: " << GetName() << "\n";
- s << "Triple: ";
- m_arch.DumpTriple(s);
- s << "\n";
+ s << "Arguments:\n";
+ m_arguments.Dump(s);
- s << "Arguments:\n";
- m_arguments.Dump(s);
-
- s << "Environment:\n";
- m_environment.Dump(s, "env");
+ s << "Environment:\n";
+ m_environment.Dump(s, "env");
}
-void
-ProcessInfo::SetExecutableFile (const FileSpec &exe_file, bool add_exe_file_as_first_arg)
-{
- if (exe_file)
- {
- m_executable = exe_file;
- if (add_exe_file_as_first_arg)
- {
- char filename[PATH_MAX];
- if (exe_file.GetPath(filename, sizeof(filename)))
- m_arguments.InsertArgumentAtIndex (0, filename);
- }
- }
- else
- {
- m_executable.Clear();
+void ProcessInfo::SetExecutableFile(const FileSpec &exe_file,
+ bool add_exe_file_as_first_arg) {
+ if (exe_file) {
+ m_executable = exe_file;
+ if (add_exe_file_as_first_arg) {
+ char filename[PATH_MAX];
+ if (exe_file.GetPath(filename, sizeof(filename)))
+ m_arguments.InsertArgumentAtIndex(0, filename);
}
+ } else {
+ m_executable.Clear();
+ }
}
-const char *
-ProcessInfo::GetArg0 () const
-{
- return (m_arg0.empty() ? nullptr : m_arg0.c_str());
+const char *ProcessInfo::GetArg0() const {
+ return (m_arg0.empty() ? nullptr : m_arg0.c_str());
}
-void
-ProcessInfo::SetArg0 (const char *arg)
-{
- if (arg && arg[0])
- m_arg0 = arg;
- else
- m_arg0.clear();
+void ProcessInfo::SetArg0(const char *arg) {
+ if (arg && arg[0])
+ m_arg0 = arg;
+ else
+ m_arg0.clear();
}
-void
-ProcessInfo::SetArguments (char const **argv, bool first_arg_is_executable)
-{
- m_arguments.SetArguments (argv);
-
- // Is the first argument the executable?
- if (first_arg_is_executable)
- {
- const char *first_arg = m_arguments.GetArgumentAtIndex (0);
- if (first_arg)
- {
- // Yes the first argument is an executable, set it as the executable
- // in the launch options. Don't resolve the file path as the path
- // could be a remote platform path
- const bool resolve = false;
- m_executable.SetFile(first_arg, resolve);
- }
+void ProcessInfo::SetArguments(char const **argv,
+ bool first_arg_is_executable) {
+ m_arguments.SetArguments(argv);
+
+ // Is the first argument the executable?
+ if (first_arg_is_executable) {
+ const char *first_arg = m_arguments.GetArgumentAtIndex(0);
+ if (first_arg) {
+ // Yes the first argument is an executable, set it as the executable
+ // in the launch options. Don't resolve the file path as the path
+ // could be a remote platform path
+ const bool resolve = false;
+ m_executable.SetFile(first_arg, resolve);
}
+ }
}
-void
-ProcessInfo::SetArguments (const Args& args, bool first_arg_is_executable)
-{
- // Copy all arguments
- m_arguments = args;
-
- // Is the first argument the executable?
- if (first_arg_is_executable)
- {
- const char *first_arg = m_arguments.GetArgumentAtIndex (0);
- if (first_arg)
- {
- // Yes the first argument is an executable, set it as the executable
- // in the launch options. Don't resolve the file path as the path
- // could be a remote platform path
- const bool resolve = false;
- m_executable.SetFile(first_arg, resolve);
- }
+void ProcessInfo::SetArguments(const Args &args, bool first_arg_is_executable) {
+ // Copy all arguments
+ m_arguments = args;
+
+ // Is the first argument the executable?
+ if (first_arg_is_executable) {
+ const char *first_arg = m_arguments.GetArgumentAtIndex(0);
+ if (first_arg) {
+ // Yes the first argument is an executable, set it as the executable
+ // in the launch options. Don't resolve the file path as the path
+ // could be a remote platform path
+ const bool resolve = false;
+ m_executable.SetFile(first_arg, resolve);
}
+ }
}