diff --git a/libr/debug/p/native/xnu/xnu_debug.c b/libr/debug/p/native/xnu/xnu_debug.c index 409d77abb7..59d20723c6 100644 --- a/libr/debug/p/native/xnu/xnu_debug.c +++ b/libr/debug/p/native/xnu/xnu_debug.c @@ -540,13 +540,6 @@ static vm_prot_t unix_prot_to_darwin(int prot) { int xnu_map_protect (RDebug *dbg, ut64 addr, int size, int perms) { int ret; task_t task = pid_to_task (dbg->tid); - // TODO: align pointers -#if 0 - xnu_thread_t *th = get_xnu_thread (dbg, dbg->tid); - if (!th) { - return false; - } -#endif #define xwr2rwx(x) ((x&1)<<2) | (x&2) | ((x&4)>>2) int xnu_perms = xwr2rwx (perms); ret = mach_vm_protect (task, (vm_address_t)addr, (vm_size_t)size, (boolean_t)0, xnu_perms); //VM_PROT_COPY | perms); diff --git a/libr/debug/p/native/xnu/xnu_threads.c b/libr/debug/p/native/xnu/xnu_threads.c index f870d8870f..e9fe4a0bb9 100644 --- a/libr/debug/p/native/xnu/xnu_threads.c +++ b/libr/debug/p/native/xnu/xnu_threads.c @@ -224,9 +224,8 @@ static bool xnu_fill_info_thread (RDebug *dbg, xnu_thread_t *thread) { #endif mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; thread_identifier_info_data_t identifier_info; - kern_return_t kr = - thread_info (thread->port, THREAD_BASIC_INFO, - (thread_info_t)&thread->basic_info, &count); + kern_return_t kr = thread_info (thread->port, THREAD_BASIC_INFO, + (thread_info_t)&thread->basic_info, &count); if (kr != KERN_SUCCESS) { eprintf ("Fail to get thread_basic_info\n"); return false; @@ -238,6 +237,7 @@ static bool xnu_fill_info_thread (RDebug *dbg, xnu_thread_t *thread) { eprintf ("Fail to get thread_identifier_info\n"); return false; } + R_FREE (thread->name); #if TARGET_OS_IPHONE // TODO proc_pidinfo here thread->name = strdup ("unknown"); @@ -366,12 +366,8 @@ static int xnu_update_thread_list (RDebug *dbg) { } } // once that is over we need to free the buffer - kr = vm_deallocate (mach_task_self (), (mach_vm_address_t)thread_list, - thread_count * sizeof (thread_t)); - if (kr != KERN_SUCCESS) { - eprintf ("error: vm_deallocate xnu_update_thread_list\n"); - return false; - } + (void)vm_deallocate (mach_task_self (), (mach_vm_address_t)thread_list, + thread_count * sizeof (thread_t)); return true; } #endif