Fix getreg on osx regression

This commit is contained in:
pancake 2015-11-22 22:01:09 +01:00
parent b5333accaa
commit c8409760e1
2 changed files with 18 additions and 18 deletions

View File

@ -560,21 +560,21 @@ RDebugPid *xnu_get_pid (int pid) {
}
kern_return_t mach_vm_region_recurse (
vm_map_t target_task,
mach_vm_address_t *address,
mach_vm_size_t *size,
natural_t *nesting_depth,
vm_region_recurse_info_t info,
mach_msg_type_number_t *infoCnt
vm_map_t target_task,
mach_vm_address_t *address,
mach_vm_size_t *size,
natural_t *nesting_depth,
vm_region_recurse_info_t info,
mach_msg_type_number_t *infoCnt
);
static const char * unparse_inheritance (vm_inherit_t i) {
switch (i) {
case VM_INHERIT_SHARE: return "share";
case VM_INHERIT_COPY: return "copy";
case VM_INHERIT_NONE: return "none";
default: return "???";
}
switch (i) {
case VM_INHERIT_SHARE: return "share";
case VM_INHERIT_COPY: return "copy";
case VM_INHERIT_NONE: return "none";
default: return "???";
}
}
#ifndef KERNEL_LOWER

View File

@ -116,7 +116,7 @@ static bool xnu_thread_get_gpr(RDebug *dbg, xnu_thread_t *thread) {
}
#endif
rc = thread_get_state (thread->tid, thread->flavor,
(thread_state_t)regs, &thread->count);
(thread_state_t)thread->state, &thread->count);
if (rc != KERN_SUCCESS) {
thread->count = 0;
perror ("thread_get_state");
@ -161,13 +161,13 @@ static bool xnu_fill_info_thread(RDebug *dbg, xnu_thread_t *thread) {
mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT;
thread_identifier_info_data_t identifier_info;
kern_return_t kr = thread_info (thread->tid, THREAD_BASIC_INFO,
(thread_info_t)&thread->basic_info, &count);
(thread_info_t)&thread->basic_info, &count);
if (kr != KERN_SUCCESS) {
eprintf ("Fail to get thread_basic_info\n");
return false;
}
count = THREAD_IDENTIFIER_INFO_COUNT;
kr = thread_info (thread->tid, THREAD_IDENTIFIER_INFO,
count = THREAD_IDENTIFIER_INFO_COUNT;
kr = thread_info (thread->tid, THREAD_IDENTIFIER_INFO,
(thread_info_t)&identifier_info, &count);
if (kr != KERN_SUCCESS) {
eprintf ("Fail to get thread_identifier_info\n");
@ -178,8 +178,8 @@ static bool xnu_fill_info_thread(RDebug *dbg, xnu_thread_t *thread) {
thread->name = strdup ("unknown");
#else
ret_proc = proc_pidinfo (dbg->pid, PROC_PIDTHREADINFO,
identifier_info.thread_handle,
&proc_threadinfo, PROC_PIDTHREADINFO_SIZE);
identifier_info.thread_handle,
&proc_threadinfo, PROC_PIDTHREADINFO_SIZE);
if (ret_proc && proc_threadinfo.pth_name[0]) {
thread->name = strdup (proc_threadinfo.pth_name);
} else {