List Info

Thread: Re: CVS update: /porting/sal/inc/sal/main.h




Re: CVS update: /porting/sal/inc/sal/main.h
user name
2007-10-01 03:15:22
Yuri Dario wrote:
> Hi Stephan,
> 
> 
> I looked at new main.h code, and I propose to change it
as follows:
> 
> #ifdef SAL_OS2
> 
> int SAL_CALL osl_setExceptionHook( void);
> int SAL_CALL osl_unsetExceptionHook( void);
> #define SET_EXCEPTION_HOOK	if
(osl_setExceptionHook()==0) {
> #define UNSET_EXCEPTION_HOOK	}
osl_unsetExceptionHook()
> 
> #else
> 
> #define SET_EXCEPTION_HOOK
> #define UNSET_EXCEPTION_HOOK
> 
> #endif
> 
> #define SAL_MAIN_WITH_ARGS_IMPL 
> int SAL_CALL main(int argc, char ** argv) 
> { 
> 	int rc; 
> 	SET_EXCEPTION_HOOK; 
> 	osl_setCommandArgs(argc, argv); 
> 	rc = sal_main_with_args(argc, argv); 
> 	UNSET_EXCEPTION_HOOK; 
> 	return rc; 
> }
> 
> #define SAL_MAIN_IMPL 
> int SAL_CALL main(int argc, char ** argv) 
> { 
> 	int rc; 
> 	SET_EXCEPTION_HOOK; 
> 	osl_setCommandArgs(argc, argv); 
> 	rc = sal_main(); 
> 	UNSET_EXCEPTION_HOOK; 
> 	return rc; 
> }
> 
> 
> the new macros are used to install the OS/2 exception
handler, so I can
> wrap program execution and dump stack frames at crash.
> 
> If you know a better way to put it in common code,
please let me know.

On CWS sb71, we faced a similar problem (needing
initialization and 
deinitialization around sal_main on Windows) and changed 
SAL_MAIN_WITH_ARGS_IMPL (and correspondingly SAL_MAIN_IMPL)
to

#define SAL_MAIN_WITH_ARGS_IMPL 
int SAL_CALL main(int argc, char ** argv) 
{ 
	int ret; 
	sal_detail_initialize(argc, argv);   
	ret = sal_main_with_args(argc, argv); 
	sal_detail_deinitialize(); 
	return ret; 
}

(see sal/rtl/sal/main.h:1.7.68.2 l. 50--58).  CWS sb71 is
not yet 
integrated, but planned to be ready for integration on
October 5.  So I 
would suggest you move your OS/2-specific
osl_[un]setExceptionHook 
functionality into sal_detail_[de]initialize once CWS sb71
is 
integrated.  (Also, it is probably not a good idea anyway to
silently 
not execute rc=sal_main() when osl_setExceptionHook fails
and return a 
random uninitialized rc; abort is probably what you want.) 
You also no 
longer need the changes in sal/util/makefile.mk:1.44.4.1
then.

-Stephan

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeporting.openoffice.org
For additional commands, e-mail: dev-helpporting.openoffice.org


Re: CVS update: /porting/sal/inc/sal/main.h
user name
2007-10-01 03:53:18
Hi Stephan,

>(see sal/rtl/sal/main.h:1.7.68.2 l. 50--58).  CWS sb71
is not yet 
>integrated, but planned to be ready for integration on
October 5.  So I 
>would suggest you move your OS/2-specific
osl_[un]setExceptionHook 


ok, thanks I'll get such code.

>integrated.  (Also, it is probably not a good idea
anyway to silently 
>not execute rc=sal_main() when osl_setExceptionHook
fails and return a 
>random uninitialized rc; abort is probably what you
want.)  

this is not a problem: if setting the exception handler
fails (and this
is very unlikely to happen), we can continue processing as
usual, I
only miss the stack trace dump to file; but libc runtime/OS2
handlers
will still log the crash.

TIA,


Bye,

	Yuri Dario

/*
 * member of TeamOS/2 - Italy
 * http://www.os2power.com/
yuri
 * http://www.teamos2.it
 */

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeporting.openoffice.org
For additional commands, e-mail: dev-helpporting.openoffice.org


Re: CVS update: /porting/sal/inc/sal/main.h
user name
2007-10-05 10:01:47
Hi Stephan,

>On CWS sb71, we faced a similar problem (needing
initialization and 
>deinitialization around sal_main on Windows) and changed

>SAL_MAIN_WITH_ARGS_IMPL (and correspondingly
SAL_MAIN_IMPL) to


I merged relevant changes from sb71 into os2port02 (main.h,
salinit.cxx, makefile.mk).

thanks,


Bye,

	Yuri Dario

/*
 * member of TeamOS/2 - Italy
 * http://www.os2power.com/
yuri
 * http://www.teamos2.it
 */

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeporting.openoffice.org
For additional commands, e-mail: dev-helpporting.openoffice.org


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )