From 8b15df18c27e442608bb1fc8504c51114304cb6c Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Wed, 8 May 2002 14:08:22 +0000 Subject: [PATCH] Change _pthread_cleanup_push and _pthread_cleanup_pop into no-ops rather than aborts. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@237 --- coregrind/arch/x86-linux/vg_libpthread.c | 22 +++++++++++++++++++ .../arch/x86-linux/vg_libpthread_unimp.c | 4 ++-- coregrind/vg_libpthread.c | 22 +++++++++++++++++++ coregrind/vg_libpthread_unimp.c | 4 ++-- vg_libpthread.c | 22 +++++++++++++++++++ vg_libpthread_unimp.c | 4 ++-- 6 files changed, 72 insertions(+), 6 deletions(-) diff --git a/coregrind/arch/x86-linux/vg_libpthread.c b/coregrind/arch/x86-linux/vg_libpthread.c index d869d533fc..a8665fadf4 100644 --- a/coregrind/arch/x86-linux/vg_libpthread.c +++ b/coregrind/arch/x86-linux/vg_libpthread.c @@ -1524,6 +1524,28 @@ void _pthread_cleanup_pop_restore ( void ) ignored("_pthread_cleanup_pop_restore"); } +/*--------*/ +void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer, + void (*__routine) (void *), + void *__arg) +{ + static int moans = N_MOANS; + if (moans-- > 0) + ignored("_pthread_cleanup_push"); +} + +void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer, + int __execute) +{ + static int moans = N_MOANS; + if (moans-- > 0) { + if (__execute) + ignored("_pthread_cleanup_pop-EXECUTE"); + else + ignored("_pthread_cleanup_pop-NO-EXECUTE"); + } +} + /* This doesn't seem to be needed to simulate libpthread.so's external interface, but many people complain about its absence. */ diff --git a/coregrind/arch/x86-linux/vg_libpthread_unimp.c b/coregrind/arch/x86-linux/vg_libpthread_unimp.c index db9acb35b9..c592e3215f 100644 --- a/coregrind/arch/x86-linux/vg_libpthread_unimp.c +++ b/coregrind/arch/x86-linux/vg_libpthread_unimp.c @@ -75,9 +75,9 @@ void __pwrite64 ( void ) { unimp("__pwrite64"); } void __vfork ( void ) { unimp("__vfork"); } //void __wait ( void ) { unimp("__wait"); } //void __write ( void ) { unimp("__write"); } -void _pthread_cleanup_pop ( void ) { unimp("_pthread_cleanup_pop"); } +//void _pthread_cleanup_pop ( void ) { unimp("_pthread_cleanup_pop"); } //void _pthread_cleanup_pop_restore ( void ) { unimp("_pthread_cleanup_pop_restore"); } -void _pthread_cleanup_push ( void ) { unimp("_pthread_cleanup_push"); } +//void _pthread_cleanup_push ( void ) { unimp("_pthread_cleanup_push"); } //void _pthread_cleanup_push_defer ( void ) { unimp("_pthread_cleanup_push_defer"); } //void longjmp ( void ) { unimp("longjmp"); } //void pthread_atfork ( void ) { unimp("pthread_atfork"); } diff --git a/coregrind/vg_libpthread.c b/coregrind/vg_libpthread.c index d869d533fc..a8665fadf4 100644 --- a/coregrind/vg_libpthread.c +++ b/coregrind/vg_libpthread.c @@ -1524,6 +1524,28 @@ void _pthread_cleanup_pop_restore ( void ) ignored("_pthread_cleanup_pop_restore"); } +/*--------*/ +void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer, + void (*__routine) (void *), + void *__arg) +{ + static int moans = N_MOANS; + if (moans-- > 0) + ignored("_pthread_cleanup_push"); +} + +void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer, + int __execute) +{ + static int moans = N_MOANS; + if (moans-- > 0) { + if (__execute) + ignored("_pthread_cleanup_pop-EXECUTE"); + else + ignored("_pthread_cleanup_pop-NO-EXECUTE"); + } +} + /* This doesn't seem to be needed to simulate libpthread.so's external interface, but many people complain about its absence. */ diff --git a/coregrind/vg_libpthread_unimp.c b/coregrind/vg_libpthread_unimp.c index db9acb35b9..c592e3215f 100644 --- a/coregrind/vg_libpthread_unimp.c +++ b/coregrind/vg_libpthread_unimp.c @@ -75,9 +75,9 @@ void __pwrite64 ( void ) { unimp("__pwrite64"); } void __vfork ( void ) { unimp("__vfork"); } //void __wait ( void ) { unimp("__wait"); } //void __write ( void ) { unimp("__write"); } -void _pthread_cleanup_pop ( void ) { unimp("_pthread_cleanup_pop"); } +//void _pthread_cleanup_pop ( void ) { unimp("_pthread_cleanup_pop"); } //void _pthread_cleanup_pop_restore ( void ) { unimp("_pthread_cleanup_pop_restore"); } -void _pthread_cleanup_push ( void ) { unimp("_pthread_cleanup_push"); } +//void _pthread_cleanup_push ( void ) { unimp("_pthread_cleanup_push"); } //void _pthread_cleanup_push_defer ( void ) { unimp("_pthread_cleanup_push_defer"); } //void longjmp ( void ) { unimp("longjmp"); } //void pthread_atfork ( void ) { unimp("pthread_atfork"); } diff --git a/vg_libpthread.c b/vg_libpthread.c index d869d533fc..a8665fadf4 100644 --- a/vg_libpthread.c +++ b/vg_libpthread.c @@ -1524,6 +1524,28 @@ void _pthread_cleanup_pop_restore ( void ) ignored("_pthread_cleanup_pop_restore"); } +/*--------*/ +void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer, + void (*__routine) (void *), + void *__arg) +{ + static int moans = N_MOANS; + if (moans-- > 0) + ignored("_pthread_cleanup_push"); +} + +void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer, + int __execute) +{ + static int moans = N_MOANS; + if (moans-- > 0) { + if (__execute) + ignored("_pthread_cleanup_pop-EXECUTE"); + else + ignored("_pthread_cleanup_pop-NO-EXECUTE"); + } +} + /* This doesn't seem to be needed to simulate libpthread.so's external interface, but many people complain about its absence. */ diff --git a/vg_libpthread_unimp.c b/vg_libpthread_unimp.c index db9acb35b9..c592e3215f 100644 --- a/vg_libpthread_unimp.c +++ b/vg_libpthread_unimp.c @@ -75,9 +75,9 @@ void __pwrite64 ( void ) { unimp("__pwrite64"); } void __vfork ( void ) { unimp("__vfork"); } //void __wait ( void ) { unimp("__wait"); } //void __write ( void ) { unimp("__write"); } -void _pthread_cleanup_pop ( void ) { unimp("_pthread_cleanup_pop"); } +//void _pthread_cleanup_pop ( void ) { unimp("_pthread_cleanup_pop"); } //void _pthread_cleanup_pop_restore ( void ) { unimp("_pthread_cleanup_pop_restore"); } -void _pthread_cleanup_push ( void ) { unimp("_pthread_cleanup_push"); } +//void _pthread_cleanup_push ( void ) { unimp("_pthread_cleanup_push"); } //void _pthread_cleanup_push_defer ( void ) { unimp("_pthread_cleanup_push_defer"); } //void longjmp ( void ) { unimp("longjmp"); } //void pthread_atfork ( void ) { unimp("pthread_atfork"); } -- 2.47.2