question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

$attach command unavailable in Standard REPL/immediat

See original GitHub issue

Environment data

  • PTVS version: 15.7.18156.1-15.0
  • OS and version: Windows 10 (v1803 build 17134.167)
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.6
  • Visual Studio 2017 (15.7.6)

Actual behavior

In the interactive window the $attach command is not available: image

Expected behavior

The $attach command should be available and attach the debugger

Steps to reproduce:

  1. Create a new project from existing code
  2. Create Python 3.6 env
  3. Open a REPL window
  4. Type $attach

Maybe I’m doing something wrong?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
syagevcommented, Aug 16, 2018

I have to say that even after reading the docs multiple times, there’s something I’m missing.

I want to debug a function called from an interactive window. So if I have a function a I want to put a breakpoint on the first line of the definition of a and type a() in the debug window and then step line-by-line. I thought this use case might be available through $attach.

I also tried putting one breakpoint on the first line in a’s function body, and another breakpoint right after the defenition of a. I then run the file using the regular debugger (F5), skip the first breakpoint and pause on the second one. Now via the ‘Debug’ REPL window, I type a(). The function executes but my first breakpoint is not hit.

So how should I be doing it?

0reactions
syagevcommented, Aug 23, 2018

OK managed to get this working. I have to say that it the path to get to this point is completely non-trivial and shoud probably be documented somewhere.

As far as I’m concerned my original problem is solved, however the docs really aren’t updated about this in any way so I suggest regarding this issue as applied to the docs only. You can close at your discretion. Thanks for the help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found