dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] libjit ./ChangeLog jit/jit-except.c


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] libjit ./ChangeLog jit/jit-except.c
Date: Thu, 23 Mar 2006 18:56:52 +0000

CVSROOT:        /cvsroot/dotgnu-pnet
Module name:    libjit
Branch:         
Changes by:     Klaus Treichel <address@hidden> 06/03/23 18:56:52

Modified files:
        .              : ChangeLog 
        jit            : jit-except.c 

Log message:
        2006-03-23  Klaus Treichel  <address@hidden>
        
        * jit/jitc-except.c: Walk the stack to build the stack trace in
        jit_exception_get_stack_trace when the frame is not broken.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/libjit/ChangeLog.diff?tr1=1.209&tr2=1.210&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/dotgnu-pnet/libjit/jit/jit-except.c.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: libjit/ChangeLog
diff -u libjit/ChangeLog:1.209 libjit/ChangeLog:1.210
--- libjit/ChangeLog:1.209      Wed Mar 22 18:48:02 2006
+++ libjit/ChangeLog    Thu Mar 23 18:56:52 2006
@@ -1,3 +1,8 @@
+2006-03-23  Klaus Treichel  <address@hidden>
+
+       * jit/jitc-except.c: Walk the stack to build the stack trace in
+       jit_exception_get_stack_trace when the frame is not broken.
+
 2006-03-23  Aleksey Demakov  <address@hidden>
 
        * tools/Makefile.am: 
Index: libjit/jit/jit-except.c
diff -u libjit/jit/jit-except.c:1.6 libjit/jit/jit-except.c:1.7
--- libjit/jit/jit-except.c:1.6 Sat Dec 24 06:55:13 2005
+++ libjit/jit/jit-except.c     Thu Mar 23 18:56:52 2006
@@ -303,11 +303,12 @@
 @*/
 jit_stack_trace_t jit_exception_get_stack_trace(void)
 {
+       jit_stack_trace_t trace = 0;
+       unsigned int size = 0;
+#if JIT_APPLY_BROKEN_FRAME_BUILTINS != 0
        jit_thread_control_t control;
        jit_backtrace_t top;
        jit_backtrace_t item;
-       unsigned int size;
-       jit_stack_trace_t trace;
        
        /* Count the number of items in the current thread's call stack */
        control = _jit_thread_get_control();
@@ -343,6 +344,36 @@
                ++size;
                item = item->parent;
        }
+#else
+       void *frame = jit_get_current_frame();
+
+       /* Count the number of items in the current thread's call stack */
+       while(frame != 0)
+       {
+               frame = jit_get_next_frame_address(frame);
+               ++size;
+       }
+
+       /* Allocate memory for the stack trace */
+       trace = (jit_stack_trace_t)jit_malloc
+               (sizeof(struct jit_stack_trace) +
+                size * sizeof(void *) - sizeof(void *));
+       if(!trace)
+       {
+               return 0;
+       }
+       trace->size = size;
+
+       /* Populate the stack trace with the items we counted earlier */
+       size = 0;
+       frame = jit_get_current_frame();
+       while(frame != 0)
+       {
+               trace->items[size] = jit_get_return_address(frame);
+               frame = jit_get_next_frame_address(frame);
+               ++size;
+       }
+#endif
        return trace;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]