bugs in stackTrace.c
Godmar Back
gback at cs.utah.edu
Thu Aug 27 08:56:48 PDT 1998
>
> Sorry to say, but you were wrong :)
>
You're right. I just tried starting kaffe with a non-existing
class and it said ClassNotFoundException, just like it should, so I wondered.
I think that's because the seg violation is caught, handled, and
ignored somehow. One can see the failure by running the interpreter with
-vmdebug EXCEPTION or under gdb.
I assume you mean STACKTRACEMETH(trace)!=1 in the code below?
- Godmar
> if the top stackframe contains a meth = (Method*)1 then Tnext is never
> called. A possible patch would be to have STACKTRACEINIT() loop until it
> has found a valid frame. Or another one would be to have buildStackTrace
> look like this instead:
>
> STACKTRACEINIT(trace, base, base);
> cnt = 0;
> while(!STACKTRACEEND(trace)) { /* <<<--- new code */
> if(STACKTRACEMETH(trace)!=-1)
> break;
> STACKTRACESTEP(trace);
> }
>
> while(!STACKTRACEEND(trace)) {
> STACKTRACESTEP(trace);
> cnt++;
> } /* <<<--- end new code */
>
> /* Build an array of stackTraceInfo */
> info = gc_malloc(sizeof(stackTraceInfo) * (cnt+1), GC_ALLOC_NOWALK);
>
> cnt = 0;
>
> STACKTRACEINIT(trace,base,base);
> while(!STACKTRACEEND(trace)) { /* <<<--- new code */
> if(STACKTRACEMETH(trace)!=-1)
> break;
> STACKTRACESTEP(trace);
> } /* <<<--- new code */
>
> for(; !STACKTRACEEND(trace); STACKTRACESTEP(trace)) {
> info[cnt].pc = STACKTRACEPC(trace);
> #if defined(INTERPRETER)
> info[cnt].meth = STACKTRACEMETH(trace);
> #endif
> #if defined(TRANSLATOR)
> info[cnt].meth = 0; /* We do this lazily */
> #endif
> cnt++;
> }
>
>
>
> regards, Stefan Burstroem
>
> -----------------------------------------------------------------------
> >> Irl: Stefan Burstroem << >> Omnipresence Intl. << >> Irc: Yabba <<
> >> Phone: +46 (0)46-211 40 84 << >> EMail: stefan at omnipresence.com <<
> -----------------------------------------------------------------------
>
>
More information about the kaffe
mailing list