Permalink
Browse files

Merge inbound to mozilla-central. a=merge

  • Loading branch information...
cristianbrindusan committed Feb 11, 2019
2 parents bdd8e3c + 3d11398 commit 00c0d068ece99717bea7475f7dc07e61f7f35984
Showing with 611 additions and 1,202 deletions.
  1. +3 −10 devtools/client/debugger/new/src/actions/breakpoints/addBreakpoint.js
  2. +5 −27 devtools/client/debugger/new/src/actions/breakpoints/index.js
  3. +18 −34 devtools/client/debugger/new/src/actions/breakpoints/syncBreakpoint.js
  4. +15 −1 devtools/client/debugger/new/src/actions/tests/pending-breakpoints.spec.js
  5. +3 −5 devtools/client/debugger/new/src/client/firefox.js
  6. +37 −80 devtools/client/debugger/new/src/client/firefox/commands.js
  7. +3 −37 devtools/client/debugger/new/src/client/firefox/types.js
  8. +11 −0 devtools/client/debugger/new/src/client/index.js
  9. +11 −0 devtools/client/debugger/new/src/types.js
  10. +20 −1 devtools/client/debugger/new/src/utils/breakpoint/index.js
  11. +6 −1 devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-actions.js
  12. +7 −0 devtools/client/debugger/new/test/mochitest/browser_dbg-editor-gutter.js
  13. +2 −1 devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-01.js
  14. +2 −1 devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-02.js
  15. +6 −3 devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-03.js
  16. +2 −1 devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-04.js
  17. +2 −1 devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-05.js
  18. +2 −1 devtools/client/webreplay/mochitest/browser_dbg_rr_console_warp-01.js
  19. +2 −1 devtools/client/webreplay/mochitest/browser_dbg_rr_replay-01.js
  20. +4 −2 devtools/client/webreplay/mochitest/browser_dbg_rr_replay-02.js
  21. +2 −1 devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-01.js
  22. +2 −1 devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-02.js
  23. +2 −1 devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-03.js
  24. +2 −1 devtools/client/webreplay/mochitest/browser_dbg_rr_stepping-04.js
  25. +8 −2 devtools/client/webreplay/mochitest/head.js
  26. +16 −34 devtools/server/actors/breakpoint.js
  27. +13 −79 devtools/server/actors/source.js
  28. +30 −28 devtools/server/actors/thread.js
  29. +9 −8 devtools/server/actors/utils/TabSources.js
  30. +21 −131 devtools/server/actors/utils/breakpoint-actor-map.js
  31. +0 −1 devtools/server/actors/utils/moz.build
  32. +0 −57 devtools/server/actors/utils/source-actor-store.js
  33. +2 −2 devtools/server/tests/unit/head_dbg.js
  34. +1 −1 devtools/server/tests/unit/test_blackboxing-01.js
  35. +2 −5 devtools/server/tests/unit/test_blackboxing-02.js
  36. +4 −4 devtools/server/tests/unit/test_blackboxing-03.js
  37. +2 −3 devtools/server/tests/unit/test_blackboxing-04.js
  38. +2 −2 devtools/server/tests/unit/test_blackboxing-08.js
  39. +2 −4 devtools/server/tests/unit/test_breakpoint-01.js
  40. +3 −10 devtools/server/tests/unit/test_breakpoint-02.js
  41. +20 −25 devtools/server/tests/unit/test_breakpoint-04.js
  42. +22 −24 devtools/server/tests/unit/test_breakpoint-09.js
  43. +18 −22 devtools/server/tests/unit/test_breakpoint-10.js
  44. +19 −23 devtools/server/tests/unit/test_breakpoint-11.js
  45. +56 −54 devtools/server/tests/unit/test_breakpoint-13.js
  46. +53 −53 devtools/server/tests/unit/test_breakpoint-14.js
  47. +24 −25 devtools/server/tests/unit/test_breakpoint-16.js
  48. +2 −3 devtools/server/tests/unit/test_breakpoint-18.js
  49. +1 −7 devtools/server/tests/unit/test_breakpoint-19.js
  50. +1 −11 devtools/server/tests/unit/test_breakpoint-20.js
  51. +2 −3 devtools/server/tests/unit/test_breakpoint-21.js
  52. +16 −18 devtools/server/tests/unit/test_conditional_breakpoint-01.js
  53. +16 −20 devtools/server/tests/unit/test_conditional_breakpoint-02.js
  54. +14 −16 devtools/server/tests/unit/test_conditional_breakpoint-03.js
  55. +3 −3 devtools/server/tests/unit/test_logpoint-01.js
  56. +3 −3 devtools/server/tests/unit/test_logpoint-02.js
  57. +3 −11 devtools/server/tests/unit/test_setBreakpoint-at-the-beginning-of-a-line.js
  58. +3 −11 devtools/server/tests/unit/test_setBreakpoint-at-the-beginning-of-a-minified-fn.js
  59. +3 −11 devtools/server/tests/unit/test_setBreakpoint-at-the-end-of-a-line.js
  60. +3 −11 devtools/server/tests/unit/test_setBreakpoint-at-the-end-of-a-minified-fn.js
  61. +3 −8 devtools/server/tests/unit/test_setBreakpoint-on-column-in-gcd-script.js
  62. +3 −7 devtools/server/tests/unit/test_setBreakpoint-on-column.js
  63. +3 −8 devtools/server/tests/unit/test_setBreakpoint-on-line-in-gcd-script.js
  64. +3 −7 devtools/server/tests/unit/test_setBreakpoint-on-line-with-multiple-offsets.js
  65. +3 −6 devtools/server/tests/unit/test_setBreakpoint-on-line-with-multiple-statements.js
  66. +3 −6 devtools/server/tests/unit/test_setBreakpoint-on-line.js
  67. +1 −1 devtools/server/tests/unit/test_stepping-08.js
  68. +3 −0 devtools/server/tests/unit/xpcshell.ini
  69. +0 −100 devtools/shared/client/breakpoint-client.js
  70. +0 −1 devtools/shared/client/moz.build
  71. +0 −82 devtools/shared/client/source-client.js
  72. +11 −0 devtools/shared/client/thread-client.js
  73. +0 −22 devtools/shared/specs/breakpoint.js
  74. +0 −6 devtools/shared/specs/index.js
  75. +0 −1 devtools/shared/specs/moz.build
  76. +11 −0 devtools/shared/specs/script.js
  77. +0 −10 devtools/shared/specs/source.js
  78. +1 −1 toolkit/components/thumbnails/test/browser.ini
@@ -11,7 +11,7 @@ import {
getASTLocation,
assertLocation,
makeBreakpointId,
makeSourceActorLocation
makeBreakpointLocation
} from "../../utils/breakpoint";
import { PROMISE } from "../utils/middleware/promise";
import {
@@ -71,15 +71,8 @@ async function addBreakpointPromise(getState, client, sourceMaps, breakpoint) {
return newBreakpoint;
}

const sourceActors = getSourceActors(state, generatedSource.id);

for (const sourceActor of sourceActors) {
const sourceActorLocation = makeSourceActorLocation(
sourceActor,
generatedLocation
);
await client.setBreakpoint(sourceActorLocation, breakpoint.options);
}
const breakpointLocation = makeBreakpointLocation(getState(), generatedLocation);
await client.setBreakpoint(breakpointLocation, breakpoint.options);

const symbols = getSymbols(getState(), source);
const astLocation = await getASTLocation(source, symbols, location);
@@ -23,7 +23,7 @@ import {
import {
assertBreakpoint,
createXHRBreakpoint,
makeSourceActorLocation
makeBreakpointLocation
} from "../../utils/breakpoint";
import {
addBreakpoint,
@@ -49,19 +49,8 @@ import type {
import { recordEvent } from "../../utils/telemetry";

async function removeBreakpointsPromise(client, state, breakpoint) {
const sourceActors = getSourceActors(
state,
breakpoint.generatedLocation.sourceId
);
for (const sourceActor of sourceActors) {
const sourceActorLocation = makeSourceActorLocation(
sourceActor,
breakpoint.generatedLocation
);
if (client.getBreakpointByLocation(sourceActorLocation)) {
await client.removeBreakpoint(sourceActorLocation);
}
}
const breakpointLocation = makeBreakpointLocation(state, breakpoint.generatedLocation);
await client.removeBreakpoint(breakpointLocation);
}

/**
@@ -304,19 +293,8 @@ export function setBreakpointOptions(
await dispatch(enableBreakpoint(bp));
}

const sourceActors = getSourceActors(
getState(),
bp.generatedLocation.sourceId
);
for (const sourceActor of sourceActors) {
const sourceActorLocation = makeSourceActorLocation(
sourceActor,
bp.generatedLocation
);
if (client.getBreakpointByLocation(sourceActorLocation)) {
await client.setBreakpointOptions(sourceActorLocation, options);
}
}
const breakpointLocation = makeBreakpointLocation(getState(), bp.generatedLocation);
await client.setBreakpoint(breakpointLocation, options);

const newBreakpoint = { ...bp, disabled: false, options };

@@ -11,7 +11,8 @@ import {
assertBreakpoint,
assertPendingBreakpoint,
findScopeByName,
makeSourceActorLocation
makeSourceActorLocation,
makeBreakpointLocation
} from "../../utils/breakpoint";

import { getGeneratedLocation } from "../../utils/source-maps";
@@ -125,7 +126,16 @@ export async function syncBreakpointPromise(
scopedGeneratedLocation
);

const sourceActors = getSourceActors(getState(), sourceId);
// makeBreakpointLocation requires the source to still exist, which might not
// be the case if we navigated.
if (!getSource(getState(), generatedSourceId)) {
return null;
}

const breakpointLocation = makeBreakpointLocation(getState(), generatedLocation);
const scopedBreakpointLocation =
makeBreakpointLocation(getState(), scopedGeneratedLocation);

let possiblePosition = true;
if (features.columnBreakpoints && generatedLocation.column != undefined) {
const { positions } = await dispatch(
@@ -141,19 +151,7 @@ export async function syncBreakpointPromise(
if (possiblePosition && (pendingBreakpoint.disabled || isSameLocation)) {
// Make sure the breakpoint is installed on all source actors.
if (!pendingBreakpoint.disabled) {
for (const sourceActor of sourceActors) {
const sourceActorLocation = makeSourceActorLocation(
sourceActor,
generatedLocation
);
if (!client.getBreakpointByLocation(sourceActorLocation)) {
await client.setBreakpoint(
sourceActorLocation,
pendingBreakpoint.options,
isOriginalId(sourceId)
);
}
}
await client.setBreakpoint(breakpointLocation, pendingBreakpoint.options);
}

const originalText = getTextAtPosition(source, previousLocation);
@@ -170,15 +168,7 @@ export async function syncBreakpointPromise(
}

// clear server breakpoints if they exist and we have moved
for (const sourceActor of sourceActors) {
const sourceActorLocation = makeSourceActorLocation(
sourceActor,
generatedLocation
);
if (client.getBreakpointByLocation(sourceActorLocation)) {
await client.removeBreakpoint(sourceActorLocation);
}
}
await client.removeBreakpoint(breakpointLocation);

if (!possiblePosition || !scopedGeneratedLocation.line) {
return { previousLocation, breakpoint: null };
@@ -188,18 +178,12 @@ export async function syncBreakpointPromise(
// If we are not disabled, set the breakpoint on the server and get
// that info so we can set it on our breakpoints.

for (const sourceActor of sourceActors) {
const sourceActorLocation = makeSourceActorLocation(
sourceActor,
scopedGeneratedLocation
);
await client.setBreakpoint(
sourceActorLocation,
pendingBreakpoint.options,
isOriginalId(sourceId)
);
if (!scopedGeneratedLocation.line) {
return { previousLocation, breakpoint: null };
}

await client.setBreakpoint(scopedGeneratedLocation, pendingBreakpoint.options);

const originalText = getTextAtPosition(source, scopedLocation);
const text = getTextAtPosition(generatedSource, scopedGeneratedLocation);

@@ -42,6 +42,7 @@ import {
selectors,
actions,
makeOriginalSource,
makeSource,
waitForState
} from "../../utils/test-head";

@@ -128,6 +129,8 @@ describe("when adding breakpoints", () => {
loadInitialState()
);

await dispatch(actions.newSource(makeSource("foo")));

const csr1 = makeOriginalSource("foo");
const csr2 = makeOriginalSource("foo2");

@@ -178,6 +181,8 @@ describe("when changing an existing breakpoint", () => {
const bp = generateBreakpoint("foo");
const id = makePendingLocationId(bp.location);

await dispatch(actions.newSource(makeSource("foo")));

const csr = makeOriginalSource("foo");
await dispatch(actions.newSource(csr));
await dispatch(actions.loadSourceText(csr.source));
@@ -229,6 +234,8 @@ describe("initializing when pending breakpoints exist in prefs", () => {
);
const bar = generateBreakpoint("bar.js");

await dispatch(actions.newSource(makeSource("bar.js")));

const csr = makeOriginalSource("bar.js");
await dispatch(actions.newSource(csr));
await dispatch(actions.loadSourceText(csr.source));
@@ -267,6 +274,7 @@ describe("initializing with disabled pending breakpoints in prefs", () => {
const { getState, dispatch } = store;
const csr = makeOriginalSource("bar.js");

await dispatch(actions.newSource(makeSource("bar.js")));
await dispatch(actions.newSource(csr));
await dispatch(actions.loadSourceText(csr.source));

@@ -297,6 +305,8 @@ describe("adding sources", () => {
expect(selectors.getBreakpointCount(getState())).toEqual(0);

const csr = makeOriginalSource("bar.js");

await dispatch(actions.newSource(makeSource("bar.js")));
await dispatch(actions.newSource(csr));
await dispatch(actions.loadSourceText(csr.source));

@@ -322,6 +332,7 @@ describe("adding sources", () => {

expect(selectors.getBreakpointCount(getState())).toEqual(0);

await dispatch(actions.newSource(makeSource("bar.js")));
await dispatch(actions.newSource(csr));

await waitForState(store, state => selectors.getBreakpointCount(state) > 0);
@@ -337,12 +348,15 @@ describe("adding sources", () => {

const csr1 = makeOriginalSource("bar.js");
const csr2 = makeOriginalSource("foo.js");
await dispatch(actions.newSource(makeSource("bar.js")));
await dispatch(actions.newSources([csr1, csr2]));
await dispatch(actions.loadSourceText(csr1.source));
await dispatch(actions.loadSourceText(csr2.source));

await waitForState(store, state => selectors.getBreakpointCount(state) > 0);

expect(selectors.getBreakpointCount(getState())).toEqual(1);
// N.B. this test is kind of broken and creates different breakpoints for
// the generated and original bar.js sources.
expect(selectors.getBreakpointCount(getState())).toEqual(2);
});
});
@@ -14,21 +14,21 @@ function createObjectClient(grip: Grip) {
return DebuggerClient.createObjectClient(grip);
}

export async function onConnect(connection: any, actions: Object): Object {
export async function onConnect(connection: any, actions: Object) {
const {
tabConnection: { tabTarget, threadClient, debuggerClient }
} = connection;

DebuggerClient = debuggerClient;

if (!tabTarget || !threadClient || !debuggerClient) {
return { bpClients: {} };
return;
}

const supportsWasm =
features.wasm && !!debuggerClient.mainRoot.traits.wasmBinarySource;

const { bpClients } = setupCommands({
setupCommands({
threadClient,
tabTarget,
debuggerClient,
@@ -69,8 +69,6 @@ export async function onConnect(connection: any, actions: Object): Object {
if (pausedPacket) {
clientEvents.paused(threadClient, "paused", pausedPacket);
}

return { bpClients };
}

export { createObjectClient, clientCommands, clientEvents };
Oops, something went wrong.

0 comments on commit 00c0d06

Please sign in to comment.