Author: gclayton Date: Wed Feb 24 14:47:13 2016 New Revision: 261768 URL: http://llvm.org/viewvc/llvm-project?rev=261768&view=rev Log: Removed unused functions.
Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachTask.h lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachTask.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachTask.h?rev=261768&r1=261767&r2=261768&view=diff ============================================================================== --- lldb/trunk/tools/debugserver/source/MacOSX/MachTask.h (original) +++ lldb/trunk/tools/debugserver/source/MacOSX/MachTask.h Wed Feb 24 14:47:13 2016 @@ -93,26 +93,6 @@ public: const MachProcess * Process () const { return m_process; } nub_size_t PageSize (); - - bool HasMallocLoggingEnabled (); - - // enumerate the malloc records for a given address (starting with Mac OS X 10.6 Snow Leopard it should include - // all allocations that *include* address, rather than just those *starting* at address) - bool EnumerateMallocRecords (mach_vm_address_t address, - MachMallocEvent *event_buffer, - uint32_t buffer_size, - uint32_t *count); - - // enumerate every malloc record generated by this task, no matter what the address - bool EnumerateMallocRecords (MachMallocEvent *event_buffer, - uint32_t buffer_size, - uint32_t *count); - - // given a malloc event, report every stack frame that led to this event - bool EnumerateMallocFrames (MachMallocEventId event_id, - mach_vm_address_t *function_addresses_buffer, - uint32_t buffer_size, - uint32_t *count); protected: MachProcess * m_process; // The mach process that owns this MachTask Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm?rev=261768&r1=261767&r2=261768&view=diff ============================================================================== --- lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm (original) +++ lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm Wed Feb 24 14:47:13 2016 @@ -40,7 +40,6 @@ #include "DNBLog.h" #include "MachProcess.h" #include "DNBDataRef.h" -#include "stack_logging.h" #ifdef WITH_SPRINGBOARD @@ -1053,90 +1052,6 @@ MachTask::DeallocateMemory (nub_addr_t a return false; } -static void foundStackLog(mach_stack_logging_record_t record, void *context) { - *((bool*)context) = true; -} - -bool -MachTask::HasMallocLoggingEnabled () -{ - bool found = false; - - __mach_stack_logging_enumerate_records(m_task, 0x0, foundStackLog, &found); - return found; -} - -struct history_enumerator_impl_data -{ - MachMallocEvent *buffer; - uint32_t *position; - uint32_t count; -}; - -static void history_enumerator_impl(mach_stack_logging_record_t record, void* enum_obj) -{ - history_enumerator_impl_data *data = (history_enumerator_impl_data*)enum_obj; - - if (*data->position >= data->count) - return; - - data->buffer[*data->position].m_base_address = record.address; - data->buffer[*data->position].m_size = record.argument; - data->buffer[*data->position].m_event_id = record.stack_identifier; - data->buffer[*data->position].m_event_type = record.type_flags == stack_logging_type_alloc ? eMachMallocEventTypeAlloc : - record.type_flags == stack_logging_type_dealloc ? eMachMallocEventTypeDealloc : - eMachMallocEventTypeOther; - *data->position+=1; -} - -bool -MachTask::EnumerateMallocRecords (MachMallocEvent *event_buffer, - uint32_t buffer_size, - uint32_t *count) -{ - return EnumerateMallocRecords(0, - event_buffer, - buffer_size, - count); -} - -bool -MachTask::EnumerateMallocRecords (mach_vm_address_t address, - MachMallocEvent *event_buffer, - uint32_t buffer_size, - uint32_t *count) -{ - if (!event_buffer || !count) - return false; - - if (buffer_size == 0) - return false; - - *count = 0; - history_enumerator_impl_data data = { event_buffer, count, buffer_size }; - __mach_stack_logging_enumerate_records(m_task, address, history_enumerator_impl, &data); - return (*count > 0); -} - -bool -MachTask::EnumerateMallocFrames (MachMallocEventId event_id, - mach_vm_address_t *function_addresses_buffer, - uint32_t buffer_size, - uint32_t *count) -{ - if (!function_addresses_buffer || !count) - return false; - - if (buffer_size == 0) - return false; - - __mach_stack_logging_frames_for_uniqued_stack(m_task, event_id, &function_addresses_buffer[0], buffer_size, count); - *count -= 1; - if (function_addresses_buffer[*count-1] < PageSize()) - *count -= 1; - return (*count > 0); -} - nub_size_t MachTask::PageSize () { _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits