comparison agent/src/os/bsd/MacosxDebuggerLocal.m @ 10162:e4614b063fe1

8013364: SA-JDI exceptions caused by lack of permissions on OSX should be more verbose about issue cause Reviewed-by: coleenp, rbackman
author sla
date Tue, 30 Apr 2013 21:47:02 +0200
parents 9f96b7a853bc
children f2294a37e723
comparison
equal deleted inserted replaced
10160:ed5a590835a4 10162:e4614b063fe1
705 705
706 kern_return_t result; 706 kern_return_t result;
707 task_t gTask = 0; 707 task_t gTask = 0;
708 result = task_for_pid(mach_task_self(), jpid, &gTask); 708 result = task_for_pid(mach_task_self(), jpid, &gTask);
709 if (result != KERN_SUCCESS) { 709 if (result != KERN_SUCCESS) {
710 print_error("attach: task_for_pid(%d) failed (%d)\n", (int)jpid, result); 710 print_error("attach: task_for_pid(%d) failed: '%s' (%d)\n", (int)jpid, mach_error_string(result), result);
711 THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process"); 711 THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process. Could be caused by an incorrect pid or lack of privileges.");
712 } 712 }
713 putTask(env, this_obj, gTask); 713 putTask(env, this_obj, gTask);
714 714
715 // use ptrace to stop the process 715 // use ptrace to stop the process
716 // on os x, ptrace only needs to be called on the process, not the individual threads 716 // on os x, ptrace only needs to be called on the process, not the individual threads