debugger icon indicating copy to clipboard operation
debugger copied to clipboard

[Stepping] step through generated files

Open jasonLaster opened this issue 9 years ago • 3 comments

It would be nice to be able to step through code in the generated file. This basically means that we want to know when we're stepping that the currently selected source is generated. If the source is generated, then we don't want to map the selected location.

We can also take this idea one step further and when you select a source, we can make all locations are mapped:

  • call stack
  • selected line
@@ -57,8 +73,11 @@ export function paused(pauseInfo: Pause) {
   return async function({ dispatch, getState, client, sourceMaps }: ThunkArgs) {
     let { frames, why, loadedObjects } = pauseInfo;

-    frames = await updateFrameLocations(frames, sourceMaps);
-    const frame = frames[0];
+    const selectedLocation = getSelectedLocation(getState())
+    if (sourceMaps.isOriginalLocation(selectedLocation.get("id")) {
+      frames = await updateFrameLocations(frames, sourceMaps);
+      const frame = frames[0];
+    }

Steps to get started:

  1. go to increment
  2. add a breakpoint at bundle.js#121
  3. click the increment button

You should pause on line 121, but instead you pause on math.js#3

Then, when you step, you should stay in bundle.js, but instead you go to math.js !!!

jasonLaster avatar Aug 31 '17 21:08 jasonLaster

/claim

borian avatar Nov 22 '17 15:11 borian

Thanks for claiming the issue! :wave:

!!! Please check your email and confirm the invitation

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Nov 22 '17 15:11 claim

Hey Jason I created a pull request with this feature https://github.com/devtools-html/debugger.html/pull/5025

borian avatar Jan 04 '18 19:01 borian