Open Bug 1096736 Opened 10 years ago Updated 2 years ago

The frontend shouldn't do any code-deleting optimizations because it makes the debugger unable to set breakpoints on that code

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

People

(Reporter: fitzgen, Unassigned)

References

(Blocks 2 open bugs)

Details

No breakpoints because no offsets.

Things like "if (true) \n..." get optimized, resulting in not being able to break on the conditional.
Quickest fix: In js/src/frontend/FoldConstants.cpp, in the second switch statement, try deleting
the code in "case PNK_IF:" and "case PNK_CONDITIONAL:".
Er, in the function Fold().

Brian, is this still a concern?

Flags: needinfo?(bhackett1024)

Yeah, it is. If I open the page below in the debugger, breakpoints can only be set on the bar() call, and not the 'if (true)' or the baz() call.

<script>
if (true) {
bar();
} else {
baz();
}
</script>

Flags: needinfo?(bhackett1024)
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.