Skip to content

Commit 42aeca7

Browse files
committed
Fix CI.
1 parent da375f1 commit 42aeca7

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

fixtures/ruby/gdb/fixtures.rb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def run_test_case(test_name, update_snapshots: false)
106106
result = run_gdb_script(gdb_script)
107107
end
108108

109-
return {success?: false, error: "GDB script failed"} unless result && result[:success?]
109+
return {success?: false, error: "GDB script failed", raw_output: result ? result[:stdout] : nil} unless result && result[:success?]
110110

111111
actual_output = normalize_output(result[:stdout])
112112

@@ -146,7 +146,8 @@ def run_test_case(test_name, update_snapshots: false)
146146
success?: false,
147147
output: actual_output,
148148
expected: expected_output,
149-
diff: compute_diff(expected_output, actual_output)
149+
diff: compute_diff(expected_output, actual_output),
150+
raw_output: result[:stdout]
150151
}
151152
end
152153
end
@@ -165,6 +166,13 @@ def normalize_output(output)
165166
line.match?(/^License/) ||
166167
line.match?(/^This is free software/) ||
167168
line.match?(/^There is NO WARRANTY/) ||
169+
line.match?(/^For bug reporting/) || # Bug reporting instructions
170+
line.match?(/^Find the GDB manual/) || # Manual reference
171+
line.match?(/^Reading symbols/) || # Symbol loading (any variant)
172+
line.match?(/^Dwarf Error:/) || # DWARF debug info errors
173+
line.match?(/warning:.*debug.*info/) || # Debug info warnings
174+
line.match?(/Make breakpoint pending/) || # Breakpoint pending question
175+
line.match?(/answered [YN]; input not from terminal/) || # Breakpoint pending answer
168176
# Remove lines with process/thread IDs that change on each run
169177
line.match?(/\bLWP \d+\b/) || # Linux thread IDs
170178
line.match?(/\bprocess \d+\b/) || # Process IDs
@@ -175,8 +183,8 @@ def normalize_output(output)
175183
line.match?(/^\[New Thread/) || # New thread messages
176184
line.match?(/^\[Inferior /) || # Inferior process messages
177185
line.match?(/^Using host libthread_db/) || # Thread debugging library
178-
line.match?(/^Reading symbols from/) || # Symbol loading
179-
line.match?(/Breakpoint \d+ at 0x[0-9a-f]+:/) # Breakpoint addresses (keep line number only)
186+
line.match?(/Breakpoint \d+ at 0x[0-9a-f]+:/) || # Breakpoint addresses (keep line number only)
187+
line.match?(/^\d+\s+/) # Source code lines (e.g., "9016 VALUE r_stdout...")
180188
end
181189

182190
# Normalize lines to remove non-deterministic values

fixtures/ruby/gdb/object/can_print_hash.gdb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
source data/ruby/gdb/init.py
44

5+
# Enable pending breakpoints (for when symbols load from shared libraries)
6+
set breakpoint pending on
7+
58
# Break at the point where the global variable is set
69
break rb_f_puts
710
run

fixtures/ruby/gdb/object/can_print_hash.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
9016 VALUE r_stdout = rb_ractor_stdout();
21
AR Table at <address> (size=3, bound=3):
32
[ 0] K: :a
43
V: 1

test/ruby/gdb.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@
5050
puts result[:expected]
5151
puts "\nActual output:"
5252
puts result[:output]
53+
54+
if result[:raw_output]
55+
puts "\nRaw GDB output (unfiltered):"
56+
puts result[:raw_output]
57+
end
58+
5359
puts "\nDiff (line by line):"
5460
result[:diff]&.each do |d|
5561
puts " Line #{d[:line]}:"

0 commit comments

Comments
 (0)