Skip to content

stopOnEntry does not work when 'program' is omitted #201

Closed

Description

@jcrben

VSCode version:

Version: 1.42.0-insider
Commit: 7c0095ee2d064033fc13184127a9adc603454729
Date: 2019-12-20T07:55:38.353Z
Electron: 6.1.6
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 18.6.0

Launch.json:

    {
      "stopOnEntry": true,
      "name": "node relativeFile",
      "type": "node",
      "request": "launch",
      "args": ["${workspaceFolder}/${relativeFile}"],
      "cwd": "${workspaceFolder}/backend"
    },

Script file:

const fs = require('fs');
console.log('hmm');

This is adapted from a ts-node launch json where I have an additional "runtimeArgs": ["-r", "ts-node/register"],. Of course does this not run, but it's the next step.

I did notice that this does work:

    {
      "name": "node launch Program",
      "type": "node",
      "request": "launch",
      "program": "${file}"
    },

It just hangs:
image

No output in the log:
image

So it seems like passing the file in as an argument rather than program is not working? But the same command does work on the CLI, e.g. /Users/bencreasy/.local/nodenv/shims/node /Users/bencreasy/code/stock-analysis/backend/src/db/migrations/migrate-csv-all-trading.js

Works in CLI:
image

I was originally motivated to try this due to "Step Over" in the current debugger continuously stepping in.

Activity

  1. jcrben commented on Jan 2, 2020

    @jcrben
    ContributorAuthor

    I ended up pulling this down and running it with the Extension Development Host. I set a breakpoint at

    const existingSession = this._sessionForTarget.get(target);
    and stepped around.

    I haven't figured out the issue yet - eventually the call stack is empty but it's still running.
    image

    In another round, this breakpoint hit in a confusing manner where it appears as if it's stopped on the error but the variables doesn't seem to support that.

    image

    Also noticing it breaking at some sort of invisible breakpoint. The below is a stop from a Continue and the Call Stack says "Paused on breakpoint", but there's no breakpoint nearby. Particularly annoying since it's stopping on a timeout and if I don't click fast enough, it rejects the promise.
    image

  2. jcrben commented on Jan 3, 2020

    @jcrben
    ContributorAuthor
  3. roblourens commented on Jan 3, 2020

    @roblourens
    Member

    'program' should be optional, it is in the current debug adapter. You can send a PR if you'd like.

  4. jcrben commented on Jan 3, 2020

    @jcrben
    ContributorAuthor

    One more issue: stopOnEntry does not work when the program is unspecified. Reproduced at https://gitlab.com/jcrben-repro/vscode-debugging-repro

  5. changed the title [-] Cannot run small script[/-] [+]Issues when `program` is omitted[/+] on Jan 3, 2020
  6. changed the title [-]Issues when `program` is omitted[/-] [+]Issues when program' is omitted[/+] on Jan 3, 2020
  7. changed the title [-]Issues when program' is omitted[/-] [+]Issues when 'program' is omitted[/+] on Jan 3, 2020
  8. jcrben commented on Jan 3, 2020

    @jcrben
    ContributorAuthor

    Should I open a new issue for the stopOnEntry thing I mentioned in my last comment?

  9. connor4312 commented on Jan 3, 2020

    @connor4312
    Member

    I'll reopen this until that gets fixed

  10. changed the title [-]Issues when 'program' is omitted[/-] [+]stopOnEntry does not work when 'program' is omitted[/+] on Jan 3, 2020
  11. added
    bug
    on Jan 6, 2020
  12. added a commit that references this issue on Jan 6, 2020
    1f665db
  13. added a commit that references this issue on Jan 7, 2020
    770cee6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions