Author Topic: Quick way to attach to PTVSD?  (Read 321 times)

Exolon

  • Community Member
  • Posts: 44
  • Hero Points: 5
  • https://blog.mdb977.de/
Quick way to attach to PTVSD?
« on: September 16, 2020, 11:55:51 am »
Hi,

I'm currently using v25 to remote debug a Flask project. After every code change, I have to restart the service in my LXD container and then reattach SE via
Code: [Select]
Debug->Attach Debugger->Attach To Python menu.

Is there a faster way to attach to the debug client? I found no debug-attach-ptvsd command in the command line.

Thanks

Mike


patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1480
  • Hero Points: 133
Re: Quick way to attach to PTVSD?
« Reply #1 on: September 16, 2020, 01:53:46 pm »
If you don't want to have to bring up the dialog, you'd have to resort to using a macro.  There isn't a command to repeat the last debug session without prompting, though that does sound like it would be a helpful addition.  I'm not sure how much that will involve, I'll put it on my list to take a look at.

The attached source file provides a 'example_debug_attach' command whose parameters can be changed for the remote host, port and workspace name.  If you edit that, go to the SlickEdit command line and type "load testfile.e", you can bind that example_debug_attach command to a key, or just run it on the SlickEdit command line.


Exolon

  • Community Member
  • Posts: 44
  • Hero Points: 5
  • https://blog.mdb977.de/
Re: Quick way to attach to PTVSD?
« Reply #2 on: September 24, 2020, 11:40:11 am »
Thanks a lot for the macro.

I changed host, port and workspace, but unfortunately only get a 'Error initializing debugger: Error code out of range: 1'

Any idea?

Thanks

Mike

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1480
  • Hero Points: 133
Re: Quick way to attach to PTVSD?
« Reply #3 on: September 24, 2020, 01:01:32 pm »
Odd error code.  At the SlickEdit command line, type in "set-var def-debug-logging 2", and retry the macro, and then "set-var def-debug-logging 0". 

In your configuration directory, under 25.0.0/logs there will be a debug.log and dapcom.log, send those along.  That should give me an idea of where the error happened.

Exolon

  • Community Member
  • Posts: 44
  • Hero Points: 5
  • https://blog.mdb977.de/
Re: Quick way to attach to PTVSD?
« Reply #4 on: September 24, 2020, 01:29:46 pm »
I did, but the log file is not touched.

If I log a GUI connect I get log entries.

???

- Mike

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1480
  • Hero Points: 133
Re: Quick way to attach to PTVSD?
« Reply #5 on: September 24, 2020, 02:06:37 pm »
Odd.  I can get that too now.

Try with the attached testfile.e, after you update it's parameters. 

Exolon

  • Community Member
  • Posts: 44
  • Hero Points: 5
  • https://blog.mdb977.de/
Re: Quick way to attach to PTVSD?
« Reply #6 on: September 24, 2020, 02:16:27 pm »
Ah, yes, now it is working.

Thank you. Very appreciated.

- Mike