-
Notifications
You must be signed in to change notification settings - Fork 26
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
Windows support #5
Comments
Ocamldebug doesn't have a well-designed protocol. It's text based, and mainly face to user. If we don't use mkfifo, debuggee program's stdout and stderr will directly mixed into ocamldebug's stdout. We can't extract those out, because debuggee might output same message format as ocamldebug outputs. Clarify: Ocamldebug's stdout/stderr is not redirected. Debuggee's stdout/stderr is redirected. |
Sorry for mis-pressed close button. |
I think you are just wrong here. ocamldebug is able to debug a remote process (set loadingmode manual), and so debug/debuggee can have different stderr/stdout. You launch ocamldebug, issue "set loadingmode manual", wait connection from the debuggee, then launch the debuggee. For a working example you can look into OCaIDE Eclipse plugin (https://github.com/nbros/OcaIDE/blob/master/Ocaml/src/ocaml/debugging/OcamlDebugger.java). BTW, remote debugging support is valuable thing by its own; I would love to see it implemented for vscode as well. As for ocamldebug protocol, I would recommend to run it with -machine-readable command line option. This way you will have more predictable result that should be the same for different OCaml versions. |
Thank you very much! I'm going to improve debug support as you describe. |
New version with remote debug support is published. Take a try! |
It doesn't seem to work for me so I'm trying to debug your extension under VSCode debugger. While I've managed to to this for the extension itself (I can set a breakpoint in src.extension.ts, watch variables etc.), I cannot do that for src/debug/debug.ts. I'm quite new to VSCode/typescript/node.js etc. so I'm sorry for probably dump question: how to debug src/debug/debug.ts? |
I'm sorry but I've tested that works on my Win10 VM. About debug: please reference this. https://github.com/Microsoft/vscode-go/tree/master/src/debugAdapter. |
Hmm, I've tried that but got
while running debug-debugger. Probably I'm doing something wrong? |
Update your nodejs runtime. Currently Typescript didn't support async/await in ES5 target. microsoft/TypeScript#1564 You need a version of nodejs support most ES6 features. |
Thanks, I've finally made the vscode debugger working. What I see - in
you get |
|
I've just told you what I really saw in the debugger; tomorrow I will try to provide more details.
It doesn't. Yes, I've upgraded node.js to version 6.2.2 |
I'm very sorry for that! Today I checked it on Windows again. It seems that sometime work, sometime doesn't. I'm too "luck" yesterday and I didn't check that many times. I'll fix this today. Thank you! |
It seems that we must introduce state machine as OcaIDE does to solve this problem. |
Debugger implementation may need refactor in the future. I temporarily fix that so you can use it instantly. Try version 0.4.4. |
It still doesn't work. What I now see in the debug log is
|
Try fully restart VS Code. I used to encounter this problem too. EDIT: Test if ocamldebug works without VS Code. |
Of course I did that. I still think that something is wrong with your ocamldebug communication logic and an unexpected delay exposes the bug. You're waiting for |
You are right. The logic nothing difference than you say. The log you given says that ocamldebug doesn't load debuggee succeed. So I asked you to check if ocamldebug works standalone. The temporary fix introduce a magic number - debounce timeout 64 ms. This may be a hidden problem. You can change it to 1000ms or more long to test if the problem is that. |
I'm wrong. The problem is "Loading program... (ocd) " response early break the |
@db4, It looks like you set If you set it. You must manual launch debuggee ( |
No, I didn't. I just replaced a random port with '12345' in my comment. Probably it was a bad idea that confused you. |
Try 0.4.6! If it still doesn't work. I'll rewrite debug logic in weekend. |
Still doesn't work. What I noticed is that when I run ocamldebug an manually issue |
Does it work on a simple helloworld program? I'm going to write a proxy of ocamldebug to simulate the delay. |
No, it doesn't - looks like the same problem. Maybe my %PATH% that's quite long, is responsible for that? |
Which OCaml distribution do you use? I'm trying to reproduce the problem. |
OCaml 4.02.3 (built with MSVC from sources) Well, I'm trying to debug the issue myself. As I'm absolute newbie to (java|type)script, can you explain how
guaranties that you wait for |
So
Will first read until Could you please provide your log again? |
Let me clarify my question. Consider the following start of ocamldebug session:
In your code
is expected to catch
is expected to issue |
If a callback passed to |
OK, I've finally found the problem. In
there is a typo, it should be
So then I specified |
Thank you. I'm sorry to waste a lot of your time. Fixed in 0.4.7 |
What is the reason to use mkfifo for ocamldebug stdout/stderr redirection? You interact with ocamlmerlin without that (BTW it works well under Windows), why not to handle ocamldebug just the same way?
The text was updated successfully, but these errors were encountered: