Re: jsdIDebuggerService crashing FF 2.0
"John J. Barton" <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.jsdebugger |
|---|---|
| Message-ID | <[email protected]> |
Nevermind. After a bit more trial and error I figured it out.
Here is the code that failed in my executionHook:
var evaled = frame.eval(expr, eval_name, 1, result);
if (evaled)
{
val.value = result.value.getWrappedValue();
================================================^^^^^^^^^^^^^^^^^
return RETURN_VALUE;
}
else
{
val.value = result.value.getWrappedValue();
return RETURN_THROW_WITH_VAL;
}
The line that works is
val.value = result.value;
So I guess that by un-wrapping the result from the frame.eval() I caused
my caller grief because it was expecting to un-wrap. Since I passed
back an un-wrapped value, the caller crashed. (Kudos to venkman once
again, the ultimate in example code).
Or at least that is what I think now...
John.
John J. Barton wrote:
> I have very reproducable crash from a simple script that has an eval()
> with a js error in the evaluated string. I am having trouble isolating
> the problem because the code is in xpcom implemented in javascript
> (firebug-service.js) I can't seem to use dump() and logging to the JS
> error console does not seem to flush all content before the crash.
>
> Talkback ID 27823951 shows that the problem is an unset return value.
> But actually the stack trace does not make a lot of sense. I guess my
> hook is being run by CallExecutionHook and thus there is code that does
> not show up in the trace bound in to the hook() that must then call
> getValueWrappedJSVal.
>
> jsd_GetValueWrappedJSVal [mozilla/js/jsd/jsd_val.c, line 284]
> jsd_CallExecutionHook [mozilla/js/jsd/jsd_hook.c, line 178]
> jsd_TrapHandler [mozilla/js/jsd/jsd_scpt.c, line 735]
> JS_HandleTrap [mozilla/js/src/jsdbgapi.c, line 213]
> js_Interpret [mozilla/js/src/jsinterp.c, line 4554]
> js_Execute [mozilla/js/src/jsinterp.c, line 1644]
> obj_eval [mozilla/js/src/jsobj.c, line 1360]
>
>
> Any hints or suggestions would be welcome.
>
> Thanks,
> John.