Skip to content

Commit ad348f0

Browse files
committed
Fix CI.
1 parent da375f1 commit ad348f0

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

fixtures/ruby/gdb/fixtures.rb

Lines changed: 16 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,17 @@ 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
176+
line.match?(/^Breakpoint \d+ \(.+\) pending\./) || # Pending breakpoint notification
177+
line.match?(/^A debugging session is active\./) || # Debugging session messages
178+
line.match?(/Inferior.*will be killed\./) || # Session termination messages
179+
line.match?(/Quit anyway\?/) || # Quit confirmation prompts
168180
# Remove lines with process/thread IDs that change on each run
169181
line.match?(/\bLWP \d+\b/) || # Linux thread IDs
170182
line.match?(/\bprocess \d+\b/) || # Process IDs
@@ -175,8 +187,8 @@ def normalize_output(output)
175187
line.match?(/^\[New Thread/) || # New thread messages
176188
line.match?(/^\[Inferior /) || # Inferior process messages
177189
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)
190+
line.match?(/Breakpoint \d+ at 0x[0-9a-f]+:/) || # Breakpoint addresses (keep line number only)
191+
line.match?(/^\d+\s+/) # Source code lines (e.g., "9016 VALUE r_stdout...")
180192
end
181193

182194
# Normalize lines to remove non-deterministic values

fixtures/ruby/gdb/object/can_print_hash.gdb

Lines changed: 3 additions & 1 deletion
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
@@ -13,5 +16,4 @@ set $hash = argv[0]
1316
# Print the hash
1417
rb-object-print $hash
1518

16-
continue
1719
quit
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
9016 VALUE r_stdout = rb_ractor_stdout();
21
AR Table at <address> (size=3, bound=3):
32
[ 0] K: :a
43
V: 1
54
[ 1] K: :b
65
V: 2
76
[ 2] K: :c
87
V: 3
9-
{a: 1, b: 2, c: 3}

lib/ruby/gdb/version.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# frozen_string_literal: true
22

3+
# @namespace
34
module Ruby
5+
# @namespace
46
module GDB
57
VERSION = "0.1.0"
68
end

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)