Closed
Bug 1400197
Opened 7 years ago
Closed 7 years ago
js debugger broken on BSD
Categories
(DevTools :: Debugger, defect)
Tracking
(firefox55 ?, firefox56 affected, firefox57 affected)
RESOLVED
FIXED
People
(Reporter: gaston, Unassigned)
Details
Opening the debugger in devtools on OpenBSD triggers lots of vomit:
console.error:
Message: TypeError: KEYS[os] is undefined
Stack:
getKeyForOS@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/client/debugger/new/debugger.js:29495:4
getKey@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/client/debugger/new/debugger.js:29491:11
Of course, no match for Tier3 platforms in this... :
var KEYS = {
WINNT: {
resume: "F8",
pause: "F8",
stepOver: "F10",
stepIn: "F11",
stepOut: "Shift+F11"
},
Darwin: {
resume: "Cmd+\\",
pause: "Cmd+\\",
stepOver: "Cmd+'",
stepIn: "Cmd+;",
stepOut: "Cmd+Shift+:",
stepOutDisplay: "Cmd+Shift+;"
},
Linux: {
resume: "F8",
pause: "F8",
stepOver: "F10",
stepIn: "Ctrl+F11",
stepOut: "Ctrl+Shift+F11"
}
};
Please, think of the kittens and take into account the BSDs or other non-Tier1 platforms (solaris ?)
Reporter | ||
Updated•7 years ago
|
Reporter | ||
Comment 1•7 years ago
|
||
And this is since https://github.com/devtools-html/debugger.html/commit/d928662df130176ba02a3e1bcc94fdfe3aaf02cf - jason, which is the better way to fix this horror ?
Flags: needinfo?(jlaster)
Comment 2•7 years ago
|
||
I'm sorry :gaston, I'll put a fix together today here: https://github.com/devtools-html/debugger.html/issues/4088
Is it okay to fall back on Linux shortcuts if the OS does not match?
Flags: needinfo?(jlaster)
Comment 3•7 years ago
|
||
Nobody asked me but yes, I would definitely expect to get Linux shortcuts on the BSDs. And I suppose that's the most likely OS family when Firefox isn't running on one of the big three?
Reporter | ||
Comment 4•7 years ago
|
||
Yes, in lots of cases you can fallback to 'linux' defaults.
Reporter | ||
Comment 5•7 years ago
|
||
Fwiw, i tried hotpatching devtools/client/debugger/new/debugger.js in ffx 56.0rc1 source tarball
- Linux: {
+ OpenBSD: {
but after a rebuild my patch/fix wasnt applied, i was still getting the same error, so i dunno what value appinfo.OS has on OpenBSD, and im not even sure *which* file ends up being used at runtime... even if i know its a bit late, would be good to fix that in 56.
Reporter | ||
Comment 6•7 years ago
|
||
Using this temporary workaround:
function getKeyForOS(os, action) {
- return KEYS[os][action];
+ return KEYS["Linux"][action];
}
The debugger window in devtools seems to be working again. I don't know how you want to properly fix it though... maybe
if (typeof KEYS[os] === 'undefined') {
return KEYS["Linux"][action];
}
return KEYS[os][action];
instead of listing all possible unix-like operating systems (bsds, solaris, etc..)
Comment 7•7 years ago
|
||
One option might be to use widgetToolkit instead.
https://dxr.mozilla.org/mozilla-central/rev/ffe6cc09ccf38cca6f0e727837bbc6cb722d1e71/xpcom/system/nsIXULRuntime.idl#64-68
This runs into a similar problem, arguably, but the set of possible window systems is smaller, maybe just:
https://dxr.mozilla.org/mozilla-central/rev/ffe6cc09ccf38cca6f0e727837bbc6cb722d1e71/layout/tools/reftest/reftest.jsm#729-735
Reporter | ||
Comment 8•7 years ago
|
||
Yes, that would also work for us.
Comment 9•7 years ago
|
||
This is now fixed on nightly.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 10•7 years ago
|
||
What's needed to get this uplifted to beta/57, since there's no link to a m-c commit ? Just requiring approval-beta?
Reporter | ||
Comment 11•7 years ago
|
||
Also, it seems it was reverted on github: https://github.com/devtools-html/debugger.html/commit/3e16c37df19cca00e7f29842c622f5e678ee9ac4
Reporter | ||
Comment 12•7 years ago
|
||
was/would be a candidate to be?
Reporter | ||
Comment 13•7 years ago
|
||
Qk, so it was commited to m-c on https://hg.mozilla.org/mozilla-central/rev/a001ffb41787#l1.209 - but not yet reverted ?
Reporter | ||
Comment 14•7 years ago
|
||
The tracking flags are still wrong, and given the github<->m-c mess, i cant figure out if it was actually commited and it sticked into the tree, and in which branch... jason ?
Flags: needinfo?(jlaster)
Comment 15•7 years ago
|
||
I believe the fix landed:
https://searchfox.org/mozilla-central/source/devtools/client/debugger/new/debugger.js#41643
and it came from this commit
https://searchfox.org/mozilla-central/diff/ebfefa4a4c1115c9f00bf9f0adb7fe87dac4646c/devtools/client/debugger/new/debugger.js#43657
Sorry for the large file sizes
Flags: needinfo?(jlaster)
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•