- Timestamp:
- Oct 18, 2006, 11:58:35 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/qwindowdefs_pm.h
r113 r136 99 99 const ULONG QT_EXTRAWINDATASIZE = sizeof(LONG) * 2; 100 100 101 #ifdef __cplusplus102 101 class Q_EXPORT QPMObjectWindow 103 102 { … … 124 123 HWND w; 125 124 }; 126 #endif 125 126 // OS/2 system exception handler callback interface 127 128 enum QtSysXcptReq 129 { 130 QtSysXcptReq_AppName = 0, 131 QtSysXcptReq_AppVer = 1, 132 QtSysXcptReq_ReportTo = 2, 133 QtSysXcptReq_ReportSubj = 3, 134 }; 135 136 typedef void (*QtSysXcptWriter)( const char *str ); 137 typedef int (*QtSysXcptCallback)( QtSysXcptReq req, QtSysXcptWriter writer, 138 int reserved ); 139 140 Q_EXPORT QtSysXcptCallback qInstallSysXcptCallback( QtSysXcptCallback cb ); 127 141 128 142 #endif -
trunk/src/kernel/qapplication_pm.cpp
r126 r136 6 6 ** Copyright (C) 1992-2003 Trolltech AS. All rights reserved. 7 7 ** Copyright (C) 2004 Norman ASA. Initial OS/2 Port. 8 ** Copyright (C) 2005 netlabs.org. Further OS/2 Development.8 ** Copyright (C) 2005-2006 netlabs.org. Further OS/2 Development. 9 9 ** 10 10 ** This file is part of the kernel module of the Qt GUI Toolkit. … … 453 453 *****************************************************************************/ 454 454 455 #if !defined(QT_PM_NO_SYSEXCEPTIONS) 456 extern // defined in qsysxcpt_pm.cpp 457 ULONG APIENTRY qt_exceptionHandler( PEXCEPTIONREPORTRECORD pReportRec, 458 PEXCEPTIONREGISTRATIONRECORD pRegRec, 459 PCONTEXTRECORD pContextRec, 460 PVOID pv ); 461 ERR qt_libcExceptionHandler = NULL; 462 #endif 463 455 464 // need to get default font? 456 465 extern bool qt_app_has_font; … … 458 467 void qt_init( int *argcptr, char **argv, QApplication::Type ) 459 468 { 469 #if !defined(QT_PM_NO_SYSEXCEPTIONS) 470 // Since the exception registration record can only be located on the stack, 471 // we can enable our exception handling on the main thread only if the LIBC 472 // library of the compiler provides an exception handler (already allocated 473 // on the stack before main() is called). In this case, we replace the LIBC 474 // exception handler's pointer with our own (not nice but what to do?) and 475 // call the former (to let it do signal processing and the stuff) after we 476 // generate the trap file. Note that if there is no LIBC exception handler 477 // provided, qt_libcExceptionHandler will remain NULL to tell QThread not to 478 // install our exception handler for newly created threads (all or nothing). 479 { 480 PTIB ptib = NULL; 481 PPIB ppib = NULL; 482 DosGetInfoBlocks( &ptib, &ppib ); 483 484 Q_ASSERT( ptib && ppib ); 485 if ( ptib && ppib ) { 486 if ( ptib->tib_pexchain != END_OF_CHAIN ) { 487 PEXCEPTIONREGISTRATIONRECORD rec = 488 (PEXCEPTIONREGISTRATIONRECORD) ptib->tib_pexchain; 489 qt_libcExceptionHandler = rec->ExceptionHandler; 490 rec->ExceptionHandler = qt_exceptionHandler; 491 } else { 492 Q_ASSERT( 0 /* no exception handler for the main thread */ ); 493 } 494 } 495 } 496 #endif 460 497 461 498 #if defined(QT_DEBUG) … … 539 576 //@@TODO (dmik): remove? 540 577 // QInputContext::shutdown(); 578 579 #if !defined(QT_PM_NO_SYSEXCEPTIONS) 580 // remove the exception handler if it was installed in qt_init() 581 if ( qt_libcExceptionHandler ) { 582 PTIB ptib = NULL; 583 PPIB ppib = NULL; 584 DosGetInfoBlocks( &ptib, &ppib ); 585 586 Q_ASSERT( ptib && ppib ); 587 if ( ptib && ppib ) { 588 Q_ASSERT( ptib->tib_pexchain != END_OF_CHAIN ); 589 if ( ptib->tib_pexchain != END_OF_CHAIN ) { 590 PEXCEPTIONREGISTRATIONRECORD rec = 591 (PEXCEPTIONREGISTRATIONRECORD) ptib->tib_pexchain; 592 Q_ASSERT( rec->ExceptionHandler == qt_exceptionHandler ); 593 if ( rec->ExceptionHandler == qt_exceptionHandler ) { 594 rec->ExceptionHandler = qt_libcExceptionHandler; 595 qt_libcExceptionHandler = NULL; 596 } 597 } 598 } 599 } 600 #endif 541 601 } 542 602 -
trunk/src/kernel/qt_kernel.pri
r128 r136 140 140 $$KERNEL_CPP/qthread_pm.cpp \ 141 141 $$KERNEL_CPP/qwidget_pm.cpp \ 142 $$KERNEL_CPP/qfontengine_pm.cpp 142 $$KERNEL_CPP/qfontengine_pm.cpp \ 143 $$KERNEL_CPP/qsysxcpt_pm.cpp 143 144 144 145 unix:x11 { -
trunk/src/kernel/qthread_pm.cpp
r125 r136 39 39 40 40 #include "qt_os2.h" 41 42 #if !defined(QT_PM_NO_SYSEXCEPTIONS) 43 extern // defined in qsysxcpt_pm.cpp 44 ULONG APIENTRY qt_exceptionHandler( PEXCEPTIONREPORTRECORD pReportRec, 45 PEXCEPTIONREGISTRATIONRECORD pRegRec, 46 PCONTEXTRECORD pContextRec, 47 PVOID pv ); 48 extern ERR qt_libcExceptionHandler; // defined in qapplication_pm.cpp 49 #endif 41 50 42 51 #include "qthread.h" … … 106 115 LocalStorage = arg [1]; 107 116 117 #if !defined(QT_PM_NO_SYSEXCEPTIONS) 118 // don't set the exception handler if not able to do it for main thread 119 bool setException = qt_libcExceptionHandler != NULL; 120 EXCEPTIONREGISTRATIONRECORD excRegRec = { 0, qt_exceptionHandler }; 121 if ( setException ) 122 DosSetExceptionHandler( &excRegRec ); 123 #endif 124 108 125 ( (QThread *) arg[0] )->run(); 109 126 110 127 finish( (QThreadInstance *) arg[1] ); 111 128 129 #if !defined(QT_PM_NO_SYSEXCEPTIONS) 130 if ( setException ) 131 DosUnsetExceptionHandler( &excRegRec ); 132 #endif 133 112 134 return; 113 135 }
Note:
See TracChangeset
for help on using the changeset viewer.