Status: Untriaged
Owner: ----
Type: Bug
New issue 9096 by
jpahe...@gmail.com: Debugger.setScriptSource usage with Node.js does not work.
https://bugs.chromium.org/p/v8/issues/detail?id=9096Version: Node.js version 8
OS: Windows 10
Architecture: x86-64
In the following post Alexei Filippov requested that I open an issue here as I might have found a bug:
https://groups.google.com/forum/m/?utm_medium=email&utm_source=footer#!topic/chrome-debugging-protocol/KME12JMj3PsI should mention that I’m using Node.js version 8. I’m currently out of the office this week but on Monday I will verify the issue on Node.js version 10 as well. I should also mention that when I try my scenario from within Chrome Debugger all works fine. As I mention in my post things aren’t working from my client that is connected to Node.js via a web socket when it makes the call to Debugger.setScriptSource. I assume you have a client or unit tests that could do the same.
In the aforementioned post, I briefly describe the scenario I use to hit the issue. I will expand on those details here, but the issue doesn’t seem to be specific to one specific scenario. I’ve tried many ways to get Debugger.setScriptSource to work to no avail. I’ve had no success getting the updated source to be executed by the VM.
My scenario is pretty simple, which leads me to believe that I’m doing something wrong as opposed to a bug. :-) Anyway, here is what I do:
1. My Debugger client starts Node.js with --inspect-brk and connects to the websocket provided by node.
2. My client makes the necessary calls to Debugger and Runtime to enable them.
3. My client then sets a breakpoint on my application .js file.
4. My .js file is trivial and the details of it are not of any particular importance. Simple take a .js file with say 10 or so lines of console.logs (or any executable code) or such where a breakpoint has been set on say line 6 (or any line).
5. Once the “break on start” pause is hit send the resume command to node.
6. Once the breakpoint at line 6 is hit, edit the .js file to remove most, say 9, of the console.log entries. In other words remove all but the first line or two of executable code. You could even change the output printed by the console.log.
7. Save the source and send it to node by using Debugger.setScriptSource.
8. Notice the confirmation result message from node that the command worked.
9. Further verify things by calling Debugger.getScriptSource and notice the updated code sent in step #7. So far all works as expected!
10. Send the resume command to node which will allow it to run to completion.
11. Notice the console.log entries from line 6-10 are printed, NOT the updated source!
Am I missing something? In this case shouldn’t my one or two lines of updated code be executed, not lines 6-10 of the previous script source?
Please let me know if you need anything. I’d be more than happy to send you the logs from my client which shows exactly what I send to node and what I receive.
Thanks,
Heath Thomann
--
You received this message because:
1. The project was configured to send all issue notifications to this address
You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings