mingw w64 - Obtaining current GCC exception model -


g++ built using either dwarf2, sjlj or seh exception model. mingw-builds provide various builds of g++ have different exception models. able determine gcc toolchain exception model being used. there g++ argument dump default exception model of compiler?

edit: originally, testing configuration flags described in g++ -v. jonathon wakely points out in comments, not thing do.

an inspection way compile assembly:

struct s { ~s(); }; void bar(); void foo() {   s s;   bar(); } 

the result of g++ -s <filename> -o output.s have following exception references in them:

mingw-4.8.1-x86-posix-sjlj:

.def    ___gxx_personality_sj0; .scl    2;  .type   32; .endef .def    __unwind_sjlj_register; .scl    2;  .type   32; .endef .def    __unwind_sjlj_unregister;   .scl    2;  .type   32; .endef .def    __unwind_sjlj_resume;   .scl    2;  .type   32; .endef 

mingw-4.8.1-x86-posix-dwarf:

.def    ___gxx_personality_v0;  .scl    2;  .type   32; .endef .def    __unwind_resume;    .scl    2;  .type   32; .endef 

mingw-4.8.1-x64-win32-sjlj:

.def    __gxx_personality_sj0;  .scl    2;  .type   32; .endef .def    _unwind_sjlj_register;  .scl    2;  .type   32; .endef .def    _unwind_sjlj_unregister;    .scl    2;  .type   32; .endef .def    _unwind_sjlj_resume;    .scl    2;  .type   32; .endef 

mingw-4.8.1-x64-posix-seh:

.def    __gxx_personality_seh0; .scl    2;  .type   32; .endef .def    _unwind_resume; .scl    2;  .type   32; .endef 

mingw-4.8.1-x64-posix-sjlj:

.def    __gxx_personality_sj0;  .scl    2;  .type   32; .endef .def    _unwind_sjlj_register;  .scl    2;  .type   32; .endef .def    _unwind_sjlj_unregister;    .scl    2;  .type   32; .endef .def    _unwind_sjlj_resume;    .scl    2;  .type   32; .endef 

fc17-g++-4.7.2-x64:

.cfi_personality 0x3,__gxx_personality_v0 .globl  __gxx_personality_v0 call    _unwind_resume 

looks should search __gxx_personality_([a-z])(0-9]+) , compare first capture group to:

  • v = dwarf
  • seh = seh
  • sj = sjlj

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -