Ticket #41140: valgrind-osx-106-327745.patch
File valgrind-osx-106-327745.patch, 14.5 KB (added by cooljeanius (Eric Gallager), 11 years ago) |
---|
-
coregrind/m_syswrap/priv_syswrap-darwin.h
diff -Naur a/coregrind/m_syswrap/priv_syswrap-darwin.h b/coregrind/m_syswrap/priv_syswrap-darwin.h
a b 344 344 DECL_TEMPLATE(darwin, fchmod_extended); // 283 345 345 DECL_TEMPLATE(darwin, access_extended); // 284 346 346 DECL_TEMPLATE(darwin, settid); // 285 347 // NYI gettid286347 DECL_TEMPLATE(darwin, gettid); // 286 348 348 // NYI setsgroups 287 349 349 // NYI getsgroups 288 350 350 // NYI setwgroups 289 … … 354 354 // NYI identitysvc 293 355 355 // NYI shared_region_check_np 294 356 356 // NYI shared_region_map_np 295 357 #if DARWIN_VERS >= DARWIN_10_6 358 // NYI vm_pressure_monitor 296 359 // NYI psynch_rw_longrdlock 297 360 // NYI psynch_rw_yieldwrlock 298 361 // NYI psynch_rw_downgrade 299 362 // NYI psynch_rw_upgrade 300 363 DECL_TEMPLATE(darwin, psynch_mutexwait); // 301 364 DECL_TEMPLATE(darwin, psynch_mutexdrop); // 302 365 DECL_TEMPLATE(darwin, psynch_cvbroad); // 303 366 DECL_TEMPLATE(darwin, psynch_cvsignal); // 304 367 DECL_TEMPLATE(darwin, psynch_cvwait); // 305 368 DECL_TEMPLATE(darwin, psynch_rw_rdlock); // 306 369 DECL_TEMPLATE(darwin, psynch_rw_wrlock); // 307 370 DECL_TEMPLATE(darwin, psynch_rw_unlock); // 308 371 // NYI psynch_rw_unlock2 309 372 #else 357 373 // old load_shared_file 358 374 // old reset_shared_file 359 375 // old new_system_shared_regions 360 376 // old shared_region_map_file_np 361 377 // old shared_region_make_private_np 362 DECL_TEMPLATE(darwin, psynch_mutexwait); // 301 // new in 10.7 ? 363 DECL_TEMPLATE(darwin, psynch_mutexdrop); // 302 // new in 10.7 ? 364 DECL_TEMPLATE(darwin, psynch_cvbroad); // 303 // new in 10.7 ? 365 DECL_TEMPLATE(darwin, psynch_cvsignal); // 304 // new in 10.7 ? 366 DECL_TEMPLATE(darwin, psynch_cvwait); // 305 // new in 10.7 ? 367 DECL_TEMPLATE(darwin, psynch_rw_rdlock); // 306 // new in 10.7 ? 368 DECL_TEMPLATE(darwin, psynch_rw_wrlock); // 307 // new in 10.7 ? 369 DECL_TEMPLATE(darwin, psynch_rw_unlock); // 308 // new in 10.7 ? 378 // NYI __pthread_mutex_destroy 301 379 // NYI __pthread_mutex_init 302 380 // NYI __pthread_mutex_lock 303 381 // NYI __pthread_mutex_trylock 304 382 // NYI __pthread_mutex_unlock 305 383 // NYI __pthread_cond_init 306 384 // NYI __pthread_cond_destroy 307 385 // NYI __pthread_cond_broadcast 308 370 386 // NYI __pthread_cond_signal 309 387 #endif 371 388 // NYI getsid 310 372 389 // NYI settid_with_pid 311 373 DECL_TEMPLATE(darwin, psynch_cvclrprepost); // 312 // new in 10.7 ? 390 #if DARWIN_VERS >= DARWIN_10_7 391 DECL_TEMPLATE(darwin, psynch_cvclrprepost); // 312 392 #else 393 // NYI __pthread_cond_timedwait 312 394 #endif 374 395 // NYI aio_fsync 313 375 396 DECL_TEMPLATE(darwin, aio_return); // 314 376 397 DECL_TEMPLATE(darwin, aio_suspend); // 315 … … 394 415 DECL_TEMPLATE(darwin, __pthread_canceled); // 333 395 416 DECL_TEMPLATE(darwin, __semwait_signal); // 334 396 417 // old utrace 397 #if DARWIN_VERS >= DARWIN_10_6398 418 DECL_TEMPLATE(darwin, proc_info); // 336 399 #endif400 419 DECL_TEMPLATE(darwin, sendfile); // 337 401 420 DECL_TEMPLATE(darwin, stat64); // 338 402 421 DECL_TEMPLATE(darwin, fstat64); // 339 … … 417 436 // NYI setauid 354 418 437 // NYI getaudit 355 419 438 // NYI setaudit 356 420 #if DARWIN_VERS >= DARWIN_10_7421 439 DECL_TEMPLATE(darwin, getaudit_addr) // 357 422 #endif423 440 // NYI setaudit_addr 358 424 441 // NYI auditctl 359 425 442 DECL_TEMPLATE(darwin, bsdthread_create); // 360 … … 434 451 // 369 435 452 // 370 436 453 // 371 454 #if DARWIN_VERS >= DARWIN_10_6 437 455 DECL_TEMPLATE(darwin, __thread_selfid); // 372 456 #endif 438 457 // 373 439 458 // 374 440 459 // 375 -
coregrind/m_syswrap/syswrap-darwin.c
diff -Naur a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c
a b 2618 2618 count, (Addr)p-(Addr)ARG3, ARG4); 2619 2619 } 2620 2620 2621 2622 PRE(fsgetpath)2623 {2624 #if VG_WORDSIZE == 42625 PRINT("fsgetpath(%#lx, %ld, %#lx {%u,%u}, %llu)",2626 ARG1, ARG2, ARG3,2627 ((unsigned int *)ARG3)[0], ((unsigned int *)ARG3)[1],2628 LOHI64(ARG4, ARG5));2629 PRE_REG_READ5(ssize_t, "fsgetpath",2630 void*,"buf", size_t,"bufsize",2631 fsid_t *,"fsid",2632 vki_uint32_t, "objid_low32", vki_uint32_t, "objid_high32");2633 #else2634 PRINT("fsgetpath(%#lx, %ld, %#lx {%u,%u}, %lu)",2635 ARG1, ARG2, ARG3,2636 ((unsigned int *)ARG3)[0],2637 ((unsigned int *)ARG3)[1], ARG4);2638 PRE_REG_READ4(ssize_t, "fsgetpath",2639 void*,"buf", size_t,"bufsize",2640 fsid_t *,"fsid", uint64_t,"objid");2641 #endif2642 PRE_MEM_READ("fsgetpath(fsid)", ARG3, sizeof(fsid_t));2643 PRE_MEM_WRITE("fsgetpath(buf)", ARG1, ARG2);2644 }2645 2646 POST(fsgetpath)2647 {2648 POST_MEM_WRITE(ARG1, RES);2649 }2650 2651 PRE(audit_session_self)2652 {2653 PRINT("audit_session_self()");2654 }2655 2656 POST(audit_session_self)2657 {2658 record_named_port(tid, RES, MACH_PORT_RIGHT_SEND, "audit-session-%p");2659 PRINT("audit-session %#lx", RES);2660 }2661 2662 2621 PRE(exchangedata) 2663 2622 { 2664 2623 PRINT("exchangedata(%#lx(%s), %#lx(%s), %lu)", … … 3561 3520 } 3562 3521 } 3563 3522 3523 PRE(getaudit_addr) 3524 { 3525 PRINT("getaudit_addr(%#lx, %lu)", ARG1, ARG2); 3526 PRE_REG_READ1(void*, "auditinfo_addr", int, "length"); 3527 PRE_MEM_WRITE("getaudit_addr(auditinfo_addr)", ARG1, ARG2); 3528 } 3529 POST(getaudit_addr) 3530 { 3531 POST_MEM_WRITE(ARG1, ARG2); 3532 } 3533 3564 3534 3565 3535 PRE(mmap) 3566 3536 { … … 3779 3749 uint32_t flavor, uint64_t arg, 3780 3750 user_addr_t buffer, int32_t buffersize) 3781 3751 */ 3782 #if DARWIN_VERS >= DARWIN_10_63783 3752 PRE(proc_info) 3784 3753 { 3785 3754 #if VG_WORDSIZE == 4 … … 3813 3782 #endif 3814 3783 } 3815 3784 3816 #endif /* DARWIN_VERS >= DARWIN_10_6 */3817 3785 3818 3786 /* --------------------------------------------------------------------- 3819 3787 aio_* … … 7428 7396 //} 7429 7397 7430 7398 7431 PRE(__thread_selfid)7432 {7433 PRINT("__thread_selfid ()");7434 PRE_REG_READ0(vki_uint64_t, "__thread_selfid");7435 }7436 7437 7399 PRE(task_for_pid) 7438 7400 { 7439 7401 PRINT("task_for_pid(%s, %ld, %#lx)", name_for_port(ARG1), ARG2, ARG3); … … 7782 7744 7783 7745 7784 7746 /* --------------------------------------------------------------------- 7785 Added for OSX 10. 7 (Lion)7747 Added for OSX 10.6 (Snow Leopard) 7786 7748 ------------------------------------------------------------------ */ 7787 7749 7788 #if DARWIN_VERS >= DARWIN_10_7 7789 7790 PRE(getaudit_addr) 7791 { 7792 PRINT("getaudit_addr(%#lx, %lu)", ARG1, ARG2); 7793 PRE_REG_READ1(void*, "auditinfo_addr", int, "length"); 7794 PRE_MEM_WRITE("getaudit_addr(auditinfo_addr)", ARG1, ARG2); 7795 } 7796 POST(getaudit_addr) 7797 { 7798 POST_MEM_WRITE(ARG1, ARG2); 7799 } 7750 #if DARWIN_VERS >= DARWIN_10_6 7800 7751 7801 7752 PRE(psynch_mutexwait) 7802 7753 { … … 7867 7818 { 7868 7819 } 7869 7820 7821 PRE(__thread_selfid) 7822 { 7823 PRINT("__thread_selfid ()"); 7824 PRE_REG_READ0(vki_uint64_t, "__thread_selfid"); 7825 } 7826 7827 PRE(fsgetpath) 7828 { 7829 #if VG_WORDSIZE == 4 7830 PRINT("fsgetpath(%#lx, %ld, %#lx {%u,%u}, %llu)", 7831 ARG1, ARG2, ARG3, 7832 ((unsigned int *)ARG3)[0], ((unsigned int *)ARG3)[1], 7833 LOHI64(ARG4, ARG5)); 7834 PRE_REG_READ5(ssize_t, "fsgetpath", 7835 void*,"buf", size_t,"bufsize", 7836 fsid_t *,"fsid", 7837 vki_uint32_t, "objid_low32", vki_uint32_t, "objid_high32"); 7838 #else 7839 PRINT("fsgetpath(%#lx, %ld, %#lx {%u,%u}, %lu)", 7840 ARG1, ARG2, ARG3, 7841 ((unsigned int *)ARG3)[0], 7842 ((unsigned int *)ARG3)[1], ARG4); 7843 PRE_REG_READ4(ssize_t, "fsgetpath", 7844 void*,"buf", size_t,"bufsize", 7845 fsid_t *,"fsid", uint64_t,"objid"); 7846 #endif 7847 PRE_MEM_READ("fsgetpath(fsid)", ARG3, sizeof(fsid_t)); 7848 PRE_MEM_WRITE("fsgetpath(buf)", ARG1, ARG2); 7849 } 7850 7851 POST(fsgetpath) 7852 { 7853 POST_MEM_WRITE(ARG1, RES); 7854 } 7855 7856 PRE(audit_session_self) 7857 { 7858 PRINT("audit_session_self()"); 7859 } 7860 POST(audit_session_self) 7861 { 7862 record_named_port(tid, RES, MACH_PORT_RIGHT_SEND, "audit-session-%p"); 7863 PRINT("audit-session %#lx", RES); 7864 } 7865 7866 #endif /* DARWIN_VERS >= DARWIN_10_6 */ 7867 7868 7869 /* --------------------------------------------------------------------- 7870 Added for OSX 10.7 (Lion) 7871 ------------------------------------------------------------------ */ 7872 7873 #if DARWIN_VERS >= DARWIN_10_7 7874 7870 7875 PRE(psynch_cvclrprepost) 7871 7876 { 7872 7877 PRINT("psynch_cvclrprepost(BOGUS)"); … … 8297 8302 // _____(__NR_shared_region_map_np), 8298 8303 #if DARWIN_VERS >= DARWIN_10_6 8299 8304 // _____(__NR_vm_pressure_monitor), 8300 #else 8301 _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(296)), // old load_shared_file 8302 #endif 8303 _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(297)), // old reset_shared_file 8304 _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(298)), // old new_system_shared_regions 8305 _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(299)), // old shared_region_map_file_np 8306 _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(300)), // old shared_region_make_private_np 8305 // _____(__NR_psynch_rw_longrdlock), 8306 // _____(__NR_psynch_rw_yieldwrlock), 8307 // _____(__NR_psynch_rw_downgrade), 8308 // _____(__NR_psynch_rw_upgrade), 8307 8309 MACXY(__NR_psynch_mutexwait, psynch_mutexwait), // 301 8308 8310 MACXY(__NR_psynch_mutexdrop, psynch_mutexdrop), // 302 8309 8311 MACXY(__NR_psynch_cvbroad, psynch_cvbroad), // 303 … … 8312 8314 MACXY(__NR_psynch_rw_rdlock, psynch_rw_rdlock), // 306 8313 8315 MACXY(__NR_psynch_rw_wrlock, psynch_rw_wrlock), // 307 8314 8316 MACXY(__NR_psynch_rw_unlock, psynch_rw_unlock), // 308 8315 _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(309)), // ??? 8317 // _____(__NR_psynch_rw_unlock2), 8318 #else 8319 _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(296)), // old load_shared_file 8320 _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(297)), // old reset_shared_file 8321 _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(298)), // old new_system_shared_regions 8322 _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(299)), // old shared_region_map_file_np 8323 _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(300)), // old shared_region_make_private_np 8324 // _____(__NR___pthread_mutex_destroy), 8325 // _____(__NR___pthread_mutex_init), 8326 // _____(__NR___pthread_mutex_lock), 8327 // _____(__NR___pthread_mutex_trylock), 8328 // _____(__NR___pthread_mutex_unlock), 8329 // _____(__NR___pthread_cond_init), 8330 // _____(__NR___pthread_cond_destroy), 8331 // _____(__NR___pthread_cond_broadcast), 8332 // _____(__NR___pthread_cond_signal), 8333 #endif 8316 8334 // _____(__NR_getsid), 8317 8335 // _____(__NR_settid_with_pid), 8336 #if DARWIN_VERS >= DARWIN_10_7 8318 8337 MACXY(__NR_psynch_cvclrprepost, psynch_cvclrprepost), // 312 8338 #else 8339 _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(308)), // old __pthread_cond_timedwait 8340 #endif 8319 8341 // _____(__NR_aio_fsync), 8320 8342 MACXY(__NR_aio_return, aio_return), 8321 8343 MACX_(__NR_aio_suspend, aio_suspend), … … 8341 8363 MACX_(__NR___pthread_canceled, __pthread_canceled), 8342 8364 MACX_(__NR___semwait_signal, __semwait_signal), 8343 8365 _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(335)), // old utrace 8344 #if DARWIN_VERS >= DARWIN_10_68345 8366 MACXY(__NR_proc_info, proc_info), // 336 8346 #endif8347 8367 MACXY(__NR_sendfile, sendfile), 8348 8368 MACXY(__NR_stat64, stat64), 8349 8369 MACXY(__NR_fstat64, fstat64), … … 8364 8384 // _____(__NR_setauid), 8365 8385 // _____(__NR_getaudit), 8366 8386 // _____(__NR_setaudit), 8367 #if DARWIN_VERS >= DARWIN_10_78368 8387 MACXY(__NR_getaudit_addr, getaudit_addr), 8369 #endif8370 8388 // _____(__NR_setaudit_addr), 8371 8389 // _____(__NR_auditctl), 8372 8390 MACXY(__NR_bsdthread_create, bsdthread_create), // 360 -
include/vki/vki-scnums-darwin.h
diff -Naur a/include/vki/vki-scnums-darwin.h b/include/vki/vki-scnums-darwin.h
a b 508 508 #define __NR_shared_region_map_np VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(295) 509 509 #if DARWIN_VERS >= DARWIN_10_6 510 510 #define __NR_vm_pressure_monitor VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(296) 511 #define __NR_psynch_rw_longrdlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(297) 512 #define __NR_psynch_rw_yieldwrlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(298) 513 #define __NR_psynch_rw_downgrade VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(299) 514 #define __NR_psynch_rw_upgrade VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(300) 515 #define __NR_psynch_mutexwait VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(301) 516 #define __NR_psynch_mutexdrop VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(302) 517 #define __NR_psynch_cvbroad VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(303) 518 #define __NR_psynch_cvsignal VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(304) 519 #define __NR_psynch_cvwait VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(305) 520 #define __NR_psynch_rw_rdlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(306) 521 #define __NR_psynch_rw_wrlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(307) 522 #define __NR_psynch_rw_unlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(308) 523 #define __NR_psynch_rw_unlock2 VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(309) 511 524 #else 512 525 /* 296 old load_shared_file */ 513 #endif514 526 /* 297 old reset_shared_file */ 515 527 /* 298 old new_system_shared_regions */ 516 528 /* 299 old shared_region_map_file_np */ 517 529 /* 300 old shared_region_make_private_np */ 518 #define __NR_psynch_mutexwait VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(301) 519 #define __NR_psynch_mutexdrop VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(302) 520 #define __NR_psynch_cvbroad VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(303) 521 #define __NR_psynch_cvsignal VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(304) 522 #define __NR_psynch_cvwait VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(305) 523 #define __NR_psynch_rw_rdlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(306) 524 #define __NR_psynch_rw_wrlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(307) 525 #define __NR_psynch_rw_unlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(308) 526 /* 309 */ 530 #define __NR___pthread_mutex_destroy VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(301) 531 #define __NR___pthread_mutex_init VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(302) 532 #define __NR___pthread_mutex_lock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(303) 533 #define __NR___pthread_mutex_trylock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(304) 534 #define __NR___pthread_mutex_unlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(305) 535 #define __NR___pthread_cond_init VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(306) 536 #define __NR___pthread_cond_destroy VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(307) 537 #define __NR___pthread_cond_broadcast VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(308) 538 #define __NR___pthread_cond_signal VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(309) 539 #endif 527 540 #define __NR_getsid VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(310) 528 541 #define __NR_settid_with_pid VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(311) 542 #if DARWIN_VERS >= DARWIN_10_7 529 543 #define __NR_psynch_cvclrprepost VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(312) 544 #else 545 #define __NR___pthread_cond_timedwait VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(312) 546 #endif 530 547 #define __NR_aio_fsync VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(313) 531 548 #define __NR_aio_return VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(314) 532 549 #define __NR_aio_suspend VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(315)