Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is there a Switch/Option/Config setting for "Optimized away"

497 views
Skip to first unread message

Russ Thomas

unread,
Jul 21, 2015, 4:54:03 AM7/21/15
to dev-developer-tools
Hi all

Is there a switch to prevent devtools from optimizing valuable variables
out of existence? I'm seeing this more and more often of late. In the
early hours of this morning, I had to switch to Chrome to get some
understanding of what was going on in some code while walking back on the
call stack -- Firefox Dev Ed had erased a ton of stuff all not only
relevant but vital in tracking down a bug.

Thanks.

mratc...@mozilla.com

unread,
Jul 21, 2015, 5:25:07 AM7/21/15
to mozilla-dev-d...@lists.mozilla.org
If you are talking about debugging in C++ then sure, you can just include a file called .mozconfig at the root of your project with these contents:
ac_add_options --disable-optimize

My .mozconfig contains the following:
# clobber whenever necessary
mk_add_options AUTOCLOBBER=1
# Enable debug build (includes lots of logging etc.)
ac_add_options --enable-debug
# Enable for C++ debugging
ac_add_options --disable-optimize

Nicolas B. Pierron

unread,
Jul 21, 2015, 5:53:24 AM7/21/15
to mozilla-dev-d...@lists.mozilla.org
Hi Russ,
The problem is not necessary coming from the DevTools, it might be caused by
the optimizing compiler.

If this is caused by the optimizing compiler (IonMonkey), then you can
disable it in "about:config", by turning off the option
"javascript.options.ion" off. Do not forget to turn it back on, for your
navigation, or when measuring performances.

Can you describe how you are using the devtools, such that we can get a
better understanding of what might be wrong?

--
Nicolas B. Pierron

Russ Thomas

unread,
Jul 21, 2015, 8:44:21 AM7/21/15
to Nicolas B. Pierron, mozilla-dev-d...@lists.mozilla.org
Hi Nicolas

On 21 July 2015 at 04:52, Nicolas B. Pierron <nicolas....@mozilla.com>
wrote:

>
> The problem is not necessary coming from the DevTools, it might be caused
> by the optimizing compiler.
>
>
Sounds likely. I will test again in a while and report back.



> If this is caused by the optimizing compiler (IonMonkey), then you can
> disable it in "about:config", by turning off the option
> "javascript.options.ion" off.


THANK YOU


> Do not forget to turn it back on, for your navigation, or when measuring
> performances.
>

Actually, for Dev Ed. and Nightly, I'll keep it OFF - it's a real PITA.


> Can you describe how you are using the devtools, such that we can get a
> better understanding of what might be wrong?


Well, in this particular instance, I'm using the debugger to trap a
particularly awkward bug deep in a nested structure (where recursion is
also likely happening, hard to say) and, having identified the exception
and the point it occurred, then tried to step back on the call stack to
investigate what put my code into that state. You know, normal everyday
debugging in the debugger ;) Apart from "this" and a couple other
window/global namespaced items, all vars were listed as "Optimized away" in
the variables pane. The command line in the console issues "Error:
Optimized out" when trying the same vars down there. This obviously
rendered devtools utterly useless - what's the point of having the stack
navigable if when using it it can't provide any info? (rhetorical).

IMO, really, ion should be optimized for development practices when
devtools is open, not force devs to switch to another dev platform. I'd
file a bug report but at this stage, it's more a complaint.

Thanks for reading. And thanks again for the about:config pointer -
excellent.

Russ




>
>
> --
> Nicolas B. Pierron
> _______________________________________________
> dev-developer-tools mailing list
> dev-devel...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-developer-tools
>

Russ Thomas

unread,
Jul 22, 2015, 9:59:59 AM7/22/15
to mozilla-dev-d...@lists.mozilla.org

Russ Thomas

unread,
Aug 6, 2015, 11:53:28 AM8/6/15
to mozilla-dev-d...@lists.mozilla.org, Jeff Griffiths
I sure hope this is fixed soon. Seems that even
javascript.options.ion:false is failing. This is making devtools debugger
almost completely useless. I don't want to switch to Chrome or IE, but now
I have to. Come on guys, this is just terrible.

Detail reminder: devtools debugger is "optimizing away" variables from the
Variables pane. The console fails with "optimized out" as does a watch
expression.

Platform: Windows 7, Firefox Dev Edition.

Jeff: Can you elevate this some kinda way? Thanks.

Jeff Griffiths

unread,
Aug 6, 2015, 12:14:17 PM8/6/15
to Russ Thomas, mozilla-dev-d...@lists.mozilla.org
Thanks for the nudge, Russ - I'll look into it. We have done a lot of
work on the debugger recently to improve performance and reliability,
and it sounds like this would be a good project to consider for the
next few cycles. As it involves working with Spidermonkey and the JIT,
I suspect it is not an easy fix.

regards, Jeff
0 new messages