1 |
|
/* |
2 |
|
* main_windows.cpp - Startup code for Windows |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-2005 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2008 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
141 |
|
* SIGSEGV handler |
142 |
|
*/ |
143 |
|
|
144 |
< |
static sigsegv_return_t sigsegv_handler(sigsegv_address_t fault_address, sigsegv_address_t fault_instruction) |
144 |
> |
static sigsegv_return_t sigsegv_handler(sigsegv_info_t *sip) |
145 |
|
{ |
146 |
+ |
const uintptr fault_address = (uintptr)sigsegv_get_fault_address(sip); |
147 |
|
#if ENABLE_VOSF |
148 |
|
// Handle screen fault |
149 |
< |
extern bool Screen_fault_handler(sigsegv_address_t, sigsegv_address_t); |
150 |
< |
if (Screen_fault_handler(fault_address, fault_instruction)) |
149 |
> |
extern bool Screen_fault_handler(sigsegv_info_t *sip); |
150 |
> |
if (Screen_fault_handler(sip)) |
151 |
|
return SIGSEGV_RETURN_SUCCESS; |
152 |
|
#endif |
153 |
|
|
168 |
|
* Dump state when everything went wrong after a SEGV |
169 |
|
*/ |
170 |
|
|
171 |
< |
static void sigsegv_dump_state(sigsegv_address_t fault_address, sigsegv_address_t fault_instruction) |
171 |
> |
static void sigsegv_dump_state(sigsegv_info_t *sip) |
172 |
|
{ |
173 |
+ |
const sigsegv_address_t fault_address = sigsegv_get_fault_address(sip); |
174 |
+ |
const sigsegv_address_t fault_instruction = sigsegv_get_fault_instruction_address(sip); |
175 |
|
fprintf(stderr, "Caught SIGSEGV at address %p", fault_address); |
176 |
< |
if (fault_instruction != SIGSEGV_INVALID_PC) |
176 |
> |
if (fault_instruction != SIGSEGV_INVALID_ADDRESS) |
177 |
|
fprintf(stderr, " [IP=%p]", fault_instruction); |
178 |
|
fprintf(stderr, "\n"); |
179 |
|
uaecptr nextpc; |