Closed Bug 1388825 Opened 7 years ago Closed 7 years ago

Debugger pane completely empty in the browser toolbox in one of my profiles

Categories

(DevTools :: Debugger, defect, P3)

55 Branch
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1391719

People

(Reporter: Gijs, Assigned: jdescottes)

Details

Attachments

(1 obsolete file)

It works on an empty profile. I would like to know why it's broken on the other one. Stdout/err has:


JavaScript error: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/client/debugger/new/debugger.js, line 37638: SyntaxError: JSON.parse: bad control character in string literal at line 1 column 428 of the JSON data
console.error: 
  Message: TypeError: this.panelWin.Debugger is undefined
  Stack:
    open@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/client/debugger/new/panel.js:29:1
onLoad@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/client/framework/toolbox.js:1551:19


I don't really know what to make of that.
As discussed on IRC, I suspect this could be another manifestation of Bug 1388128.

The way the profile of the browser toolbox is created is to copy the current profile + override some preferences with custom values. This means that the fix we landed in Bug 1388128 might not easily make its way to the browser toolbox profile. 

A safer way of forcing a breakpoints cleanup is probably to bump the model version expected by the debugger runtime.
So, it seems this is broken because of this pref containing a saved expression:


      user_pref("devtools.debugger.expressions", "[{\"input\":\"BookmarkingUI.anchor\",\"value\":{\"from\":\"server2.conn0.consoleActor2\",\"input\":\"BookmarkingUI.anchor\",\"result\":{\"type\":\"object\",\"actor\":\"server2.conn0.obj900\",\"class\":\"XULElement\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":0,\"preview\":{\"kind\":\"DOMNode\",\"nodeType\":1  ,\"nodeName\":\"image\",\"isConnected\":true,\"attributes\":{\"id\":\"star-button\",\"class\":\"urlbar-icon\",\"tooltiptext\":\"Edit this bookmark (^XD)\",\"preloadanimations\":\"true\",\"anima  te\":\"true\",\"starred\":\"true\"},\"attributesLength\":6}},\"timestamp\":1501764023273,\"exception\":null,\"frame\":null,\"helperResult\":null,\"notes\":null},\"updating\":false,\"visible\":true}]");¬ 


This was copy-pasted from VI so might be slightly mangled, but the gist is:
\"Edit this bookmark (^XD)\"

where ^X will be a control char representing the apple command sign that we use for shortcuts.


Some suggestions:

1) we should probably not save previews of expression values across restarts
2) if loading them from the pref fails, startup should not fail.
3) if we do save things with control chars, we should make sure they get saved in a way that we can re-parse when loading.
Attachment #8895478 - Attachment is obsolete: true
In case anyone wants to reproduce, you can follow the STRs below:
- open the browser toolbox
- with the browser toolbox inspector, select the "star" icon inside the URL 
- switch to the browser toolbox debugger, break anywhere
- in the console run "var test = $0"
- add a watch expression on "test"
- quit the browser toolbox 
- restart the browser toolbox -> empty debugger
Much simpler STRs:

- open the debugger
- break anywhere
- evaluate `var test = "⌘"`
- add a watch expression on `test`
- close/reopen the debugger

So for the record, JSON.parse(JSON.stringify("⌘")) works fine of course. Which means that the step creating the bug is when we save it to a pref.
Maybe using a string pref rather than a char pref would work?
(In reply to :Gijs from comment #7)
> Maybe using a string pref rather than a char pref would work?

Thanks for the suggestion! Just tested locally and it fixes the issue, I will send a PR on GitHub for that.
PR to devtools-core has been merged. 
Opened a PR for the debugger to get the fix from devtools-core: https://github.com/devtools-html/debugger.html/pull/3620 

After it gets merged, this will be blocked on the next debugger bundle update in m-c.
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Priority: -- → P3
Both PRs are merged, now waiting for the next debugger update in m-c!
Should be fixed by landing the new debugger bundle which is being updated in Bug 1391719.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: