Overview
Comment: | Make ObjC++ exceptions work on Windows with DWARF |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
643df208240a7cf7f6e61866b0bb2781 |
User & Date: | js on 2024-11-09 00:42:26 |
Other Links: | manifest | tags |
Context
2024-11-09
| ||
00:47 | Increase library versions check-in: 290e272b00 user: js tags: trunk | |
00:42 | Make ObjC++ exceptions work on Windows with DWARF check-in: 105d2f60b7 user: js tags: 1.2 | |
00:42 | Make ObjC++ exceptions work on Windows with DWARF check-in: 643df20824 user: js tags: trunk | |
2024-11-08
| ||
22:43 | OFColor: Improve style of deprecation message check-in: 5204353c50 user: js tags: trunk | |
Changes
Modified src/runtime/exception.m from [b7aba5c4db] to [0a89e50a33].
︙ | |||
35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | + | #ifdef __SEH__ # include <windows.h> #endif #if defined(__SEH__) # define PERSONALITY gnu_objc_personality # define CXX_PERSONALITY_STR "__gxx_personality_seh0" #elif defined(__USING_SJLJ_EXCEPTIONS__) # define PERSONALITY __gnu_objc_personality_sj0 # define CXX_PERSONALITY_STR "__gxx_personality_sj0" # define _Unwind_RaiseException _Unwind_SjLj_RaiseException # define __builtin_eh_return_data_regno(i) (i) #else # define PERSONALITY __gnu_objc_personality_v0 |
︙ | |||
233 234 235 236 237 238 239 | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | + + + + + + + + + + + + + + + + + + + + + + + + + + + - + | _Unwind_SetIP(struct _Unwind_Context *ctx, uintptr_t value) { uintptr_t thumb = _Unwind_GetGR(ctx, 15) & 1; _Unwind_SetGR(ctx, 15, (value | thumb)); } #endif #if defined(OF_WINDOWS) # ifdef __SEH__ static EXCEPTION_DISPOSITION (*cxx_personality)(PEXCEPTION_RECORD, void *, PCONTEXT, PDISPATCHER_CONTEXT); # else static PERSONALITY_FUNC((*cxx_personality)); # endif OF_CONSTRUCTOR() { /* * This only works if the application uses libc++.dll or * libstdc++-6.dll. There is unfortunately no other way, as Windows * does not support proper weak linking. */ HMODULE module; module = GetModuleHandle("libc++"); if (module == NULL) module = GetModuleHandle("libstdc++-6"); if (module != NULL) cxx_personality = (__typeof__(cxx_personality)) GetProcAddress(module, CXX_PERSONALITY_STR); } |
︙ | |||
611 612 613 614 615 616 617 | 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 | - + | struct LSDA LSDA; uintptr_t landingpad = 0; uint8_t found = 0; intptr_t filter = 0; if (foreign) { switch (exClass) { |
︙ | |||
781 782 783 784 785 786 787 | 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 | - - - - - - - - - - - - - - - - - - - - - - - - - - + + | objc_uncaught_exception_handler old = uncaughtExceptionHandler; uncaughtExceptionHandler = handler; return old; } #ifdef __SEH__ |