ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/sigsegv.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/sigsegv.cpp (file contents):
Revision 1.38 by gbeauche, 2003-12-20T10:06:18Z vs.
Revision 1.39 by gbeauche, 2003-12-20T21:50:08Z

# Line 36 | Line 36
36   #endif
37  
38   #include <list>
39 + #include <stdio.h>
40   #include <signal.h>
41   #include "sigsegv.h"
42  
# Line 270 | Line 271 | static void powerpc_decode_instruction(i
271   #define SIGSEGV_REGISTER_FILE                   (unsigned int *)&SIGSEGV_CONTEXT_REGS->nip, (unsigned int *)(SIGSEGV_CONTEXT_REGS->gpr)
272   #define SIGSEGV_SKIP_INSTRUCTION                powerpc_skip_instruction
273   #endif
274 + #if (defined(hppa) || defined(__hppa__))
275 + #undef  SIGSEGV_FAULT_ADDRESS
276 + #define SIGSEGV_FAULT_ADDRESS                   sip->si_ptr
277 + #endif
278   #endif
279   #endif
280  
# Line 390 | Line 395 | static sigsegv_address_t get_fault_addre
395   #endif
396   #endif
397   #if defined(__FreeBSD__)
393 #define SIGSEGV_ALL_SIGNALS                             FAULT_HANDLER(SIGBUS)
398   #if (defined(i386) || defined(__i386__))
399 + #define SIGSEGV_ALL_SIGNALS                             FAULT_HANDLER(SIGBUS)
400   #define SIGSEGV_FAULT_HANDLER_ARGLIST   int sig, int code, struct sigcontext *scp, char *addr
401   #define SIGSEGV_FAULT_HANDLER_ARGS              sig, code, scp, addr
402   #define SIGSEGV_FAULT_ADDRESS                   addr
# Line 399 | Line 404 | static sigsegv_address_t get_fault_addre
404   #define SIGSEGV_REGISTER_FILE                   ((unsigned long *)&scp->sc_edi)
405   #define SIGSEGV_SKIP_INSTRUCTION                ix86_skip_instruction
406   #endif
407 + #if (defined(alpha) || defined(__alpha__))
408 + #define SIGSEGV_ALL_SIGNALS                             FAULT_HANDLER(SIGSEGV)
409 + #define SIGSEGV_FAULT_HANDLER_ARGLIST   int sig, char *addr, struct sigcontext *scp
410 + #define SIGSEGV_FAULT_HANDLER_ARGS              sig, addr, scp
411 + #define SIGSEGV_FAULT_ADDRESS                   addr
412 + #define SIGSEGV_FAULT_INSTRUCTION               scp->sc_pc
413 + #endif
414   #endif
415  
416   // Extract fault address out of a sigcontext
# Line 1524 | Line 1536 | static void *b_region, *e_region;
1536  
1537   static sigsegv_return_t sigsegv_test_handler(sigsegv_address_t fault_address, sigsegv_address_t instruction_address)
1538   {
1539 + #if DEBUG
1540 +        printf("sigsegv_test_handler(%p, %p)\n", fault_address, instruction_address);
1541 +        printf("expected fault at %p\n", page + REF_INDEX);
1542 + #ifdef __GNUC__
1543 +        printf("expected instruction address range: %p-%p\n", b_region, e_region);
1544 + #endif
1545 + #endif
1546          handler_called++;
1547          if ((fault_address - REF_INDEX) != page)
1548                  exit(10);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines