aboutsummaryrefslogtreecommitdiff
path: root/lldb/tools/debugserver/source/MacOSX/MachTask.h
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/tools/debugserver/source/MacOSX/MachTask.h
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/tools/debugserver/source/MacOSX/MachTask.h')
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachTask.h134
1 files changed, 68 insertions, 66 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachTask.h b/lldb/tools/debugserver/source/MacOSX/MachTask.h
index d8021e8..2fdb22f 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachTask.h
+++ b/lldb/tools/debugserver/source/MacOSX/MachTask.h
@@ -35,80 +35,82 @@ class MachProcess;
typedef uint64_t MachMallocEventId;
-enum MachMallocEventType
-{
- eMachMallocEventTypeAlloc = 2,
- eMachMallocEventTypeDealloc = 4,
- eMachMallocEventTypeOther = 1
+enum MachMallocEventType {
+ eMachMallocEventTypeAlloc = 2,
+ eMachMallocEventTypeDealloc = 4,
+ eMachMallocEventTypeOther = 1
};
-struct MachMallocEvent
-{
- mach_vm_address_t m_base_address;
- uint64_t m_size;
- MachMallocEventType m_event_type;
- MachMallocEventId m_event_id;
+struct MachMallocEvent {
+ mach_vm_address_t m_base_address;
+ uint64_t m_size;
+ MachMallocEventType m_event_type;
+ MachMallocEventId m_event_id;
};
-class MachTask
-{
+class MachTask {
public:
- //------------------------------------------------------------------
- // Constructors and Destructors
- //------------------------------------------------------------------
- MachTask (MachProcess *process);
- virtual ~MachTask ();
-
- void Clear ();
-
- kern_return_t Suspend ();
- kern_return_t Resume ();
-
- nub_size_t ReadMemory (nub_addr_t addr, nub_size_t size, void *buf);
- nub_size_t WriteMemory (nub_addr_t addr, nub_size_t size, const void *buf);
- int GetMemoryRegionInfo (nub_addr_t addr, DNBRegionInfo *region_info);
- std::string GetProfileData (DNBProfileDataScanType scanType);
-
- nub_addr_t AllocateMemory (nub_size_t size, uint32_t permissions);
- nub_bool_t DeallocateMemory (nub_addr_t addr);
-
- mach_port_t ExceptionPort () const;
- bool ExceptionPortIsValid () const;
- kern_return_t SaveExceptionPortInfo ();
- kern_return_t RestoreExceptionPortInfo ();
- kern_return_t ShutDownExcecptionThread ();
-
- bool StartExceptionThread (DNBError &err);
- nub_addr_t GetDYLDAllImageInfosAddress (DNBError& err);
- kern_return_t BasicInfo (struct task_basic_info *info);
- static kern_return_t BasicInfo (task_t task, struct task_basic_info *info);
- bool IsValid () const;
- static bool IsValid (task_t task);
- static void * ExceptionThread (void *arg);
- task_t TaskPort () const { return m_task; }
- task_t TaskPortForProcessID (DNBError &err, bool force = false);
- static task_t TaskPortForProcessID (pid_t pid, DNBError &err, uint32_t num_retries = 10, uint32_t usec_interval = 10000);
-
- MachProcess * Process () { return m_process; }
- const MachProcess * Process () const { return m_process; }
-
- nub_size_t PageSize ();
+ //------------------------------------------------------------------
+ // Constructors and Destructors
+ //------------------------------------------------------------------
+ MachTask(MachProcess *process);
+ virtual ~MachTask();
+
+ void Clear();
+
+ kern_return_t Suspend();
+ kern_return_t Resume();
+
+ nub_size_t ReadMemory(nub_addr_t addr, nub_size_t size, void *buf);
+ nub_size_t WriteMemory(nub_addr_t addr, nub_size_t size, const void *buf);
+ int GetMemoryRegionInfo(nub_addr_t addr, DNBRegionInfo *region_info);
+ std::string GetProfileData(DNBProfileDataScanType scanType);
+
+ nub_addr_t AllocateMemory(nub_size_t size, uint32_t permissions);
+ nub_bool_t DeallocateMemory(nub_addr_t addr);
+
+ mach_port_t ExceptionPort() const;
+ bool ExceptionPortIsValid() const;
+ kern_return_t SaveExceptionPortInfo();
+ kern_return_t RestoreExceptionPortInfo();
+ kern_return_t ShutDownExcecptionThread();
+
+ bool StartExceptionThread(DNBError &err);
+ nub_addr_t GetDYLDAllImageInfosAddress(DNBError &err);
+ kern_return_t BasicInfo(struct task_basic_info *info);
+ static kern_return_t BasicInfo(task_t task, struct task_basic_info *info);
+ bool IsValid() const;
+ static bool IsValid(task_t task);
+ static void *ExceptionThread(void *arg);
+ task_t TaskPort() const { return m_task; }
+ task_t TaskPortForProcessID(DNBError &err, bool force = false);
+ static task_t TaskPortForProcessID(pid_t pid, DNBError &err,
+ uint32_t num_retries = 10,
+ uint32_t usec_interval = 10000);
+
+ MachProcess *Process() { return m_process; }
+ const MachProcess *Process() const { return m_process; }
+
+ nub_size_t PageSize();
protected:
- MachProcess * m_process; // The mach process that owns this MachTask
- task_t m_task;
- MachVMMemory m_vm_memory; // Special mach memory reading class that will take care of watching for page and region boundaries
- MachException::PortInfo
- m_exc_port_info; // Saved settings for all exception ports
- pthread_t m_exception_thread; // Thread ID for the exception thread in case we need it
- mach_port_t m_exception_port; // Exception port on which we will receive child exceptions
-
- typedef std::map <mach_vm_address_t, size_t> allocation_collection;
- allocation_collection m_allocations;
+ MachProcess *m_process; // The mach process that owns this MachTask
+ task_t m_task;
+ MachVMMemory m_vm_memory; // Special mach memory reading class that will take
+ // care of watching for page and region boundaries
+ MachException::PortInfo
+ m_exc_port_info; // Saved settings for all exception ports
+ pthread_t m_exception_thread; // Thread ID for the exception thread in case we
+ // need it
+ mach_port_t m_exception_port; // Exception port on which we will receive child
+ // exceptions
+
+ typedef std::map<mach_vm_address_t, size_t> allocation_collection;
+ allocation_collection m_allocations;
private:
- MachTask(const MachTask&); // Outlaw
- MachTask& operator=(const MachTask& rhs);// Outlaw
+ MachTask(const MachTask &); // Outlaw
+ MachTask &operator=(const MachTask &rhs); // Outlaw
};
-#endif // __MachTask_h__
+#endif // __MachTask_h__