TEST. Add extractor of VSCode commands
authorAnton Zhukov <a.zhukov@samsung.com>
Thu, 7 May 2020 09:43:55 +0000 (05:43 -0400)
committerAnton Zhukov <a.zhukov@samsung.com>
Thu, 7 May 2020 09:53:36 +0000 (05:53 -0400)
* Minor fixes for PR review.

Issue: #203

tests/tools/getvscodecmd/README.md [deleted file]
tests/tools/getvscodecmd/get-vscodecmd.py [deleted file]
tools/getvscodecmd/README.md [new file with mode: 0644]
tools/getvscodecmd/get-vscodecmd.py [new file with mode: 0755]

diff --git a/tests/tools/getvscodecmd/README.md b/tests/tools/getvscodecmd/README.md
deleted file mode 100644 (file)
index 1321e8a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-*get-vscodecmd.py* its a simple experimental script are needed for extracting the vscode client commands from the debugger output.\r
-\r
-Debugger side are sensitive from some values of temporary objects in the vscode protocol. But, for some developers scenarios it can by useful. Also, debugger behavior can be unstable for this manner. But, for my workflow the script allowed me reproduce issue in debugger. Lets, look the usage example:\r
-```\r
-$ get-vscodecmd.py vscode_output > cmd\r
-$ dos2unix cmd\r
-\r
-$ netcoredbg --interpreter=vscode --engineLogging=/tmp < cmd\r
-```\r
-The first command produced the client commands with vscode-header like this "Content-Length: 347". Where `347` the payload size. The second command produced converted `\n\nn` to `\n\r\n\r`. And third command starts debugger in the batch mode.
\ No newline at end of file
diff --git a/tests/tools/getvscodecmd/get-vscodecmd.py b/tests/tools/getvscodecmd/get-vscodecmd.py
deleted file mode 100755 (executable)
index a6d24b6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-import re, sys, os
-
-'''
-Example of using script:
-    1) Put vscode debug console output and run `./get-vscodecmd.py vscode.out > cmd.out`
-    2) Run `dos2unix cmd.out`
-'''
-
-def do(f):
-    for line in open(f).readlines():
-        r = re.match(r'^-> \(C\) ({.+})', line)
-        if r != None:
-            cmd = r.group(1)
-            print ("Content-Length: {}\n".format(len(cmd)))
-            print (cmd)
-    pass
-
-if __name__ == "__main__":
-    do(sys.argv[1])
\ No newline at end of file
diff --git a/tools/getvscodecmd/README.md b/tools/getvscodecmd/README.md
new file mode 100644 (file)
index 0000000..66a0379
--- /dev/null
@@ -0,0 +1,10 @@
+*get-vscodecmd.py* its a simple experimental script are needed for extracting the vscode client commands from the debugger output.\r
+\r
+Debugger side are sensitive from some values of temporary objects in the vscode protocol. But, for some developers scenarios it can by useful. Also, debugger behavior can be unstable for this manner. But, for my workflow the script allowed me reproduce issue in debugger. Lets, look the usage example:\r
+```\r
+$ get-vscodecmd.py vscode_output > cmd\r
+$ unix2dos cmd\r
+\r
+$ netcoredbg --interpreter=vscode --engineLogging=/tmp < cmd\r
+```\r
+The first command produced the client commands with vscode-header like this "Content-Length: 347". Where `347` the payload size. The second command produced converted `\n\nn` to `\n\r\n\r`. And third command starts debugger in the batch mode.\r
diff --git a/tools/getvscodecmd/get-vscodecmd.py b/tools/getvscodecmd/get-vscodecmd.py
new file mode 100755 (executable)
index 0000000..d86a27e
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+import re, sys, os
+
+'''
+Example of using script:
+    $ get-vscodecmd.py vscode_output > cmd
+    $ unix2dos cmd
+    $ netcoredbg --interpreter=vscode --engineLogging=/tmp < cmd
+'''
+
+def do(f):
+    for line in open(f).readlines():
+        r = re.match(r'^-> \(C\) ({.+})', line)
+        if r != None:
+            cmd = r.group(1)
+            print ("Content-Length: {}\n".format(len(cmd)))
+            print (cmd)
+    pass
+
+if __name__ == "__main__":
+    do(sys.argv[1])
+