Browse Source

Add minimal Detaching notify support

- Add Detaching define to YAML command list
- Add decoding support, convert to web UI uiMessage
pull/434/head
Sami Vaarala 9 years ago
parent
commit
efd946e83d
  1. 3
      debugger/duk_debug.js
  2. 2
      debugger/duk_debugcommands.yaml

3
debugger/duk_debug.js

@ -54,6 +54,7 @@ var CMD_PRINT = 0x02;
var CMD_ALERT = 0x03;
var CMD_LOG = 0x04;
var CMD_THROW = 0x05;
var CMD_DETACHING = 0x06;
// Commands initiated by the debug client (= us)
var CMD_BASICINFO = 0x10;
@ -1702,6 +1703,8 @@ Debugger.prototype.processDebugMessage = function (msg) {
this.uiMessage({ type: 'log', level: msg[2], message: prettyUiStringUnquoted(msg[3], UI_MESSAGE_CLIPLEN) });
} else if (msg[1] === CMD_THROW) {
this.uiMessage({ type: 'throw', fatal: msg[2], message: (msg[2] ? 'UNCAUGHT: ' : 'THROW: ') + prettyUiStringUnquoted(msg[3], UI_MESSAGE_CLIPLEN), fileName: msg[4], lineNumber: msg[5] });
} else if (msg[1] === CMD_DETACHING) {
this.uiMessage({ type: 'detaching', reason: msg[2], message: 'DETACH: ' + (msg.length >= 5 ? prettyUiStringUnquoted(msg[3]) : 'detaching') });
} else {
// Ignore unknown notify messages
console.log('Unknown notify, ignoring: ' + prettyDebugMessage(msg));

2
debugger/duk_debugcommands.yaml

@ -6,7 +6,7 @@
- Alert
- Log
- Throw
- Reserved_6
- Detaching
- Reserved_7
- Reserved_8
- Reserved_9

Loading…
Cancel
Save