Skip to content

Commit 51a25c7

Browse files
committed
auto merge of #18422 : michaelwoerister/rust/windows-freeze-fix, r=alexcrichton
On some Windows versions of GDB this is more stable than setting breakpoints via function names. This is also something I wanted to do for some time now because it makes the tests more consistent. @brson: These changes are in response to issue #17540. It works on my machine with the toolchain mentioned in the issue. In order to find out if the problem is really worked around, we also need to make the build bots use the newer GDB version again.
2 parents 1442235 + e06c338 commit 51a25c7

File tree

91 files changed

+69
-457
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+69
-457
lines changed

src/compiletest/runtest.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
364364
commands,
365365
check_lines,
366366
use_gdb_pretty_printer,
367-
..
367+
breakpoint_lines
368368
} = parse_debugger_commands(testfile, "gdb");
369369
let mut cmds = commands.connect("\n");
370370

@@ -535,11 +535,22 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
535535
}
536536
}
537537

538+
// The following line actually doesn't have to do anything with
539+
// pretty printing, it just tells GDB to print values on one line:
540+
script_str.push_str("set print pretty off\n");
541+
538542
// Load the target executable
539543
script_str.push_str(format!("file {}\n",
540544
exe_file.as_str().unwrap().replace("\\", "\\\\"))
541545
.as_slice());
542546

547+
// Add line breakpoints
548+
for line in breakpoint_lines.iter() {
549+
script_str.push_str(format!("break '{}':{}\n",
550+
testfile.filename_display(),
551+
*line)[]);
552+
}
553+
543554
script_str.push_str(cmds.as_slice());
544555
script_str.push_str("quit\n");
545556

src/test/debuginfo/basic-types-globals-metadata.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-windows: FIXME #13256
1211
// ignore-android: FIXME(#10381)
1312
// min-lldb-version: 310
1413

1514
// compile-flags:-g
16-
// gdb-command:rbreak zzz
1715
// gdb-command:run
18-
// gdb-command:finish
1916
// gdb-command:whatis 'basic-types-globals-metadata::B'
2017
// gdb-check:type = bool
2118
// gdb-command:whatis 'basic-types-globals-metadata::I'
@@ -66,7 +63,7 @@ static F32: f32 = 2.5;
6663
static F64: f64 = 3.5;
6764

6865
fn main() {
69-
_zzz();
66+
_zzz(); // #break
7067

7168
let a = (B, I, C, I8, I16, I32, I64, U, U8, U16, U32, U64, F32, F64);
7269
}

src/test/debuginfo/basic-types-globals.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@
1414
// about UTF-32 character encoding and will print a rust char as only
1515
// its numerical value.
1616

17-
// ignore-windows: FIXME #13256
1817
// ignore-android: FIXME(#10381)
1918
// min-lldb-version: 310
2019

2120
// compile-flags:-g
22-
// gdb-command:rbreak zzz
2321
// gdb-command:run
24-
// gdb-command:finish
2522
// gdb-command:print 'basic-types-globals::B'
2623
// gdb-check:$1 = false
2724
// gdb-command:print 'basic-types-globals::I'
@@ -70,7 +67,7 @@ static F32: f32 = 2.5;
7067
static F64: f64 = 3.5;
7168

7269
fn main() {
73-
_zzz();
70+
_zzz(); // #break
7471

7572
let a = (B, I, C, I8, I16, I32, I64, U, U8, U16, U32, U64, F32, F64);
7673
}

src/test/debuginfo/basic-types-metadata.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
// min-lldb-version: 310
1313

1414
// compile-flags:-g
15-
// gdb-command:rbreak zzz
1615
// gdb-command:run
17-
// gdb-command:finish
1816
// gdb-command:whatis unit
1917
// gdb-check:type = ()
2018
// gdb-command:whatis b
@@ -67,7 +65,7 @@ fn main() {
6765
let u64: u64 = 64;
6866
let f32: f32 = 2.5;
6967
let f64: f64 = 3.5;
70-
_zzz();
68+
_zzz(); // #break
7169
if 1i == 1 { _yyy(); }
7270
}
7371

src/test/debuginfo/basic-types-mut-globals.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
// about UTF-32 character encoding and will print a rust char as only
1515
// its numerical value.
1616

17-
// ignore-windows: FIXME #13256
1817
// ignore-android: FIXME(#10381)
1918
// min-lldb-version: 310
2019

2120
// compile-flags:-g
22-
// gdb-command:rbreak zzz
21+
2322
// gdb-command:run
24-
// gdb-command:finish
2523

2624
// Check initializers
2725
// gdb-command:print 'basic-types-mut-globals::B'
@@ -84,9 +82,6 @@
8482
// gdb-command:print 'basic-types-mut-globals'::F64
8583
// gdb-check:$28 = 9.25
8684

87-
// gdb-command:detach
88-
// gdb-command:quit
89-
9085
#![allow(unused_variables)]
9186

9287
static mut B: bool = false;
@@ -105,7 +100,7 @@ static mut F32: f32 = 2.5;
105100
static mut F64: f64 = 3.5;
106101

107102
fn main() {
108-
_zzz();
103+
_zzz(); // #break
109104

110105
unsafe {
111106
B = true;
@@ -124,7 +119,7 @@ fn main() {
124119
F64 = 9.25;
125120
}
126121

127-
_zzz();
122+
_zzz(); // #break
128123
}
129124

130125
fn _zzz() {()}

src/test/debuginfo/basic-types.rs

-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121

2222
// === GDB TESTS ===================================================================================
2323

24-
// gdb-command:rbreak zzz
2524
// gdb-command:run
26-
// gdb-command:finish
2725
// gdb-command:print b
2826
// gdb-check:$1 = false
2927
// gdb-command:print i

src/test/debuginfo/borrowed-basic.rs

-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818

1919
// === GDB TESTS ===================================================================================
2020

21-
// gdb-command:rbreak zzz
2221
// gdb-command:run
23-
// gdb-command:finish
2422
// gdb-command:print *bool_ref
2523
// gdb-check:$1 = true
2624

src/test/debuginfo/borrowed-c-style-enum.rs

-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515

1616
// === GDB TESTS ===================================================================================
1717

18-
// gdb-command:rbreak zzz
1918
// gdb-command:run
20-
// gdb-command:finish
2119

2220
// gdb-command:print *the_a_ref
2321
// gdb-check:$1 = TheA

src/test/debuginfo/borrowed-enum.rs

-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717
// === GDB TESTS ===================================================================================
1818

19-
// gdb-command:rbreak zzz
2019
// gdb-command:run
21-
// gdb-command:finish
2220

2321
// gdb-command:print *the_a_ref
2422
// gdb-check:$1 = {{RUST$ENUM$DISR = TheA, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = TheA, 0, 2088533116, 2088533116}}

src/test/debuginfo/borrowed-struct.rs

-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414

1515
// === GDB TESTS ===================================================================================
1616

17-
// gdb-command:rbreak zzz
1817
// gdb-command:run
19-
// gdb-command:finish
2018

2119
// gdb-command:print *stack_val_ref
2220
// gdb-check:$1 = {x = 10, y = 23.5}

src/test/debuginfo/borrowed-tuple.rs

-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515

1616
// === GDB TESTS ===================================================================================
1717

18-
// gdb-command:rbreak zzz
1918
// gdb-command:run
20-
// gdb-command:finish
2119

2220
// gdb-command:print *stack_val_ref
2321
// gdb-check:$1 = {-14, -19}

src/test/debuginfo/borrowed-unique-basic.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818

1919
// === GDB TESTS ===================================================================================
2020

21-
// gdb-command:rbreak zzz
2221
// gdb-command:run
23-
// gdb-command:finish
22+
2423
// gdb-command:print *bool_ref
2524
// gdb-check:$1 = true
2625

src/test/debuginfo/box.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515

1616
// === GDB TESTS ===================================================================================
1717

18-
// gdb-command:set print pretty off
19-
// gdb-command:rbreak zzz
2018
// gdb-command:run
21-
// gdb-command:finish
19+
2220
// gdb-command:print *a
2321
// gdb-check:$1 = 1
2422
// gdb-command:print *b

src/test/debuginfo/boxed-struct.rs

-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515

1616
// === GDB TESTS ===================================================================================
1717

18-
// gdb-command:rbreak zzz
1918
// gdb-command:run
20-
// gdb-command:finish
2119

2220
// gdb-command:print *unique
2321
// gdb-check:$1 = {x = 99, y = 999, z = 9999, w = 99999}

src/test/debuginfo/by-value-non-immediate-argument.rs

-6
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@
1616

1717
// === GDB TESTS ===================================================================================
1818

19-
// gdb-command:rbreak zzz
2019
// gdb-command:run
2120

22-
// gdb-command:finish
2321
// gdb-command:print s
2422
// gdb-check:$1 = {a = 1, b = 2.5}
2523
// gdb-command:continue
2624

27-
// gdb-command:finish
2825
// gdb-command:print x
2926
// gdb-check:$2 = {a = 3, b = 4.5}
3027
// gdb-command:print y
@@ -33,17 +30,14 @@
3330
// gdb-check:$4 = 6.5
3431
// gdb-command:continue
3532

36-
// gdb-command:finish
3733
// gdb-command:print a
3834
// gdb-check:$5 = {7, 8, 9.5, 10.5}
3935
// gdb-command:continue
4036

41-
// gdb-command:finish
4237
// gdb-command:print a
4338
// gdb-check:$6 = {11.5, 12.5, 13, 14}
4439
// gdb-command:continue
4540

46-
// gdb-command:finish
4741
// gdb-command:print x
4842
// gdb-check:$7 = {{RUST$ENUM$DISR = Case1, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = Case1, 0, 2088533116, 2088533116}}
4943
// gdb-command:continue

src/test/debuginfo/by-value-self-argument-in-trait-impl.rs

-4
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,16 @@
1515

1616
// === GDB TESTS ===================================================================================
1717

18-
// gdb-command:rbreak zzz
1918
// gdb-command:run
2019

21-
// gdb-command:finish
2220
// gdb-command:print self
2321
// gdb-check:$1 = 1111
2422
// gdb-command:continue
2523

26-
// gdb-command:finish
2724
// gdb-command:print self
2825
// gdb-check:$2 = {x = 2222, y = 3333}
2926
// gdb-command:continue
3027

31-
// gdb-command:finish
3228
// gdb-command:print self
3329
// gdb-check:$3 = {4444.5, 5555, 6666, 7777.5}
3430
// gdb-command:continue

src/test/debuginfo/c-style-enum-in-composite.rs

-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717
// === GDB TESTS ===================================================================================
1818

19-
// gdb-command:rbreak zzz
2019
// gdb-command:run
21-
// gdb-command:finish
2220

2321
// gdb-command:print tuple_interior_padding
2422
// gdb-check:$1 = {0, OneHundred}

src/test/debuginfo/c-style-enum.rs

-4
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-windows: FIXME #13256
1211
// ignore-android: FIXME(#10381)
1312
// min-lldb-version: 310
1413

1514
// compile-flags:-g
1615

1716
// === GDB TESTS ===================================================================================
1817

19-
// gdb-command:rbreak zzz
20-
2118
// gdb-command:print 'c-style-enum::SINGLE_VARIANT'
2219
// gdb-check:$1 = TheOnlyVariant
2320

@@ -40,7 +37,6 @@
4037
// gdb-check:$7 = OneHundred
4138

4239
// gdb-command:run
43-
// gdb-command:finish
4440

4541
// gdb-command:print auto_one
4642
// gdb-check:$8 = One

src/test/debuginfo/closure-in-generic-function.rs

-3
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,14 @@
1515

1616
// === GDB TESTS ===================================================================================
1717

18-
// gdb-command:rbreak zzz
1918
// gdb-command:run
2019

21-
// gdb-command:finish
2220
// gdb-command:print x
2321
// gdb-check:$1 = 0.5
2422
// gdb-command:print y
2523
// gdb-check:$2 = 10
2624
// gdb-command:continue
2725

28-
// gdb-command:finish
2926
// gdb-command:print *x
3027
// gdb-check:$3 = 29
3128
// gdb-command:print *y

0 commit comments

Comments
 (0)