From 7815037fce9e83428efc0e14236617d7b6ba86aa Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Wed, 18 Dec 2024 07:46:15 +0900 Subject: [PATCH 1/6] try CI --- lib/debug/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/debug/version.rb b/lib/debug/version.rb index cf7b7b23e..a99cc3143 100644 --- a/lib/debug/version.rb +++ b/lib/debug/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module DEBUGGER__ - VERSION = "1.9.2" + VERSION = "1.9.2" ### end From 2fcb6f5ac6a635fba833755e56e4661138335de6 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Wed, 18 Dec 2024 07:55:59 +0900 Subject: [PATCH 2/6] show spawn info --- test/support/test_case.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/support/test_case.rb b/test/support/test_case.rb index 5ff8a2e27..6c7b307f8 100644 --- a/test/support/test_case.rb +++ b/test/support/test_case.rb @@ -171,7 +171,12 @@ def setup_remote_debuggee(cmd) msg1 = msg2 = nil Timeout.timeout(TIMEOUT_SEC) do - line = remote_info.r.gets + begin + line = remote_info.r.gets + rescue Errno::EIO + pp(cmd: cmd, env: {'HOME' => homedir}) + raise + end remote_info.debuggee_backlog << line # wait for two lines (order is unstable) From 16e93375e60584e5fc6d92578cf97a6b41398d7b Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Wed, 18 Dec 2024 08:12:32 +0900 Subject: [PATCH 3/6] check eof --- test/support/test_case.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/support/test_case.rb b/test/support/test_case.rb index 6c7b307f8..d68d2c2bf 100644 --- a/test/support/test_case.rb +++ b/test/support/test_case.rb @@ -172,9 +172,10 @@ def setup_remote_debuggee(cmd) Timeout.timeout(TIMEOUT_SEC) do begin + eof = remote_info.r.eof? # check first byte line = remote_info.r.gets rescue Errno::EIO - pp(cmd: cmd, env: {'HOME' => homedir}) + pp(cmd: cmd, env: {'HOME' => homedir}, eof: eof) raise end remote_info.debuggee_backlog << line From 98fa340fb59e6f2c41a3976d34ef3893d374f5fd Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Wed, 18 Dec 2024 08:16:49 +0900 Subject: [PATCH 4/6] use read(1) --- test/support/test_case.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/support/test_case.rb b/test/support/test_case.rb index d68d2c2bf..423c83b10 100644 --- a/test/support/test_case.rb +++ b/test/support/test_case.rb @@ -173,9 +173,16 @@ def setup_remote_debuggee(cmd) Timeout.timeout(TIMEOUT_SEC) do begin eof = remote_info.r.eof? # check first byte - line = remote_info.r.gets + line = +"" + while true + c = remote_info.r.read(1) + break if c == "\n" + line << c + end + + # line << remote_info.r.gets rescue Errno::EIO - pp(cmd: cmd, env: {'HOME' => homedir}, eof: eof) + pp(cmd: cmd, env: {'HOME' => homedir}, eof: eof, line: line) raise end remote_info.debuggee_backlog << line From 38702c976d01866c72b5d153dda13e451016bf0b Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Wed, 18 Dec 2024 10:31:31 +0900 Subject: [PATCH 5/6] cnt redo --- test/support/test_case.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/support/test_case.rb b/test/support/test_case.rb index 423c83b10..1ac992600 100644 --- a/test/support/test_case.rb +++ b/test/support/test_case.rb @@ -169,6 +169,7 @@ def setup_remote_debuggee(cmd) line = nil msg1 = msg2 = nil + redo_cnt = 0 Timeout.timeout(TIMEOUT_SEC) do begin @@ -182,7 +183,7 @@ def setup_remote_debuggee(cmd) # line << remote_info.r.gets rescue Errno::EIO - pp(cmd: cmd, env: {'HOME' => homedir}, eof: eof, line: line) + pp(cmd: cmd, env: {'HOME' => homedir}, eof: eof, line: line, redo_cnt: redo_cnt, msg1: msg1, msg2: msg2) raise end remote_info.debuggee_backlog << line @@ -196,6 +197,7 @@ def setup_remote_debuggee(cmd) end break if msg1 && msg2 + redo_cnt += 1 redo # loop end From a1a593bffb7f56484f6ae1cdb9a6fbe25c93ff4a Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Wed, 18 Dec 2024 10:36:36 +0900 Subject: [PATCH 6/6] record lines --- test/support/test_case.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/support/test_case.rb b/test/support/test_case.rb index 1ac992600..bb426639b 100644 --- a/test/support/test_case.rb +++ b/test/support/test_case.rb @@ -168,6 +168,7 @@ def setup_remote_debuggee(cmd) remote_info.debuggee_backlog = [] line = nil + lines = [] msg1 = msg2 = nil redo_cnt = 0 @@ -183,9 +184,10 @@ def setup_remote_debuggee(cmd) # line << remote_info.r.gets rescue Errno::EIO - pp(cmd: cmd, env: {'HOME' => homedir}, eof: eof, line: line, redo_cnt: redo_cnt, msg1: msg1, msg2: msg2) + pp(cmd: cmd, env: {'HOME' => homedir}, eof: eof, line: line, redo_cnt: redo_cnt, msg1: msg1, msg2: msg2, lines: lines) raise end + lines << line remote_info.debuggee_backlog << line # wait for two lines (order is unstable)