Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug: fix RPC params of method CreateBreakpoint #2908

Merged
merged 1 commit into from
Jun 6, 2020

Conversation

MarcoQin
Copy link
Contributor

@MarcoQin MarcoQin commented Jun 6, 2020

When to clear breakpoint after debug process started, the debugger will exit with status 0. Correct the RPC method's param type can fix this.

@bhcleek
Copy link
Collaborator

bhcleek commented Jun 6, 2020

I'm not sure what this fixes. Can you provide a description of the problem that this solves?

@MarcoQin
Copy link
Contributor Author

MarcoQin commented Jun 6, 2020

I encountered a problem when I did the following steps:

  1. :GoDebugStart
  2. Use :GoDebugBreakpoint to add a breakpoint on a line
  3. :GoDebugContinue
  4. Use :GoDebugBreakpoint again to clear the breakpoint I set previously
  5. The status bar shows: vim-go [debug] SUCCESS, and I noticed the dlv process exit (maybe killed by the job, because the jsonRPC did not correct responsed)

The RPCServer.ClearBreakpoint method receives an int id and a string name, but the type of l:found.id is string. So I just cast it to int, and the error gone.

@bhcleek
Copy link
Collaborator

bhcleek commented Jun 6, 2020

Thank you for contributing @MarcoQin.

The underlying issue here would be ideally resolved by executing a function that provides the id as a number, sign_getplaced(), but that function is not available until Vim 8.1.0614 and vim-go currently supports > Vim 8.0.1453 and therefore must rely on normal mode commands, which return a string, so this is indeed the right fix.

@bhcleek bhcleek merged commit 9fea0c6 into fatih:master Jun 6, 2020
@bhcleek bhcleek added this to the vim-go 1.24 milestone Jun 6, 2020
bhcleek added a commit that referenced this pull request Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants