3744 if (osthread->ucontext() != NULL) {
3745 _epc = os::Aix::ucontext_get_pc((ucontext_t *) context.ucontext());
3746 } else {
3747 // NULL context is unexpected, double-check this is the VMThread.
3748 guarantee(thread->is_VM_thread(), "can only be called for VMThread");
3749 }
3750 }
3751
3752 // Suspends the target using the signal mechanism and then grabs the PC before
3753 // resuming the target. Used by the flat-profiler only
3754 ExtendedPC os::get_thread_pc(Thread* thread) {
3755 // Make sure that it is called by the watcher for the VMThread.
3756 assert(Thread::current()->is_Watcher_thread(), "Must be watcher");
3757 assert(thread->is_VM_thread(), "Can only be called for VMThread");
3758
3759 PcFetcher fetcher(thread);
3760 fetcher.run();
3761 return fetcher.result();
3762 }
3763
3764 // Not neede on Aix.
3765 // int os::Aix::safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime) {
3766 // }
3767
3768 ////////////////////////////////////////////////////////////////////////////////
3769 // debug support
3770
3771 static address same_page(address x, address y) {
3772 intptr_t page_bits = -os::vm_page_size();
3773 if ((intptr_t(x) & page_bits) == (intptr_t(y) & page_bits))
3774 return x;
3775 else if (x > y)
3776 return (address)(intptr_t(y) | ~page_bits) + 1;
3777 else
3778 return (address)(intptr_t(y) & page_bits);
3779 }
3780
3781 bool os::find(address addr, outputStream* st) {
3782
3783 st->print(PTR_FORMAT ": ", addr);
3784
3785 const LoadedLibraryModule* lib = LoadedLibraries::find_for_text_address(addr);
3786 if (lib) {
3787 lib->print(st);
|
3744 if (osthread->ucontext() != NULL) {
3745 _epc = os::Aix::ucontext_get_pc((ucontext_t *) context.ucontext());
3746 } else {
3747 // NULL context is unexpected, double-check this is the VMThread.
3748 guarantee(thread->is_VM_thread(), "can only be called for VMThread");
3749 }
3750 }
3751
3752 // Suspends the target using the signal mechanism and then grabs the PC before
3753 // resuming the target. Used by the flat-profiler only
3754 ExtendedPC os::get_thread_pc(Thread* thread) {
3755 // Make sure that it is called by the watcher for the VMThread.
3756 assert(Thread::current()->is_Watcher_thread(), "Must be watcher");
3757 assert(thread->is_VM_thread(), "Can only be called for VMThread");
3758
3759 PcFetcher fetcher(thread);
3760 fetcher.run();
3761 return fetcher.result();
3762 }
3763
3764 ////////////////////////////////////////////////////////////////////////////////
3765 // debug support
3766
3767 static address same_page(address x, address y) {
3768 intptr_t page_bits = -os::vm_page_size();
3769 if ((intptr_t(x) & page_bits) == (intptr_t(y) & page_bits))
3770 return x;
3771 else if (x > y)
3772 return (address)(intptr_t(y) | ~page_bits) + 1;
3773 else
3774 return (address)(intptr_t(y) & page_bits);
3775 }
3776
3777 bool os::find(address addr, outputStream* st) {
3778
3779 st->print(PTR_FORMAT ": ", addr);
3780
3781 const LoadedLibraryModule* lib = LoadedLibraries::find_for_text_address(addr);
3782 if (lib) {
3783 lib->print(st);
|