Bug 1601476 - Update value with watchpoint when stepping or hitting breakpoint. r=jlast.
authorMiriam <bmiriam1230@gmail.com>
Tue, 10 Dec 2019 00:32:24 +0000
changeset 2526100 8b6d1b8364bdf19fc0f9bda914cf07deff63a5f5
parent 2526099 31dee3951024d4c2a9c11cba08993eaeb3f05897
child 2526101 8c8ecd258df0f7e18204cd347d2db791a10967bf
child 2526103 33cb4de48c28cd1fea9daddbf72d17e142e43990
child 2526117 b4cbed2eec01326f8e1580786d6b4ffa1ff621fe
child 2526132 ff0004829c9062eade0876e4320ead55c5d4f2df
child 2526138 099d7d604060d02ae50b123354f2fdc6c2ee7968
child 2526140 2182ddc20e186e9ffdc0c882d8db127a77e5c263
child 2526150 b34e74487b03a31bcf80c6881159932b883e2c67
child 2526159 143ce7dd03c0d9e5d1dccc0a8bb2d3aca1ac641a
child 2526161 c8d6eb5d6d563b0db4b9dc5b8a256a178b18f0d5
child 2526164 185b00f17117e44607470e89319cdcf155e781bb
child 2526170 194dc1d140180bc84eef67909593d29925d714be
child 2526175 2e6e6f2a3ac9cbc6fe99f11bf98b3f2e47c6bc55
child 2526177 27d67bf8ce319d91ada36c976eec8e017108a8ba
child 2526184 32b4214b52ee19cf57dfb07a7f7cbc4a9febb249
child 2526187 3545c75ee7067c85328ecc08db090c08618bc1c1
child 2526189 7130158fa20b114a71a666c49ff3a54b2b105ac9
child 2526211 82f0662f1de53a9dabb4291db0dcc8812ce3df05
child 2526232 3a47eadea8af8b371a56c8ac66e3cca2db2d8a0d
child 2526234 1d5d5a8cbed1c97f300929a060a2d2daf3cc6ed5
child 2526243 9559f7dd8fc8a3c3c216bf6259a8a538e8cc6a3c
child 2526247 0c3712edfdbb8a7d377dbbaf991a9d16c017bb8b
child 2526262 ee761ac40085d67762caf329bc3abce7f0f40869
child 2526279 5fb79c297248dd5f0ee85f0ef1ccf239fd19e4da
child 2526288 a15b230298892780bb9a644c449f18831ea3f774
child 2526435 1539443131424399b782fd34786f372af066ef0c
child 2526441 62df1739321ea80cefa774fbeec5f00c28060274
child 2526488 98c899c428487ee409fa03faf6e3a9b81c590bf8
child 2526499 41411fff70757274c141eb14be3be13987d5484d
child 2526538 a35d1a583de1213f8cc23bd736341e50d659dde9
child 2526546 31e0432b9472e8f44d732e93359ba64da2a244b6
child 2526572 c3a11f1c497323e0297b2a8f7bbc5622f1e78a0c
child 2526641 fdab5e5eb732d70b394f9771ce0510ce6fb224c4
child 2526662 32e2308828896f7a4bebe5aff98bb3efb2c72871
child 2526708 7dff86ff959251775e2bca3622e4cf03a8d6e981
child 2526737 6ea4814fcb1fb407d1aaf29488f335c4ff113ce3
child 2526769 a653ebee9068ae124f259d2305ddc018ff69124a
child 2526798 f0a88b0d7a401a5cbb816758aa0797bc7b58e93d
child 2526801 cbfdda41733bb245c21c10f2cb8cec0faa25ce00
child 2526956 947af65a7a84f32ef364cd0e2b943de6588e5d1e
child 2526969 6661fbc0fc1e441358bb60208951a31ab63caeeb
child 2526992 8be7dd8a03cbcfd644ac1d423bb1ad79e52dce81
child 2526998 090a6bdb490255cc8bdac9950d048e32e4b6e9b9
child 2527027 62c4fef89e50aa5681342a7f67664a9356514183
child 2527055 3670d8709ba54ecfd910a4a293ad4facc77a6e9e
child 2527070 d349939eaf81a26af928eb1bc4abd7b8550b5b99
child 2527100 f18900c4905b3c2bafb0bea41a1677a7fafafd9f
child 2527151 2682b1ea5f65400fce8f8952f099c5e5c4be53bc
child 2527156 57134f820c9c72f223e66e58ca65189cfca76f8d
child 2527180 ddc3e9a2fa8aae0ca3efd7e25d2256aff9b5a9a1
child 2527225 ba7d9d6ce1692d5dfc195525de068a2f54f0d19d
child 2527304 e70577068674888ea24233a37ec34f7688e45400
child 2527454 29ff90055497ce6c4734a6f71fb4d3362d9f65aa
child 2527458 dfddeac1f319ff014e6ad3f6e93e4d876cee61b3
child 2527466 97d31f1bd5e3d5e871f19e3dae8bf31aa79fc26f
child 2527613 9ee68c6e6b15c753c3d24d23298da1a11fb5de0e
child 2527782 4497596cda6bcf61a1c0ad9469f89d8a881549e8
child 2528246 3472a625d52c9c9755dc573dd3486ae9fc5dabf9
child 2528251 b8476a321697fe6adebf79f90708ab7b6fa9e1e1
child 2529216 45a66e27b340ba532c9a29aec8c7d0bdb9edcf43
child 2529369 49e601ab97b9856dc0f05d09911b77f023ee094c
child 2529801 51ee98a63332ce0a558438382afd9afa1e162613
child 2529832 9af8f29c8d09408b4a1a73e2e6d882a9e61939d4
child 2529936 913b8510a1072c0cbcdb75689e4b17e6dab1b257
child 2529995 2bb1bb924059df0be66d144ffa73939889ed7d4e
child 2529999 470bb32e83d2ff0b1be3fbcf76a437241e475c1b
child 2530020 c2932baff42237eebea04869beca26507680a366
child 2530447 8034ddb0099cd500acbebe20afe3ab84052c59bc
child 2530449 b42e5f1fa7a372dad9ba09e85c9870e2f02110fb
child 2531316 be1f8b4123c87cc2db8119b03b90992ea1e1e319
child 2531365 ad0eb6d3cdf387e67b005276f7d9ba95c21f70ed
child 2531534 11a2f1e5241e15a3fdc6b47c35ef8dc959dc1964
child 2558396 fd95e1afdf038e0fa53311a176bf692c310c5a12
child 2558409 5b3ffe6c28acc91ea9f46ed2ee851a3d6b0d88f8
child 2599195 718ffc3d51b7d82779d1384d0cb868679a14185c
push id462938
push useregao@mozilla.com
push dateTue, 10 Dec 2019 07:05:56 +0000
treeherdertry@23bf012a8126 [default view] [failures only]
reviewersjlast
bugs1601476
milestone73.0a1
Bug 1601476 - Update value with watchpoint when stepping or hitting breakpoint. r=jlast. Differential Revision: https://phabricator.services.mozilla.com/D56476
devtools/server/actors/object.js
devtools/server/tests/unit/test_watchpoint-02.js
--- a/devtools/server/actors/object.js
+++ b/devtools/server/actors/object.js
@@ -165,16 +165,17 @@ const proto = {
     if (watchpointType === "set") {
       this.obj.defineProperty(property, {
         configurable: desc.configurable,
         enumerable: desc.enumerable,
         set: this.obj.makeDebuggeeValue(v => {
           const frame = this.thread.dbg.getNewestFrame();
 
           if (!this.thread.hasMoved(frame, "setWatchpoint")) {
+            desc.value = v;
             return;
           }
 
           pauseAndRespond("setWatchpoint");
           desc.value = v;
         }),
         get: this.obj.makeDebuggeeValue(() => {
           return desc.value;
--- a/devtools/server/tests/unit/test_watchpoint-02.js
+++ b/devtools/server/tests/unit/test_watchpoint-02.js
@@ -14,17 +14,30 @@ add_task(
     await testBreakpointAndSetWatchpoint(args);
     await testBreakpointAndGetWatchpoint(args);
     await testLoops(args);
   })
 );
 
 // Test that we advance to the next line when a location
 // has both a breakpoint and set watchpoint.
-async function testBreakpointAndSetWatchpoint({ threadFront, debuggee }) {
+async function testBreakpointAndSetWatchpoint({
+  threadFront,
+  debuggee,
+  targetFront,
+}) {
+  async function evaluateJS(input) {
+    const consoleFront = await targetFront.getFront("console");
+    const { result } = await consoleFront.evaluateJSAsync(input, {
+      thread: threadFront.actor,
+      frameActor: packet.frame.actorID,
+    });
+    return result;
+  }
+
   function evaluateTestCode(debuggee) {
     /* eslint-disable */
     Cu.evalInSandbox(
       `                                   // 1
       function stopMe(obj) {              // 2
         debugger;                         // 3
         obj.a = 2;                        // 4
         debugger;                         // 5
@@ -68,16 +81,20 @@ async function testBreakpointAndSetWatch
   Assert.equal(packet2.why.type, "breakpoint");
 
   const packet3 = await resumeAndWaitForPause(threadFront);
 
   info("Test that we pause on the second debugger statement.");
   Assert.equal(packet3.frame.where.line, 5);
   Assert.equal(packet3.why.type, "debuggerStatement");
 
+  info("Test that the value has updated.");
+  const result = await evaluateJS("obj.a");
+  Assert.equal(result, 2);
+
   info("Remove breakpoint and finish.");
   threadFront.removeBreakpoint(location, {});
 
   await resume(threadFront);
 }
 
 // Test that we advance to the next line when a location
 // has both a breakpoint and get watchpoint.