* src/vm/jit/powerpc/linux/md-os.c (vm/jit/profile/profile.h): Changed
authortwisti <none@none>
Thu, 9 Nov 2006 09:54:00 +0000 (09:54 +0000)
committertwisti <none@none>
Thu, 9 Nov 2006 09:54:00 +0000 (09:54 +0000)
to vm/jit/optimizing/profile.h.
(md_signal_handler_sigsegv): If faulting address is not equal 0, try
to dump a tsacktrace and exit.

src/vm/jit/powerpc/linux/md-os.c

index 201830b8736f76a8a38c9e1a7953c5381d58e49c..c3f5ad36a9a6453c954804e48af2c0b6db5072a4 100644 (file)
@@ -26,9 +26,7 @@
 
    Authors: Christian Thalinger
 
-   Changes:
-
-   $Id: md-os.c 5274 2006-08-24 09:29:44Z tbfg $
+   $Id: md-os.c 5939 2006-11-09 09:54:00Z twisti $
 
 */
 
@@ -52,7 +50,7 @@
 #include "vm/jit/asmpart.h"
 
 #if defined(ENABLE_PROFILING)
-# include "vm/jit/profile/profile.h"
+# include "vm/jit/optimizing/profile.h"
 #endif
 
 #include "vm/jit/stacktrace.h"
@@ -84,22 +82,24 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
        reg = (instr >> 16) & 0x1f;
        addr = _mc->gregs[reg];
 
-       if (addr == 0) {
-               pv  = (u1 *) _mc->gregs[REG_PV];
-               sp  = (u1 *) _mc->gregs[REG_SP];
-               ra  = (u1 *) _mc->gregs[PT_LNK];         /* this is correct for leafs */
-               xpc = (u1 *) _mc->gregs[PT_NIP];
+       pv  = (u1 *) _mc->gregs[REG_PV];
+       sp  = (u1 *) _mc->gregs[REG_SP];
+       ra  = (u1 *) _mc->gregs[PT_LNK];         /* this is correct for leafs */
+       xpc = (u1 *) _mc->gregs[PT_NIP];
 
+       if (addr == 0) {
                _mc->gregs[REG_ITMP1_XPTR] =
                        (ptrint) stacktrace_hardware_nullpointerexception(pv, sp, ra, xpc);
 
                _mc->gregs[REG_ITMP2_XPC] = (ptrint) xpc;
                _mc->gregs[PT_NIP] = (ptrint) asm_handle_exception;
+       }
+       else {
+               codegen_get_pv_from_pc(xpc);
+
+               /* this should not happen */
 
-       } else {
-               throw_cacao_exception_exit(string_java_lang_InternalError,
-                                                                  "Segmentation fault: 0x%08lx at 0x%08lx",
-                                                                  addr, _mc->gregs[PT_NIP]);
+               assert(0);
        }               
 }