mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Create source actors from Debugger API notifications
Co-authored-by: atbrakhi <atbrakhi@igalia.com> Signed-off-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
parent
e2eabd41c9
commit
048d0b0538
13 changed files with 193 additions and 64 deletions
|
@ -1,20 +1,38 @@
|
|||
if (!("dbg" in this)) {
|
||||
dbg = new Debugger;
|
||||
debuggeesToPipelineIds = new Map;
|
||||
|
||||
dbg.onNewGlobalObject = function(global) {
|
||||
console.log("[debugger] onNewGlobalObject");
|
||||
console.log(this, global);
|
||||
console.log("[debugger] onNewGlobalObject", this, global);
|
||||
};
|
||||
|
||||
dbg.onNewScript = function(script, global) {
|
||||
console.log("[debugger] onNewScript");
|
||||
console.log(this, script, global);
|
||||
dbg.onNewScript = function(script, /* undefined; seems to be `script.global` now */ global) {
|
||||
try {
|
||||
console.log("[debugger] onNewScript url=", script.url, "source id=", script.source.id, "introductionType=", script.source.introductionType);
|
||||
try {
|
||||
console.log("[debugger] source binary=", typeof script.source.binary);
|
||||
} catch (error) {
|
||||
// Do nothing; the source is not wasm
|
||||
}
|
||||
notifyNewSource({
|
||||
pipelineId: debuggeesToPipelineIds.get(script.global),
|
||||
spidermonkeyId: script.source.id,
|
||||
url: script.source.url,
|
||||
text: script.source.text,
|
||||
});
|
||||
} catch (error) {
|
||||
logError(error);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
addEventListener("addDebuggee", event => {
|
||||
const {global} = event;
|
||||
const {global, pipelineId: {namespaceId, index}} = event;
|
||||
console.log("[debugger] Adding debuggee");
|
||||
dbg.addDebuggee(global);
|
||||
console.log("[debugger] getDebuggees().length =", dbg.getDebuggees().length);
|
||||
const debuggerObject = dbg.addDebuggee(global);
|
||||
debuggeesToPipelineIds.set(debuggerObject, {
|
||||
namespaceId,
|
||||
index,
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue