Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

incompatible version of pydevd used with ptvsd #33

Closed
DonJayamanne opened this issue Feb 2, 2018 · 4 comments
Closed

incompatible version of pydevd used with ptvsd #33

DonJayamanne opened this issue Feb 2, 2018 · 4 comments

Comments

@DonJayamanne
Copy link
Contributor

I'm trying to hookup vscode with the new debubgger.
This seem to be going well, except until I try to add a breakpoint, thats when things fall over.

I'm getting the following error:

Traceback (most recent call last):
  File "/Users/donjayamanne/anaconda3/envs/py36/lib/python3.6/site-packages/_pydevd_bundle/pydevd_process_net_command.py", line 274, in process_net_command
    breakpoint_id = line = int(line)
ValueError: invalid literal for int() with base 10: '/Users/donjayamanne/Desktop/Development/vscode/ptvsd/main.py'

Looking at our code and PydDevd, we're not building the breakpoints correctly.
or, i'm doing something completely wrong

Here's what I've found:

  • We're building the internal protocol message using the following format:
            msgfmt = '{}\tpython-line\t{}\t{}\tNone\t{}\tNone'
            vsc_bpid = self.bp_map.add(
                    lambda vsc_bpid: (path, vsc_bpid))
            msg = msgfmt.format(vsc_bpid, path, line,
                                src_bp.get('condition', None))

See https://github.com/Microsoft/ptvsd/blob/master/ptvsd/wrapper.py#L556

type, file, line, func_name, suspend_policy, condition, expression = text.split('\t', 6)

I.e. the first item vsc_bpid is no longer necessary.

I managed to get things going by changing the format to msgfmt = 'python-line\t{}\t{}\tNone\tNone\t{}\tNone'.

Obviously this is not correct for two reasons:

  • How is it working for everyone else but me without this change?
    (and this is why I believe I'm doing something wrong).
  • The id mapping is now incorrect (hence removing breakpoints doesn't work)
@karthiknadig
Copy link
Member

We set msg = '1.1\tWINDOWS\tID' as the setting for pydevd. we use this part in pydevd:
https://github.com/fabioz/PyDev.Debugger/blob/master/_pydevd_bundle/pydevd_process_net_command.py#L253

@DonJayamanne
Copy link
Contributor Author

Got it, was a lack of understanding, closing this issue. Thanks

@int19h
Copy link
Contributor

int19h commented Feb 3, 2018

Are you still seeing issues with breakpoints not being removable though? I'm wondering if there's another bug here.

@DonJayamanne
Copy link
Contributor Author

If I do I'll file an issue.
I learnt how this hands together and now I need to manually send a fake initialize request to pydevd as that does all of the necessary boostrapping.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants