From 48a100190e562de481c0200aa3fb6c26d3e2b16f Mon Sep 17 00:00:00 2001 From: Han Ming Ong Date: Mon, 17 Dec 2012 20:53:19 +0000 Subject: [PATCH] Send thread name using hex encoding. llvm-svn: 170370 --- .../debugserver/source/MacOSX/MachTask.cpp | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/lldb/tools/debugserver/source/MacOSX/MachTask.cpp b/lldb/tools/debugserver/source/MacOSX/MachTask.cpp index 36825a9bb057..327cb1df6e9f 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachTask.cpp +++ b/lldb/tools/debugserver/source/MacOSX/MachTask.cpp @@ -232,7 +232,7 @@ MachTask::GetMemoryRegionInfo (nub_addr_t addr, DNBRegionInfo *region_info) } while (0) // We should consider moving this into each MacThread. -static void get_threads_profile_data(task_t task, nub_process_t pid, int &num_threads, std::vector &threads_id, std::vector &threads_name, std::vector &threads_used_usec) +static void get_threads_profile_data(task_t task, nub_process_t pid, int &num_threads, std::vector &threads_id, std::vector &threads_name, std::vector &threads_used_usec) { kern_return_t kr; thread_act_array_t threads; @@ -285,7 +285,7 @@ static void get_threads_profile_data(task_t task, nub_process_t pid, int &num_th } #define RAW_HEXBASE std::setfill('0') << std::hex << std::right -#define RAWHEX8(x) RAW_HEXBASE << std::setw(2) << ((uint32_t)((uint8_t)x)) +#define DECIMAL std::dec << std::setfill(' ') std::string MachTask::GetProfileData () { @@ -305,7 +305,7 @@ MachTask::GetProfileData () uint64_t task_used_usec = 0; int num_threads = 0; std::vector threads_id; - std::vector threads_name; + std::vector threads_name; std::vector threads_used_usec; // Get current used time. @@ -343,14 +343,19 @@ MachTask::GetProfileData () profile_data_stream << ',' << threads_id[i]; profile_data_stream << ','; -// // Make sure that thread name doesn't interfere with our delimiter. -// const uint8_t *ubuf8 = (const uint8_t *)(threads_name[i].c_str()); -// int len = threads_name[i].size(); -// for (int i=0; i