Remove cleanup_debug_info_options · rust-lang/rust@08b188c (original) (raw)
`@@ -8,7 +8,6 @@ use tracing::debug;
`
8
8
``
9
9
`use super::debugger::DebuggerCommands;
`
10
10
`use super::{Debugger, Emit, ProcRes, TestCx, Truncated, WillExecute};
`
11
``
`-
use crate::common::Config;
`
12
11
`use crate::debuggers::{extract_gdb_version, is_android_gdb_target};
`
13
12
``
14
13
`impl TestCx<'_> {
`
`@@ -21,18 +20,6 @@ impl TestCx<'_> {
`
21
20
`}
`
22
21
``
23
22
`fn run_debuginfo_cdb_test(&self) {
`
24
``
`-
let config = Config {
`
25
``
`-
target_rustcflags: self.cleanup_debug_info_options(&self.config.target_rustcflags),
`
26
``
`-
host_rustcflags: self.cleanup_debug_info_options(&self.config.host_rustcflags),
`
27
``
`-
..self.config.clone()
`
28
``
`-
};
`
29
``
-
30
``
`-
let test_cx = TestCx { config: &config, ..*self };
`
31
``
-
32
``
`-
test_cx.run_debuginfo_cdb_test_no_opt();
`
33
``
`-
}
`
34
``
-
35
``
`-
fn run_debuginfo_cdb_test_no_opt(&self) {
`
36
23
`let exe_file = self.make_exe_name();
`
37
24
``
38
25
`// Existing PDB files are update in-place. When changing the debuginfo
`
`@@ -118,18 +105,6 @@ impl TestCx<'_> {
`
118
105
`}
`
119
106
``
120
107
`fn run_debuginfo_gdb_test(&self) {
`
121
``
`-
let config = Config {
`
122
``
`-
target_rustcflags: self.cleanup_debug_info_options(&self.config.target_rustcflags),
`
123
``
`-
host_rustcflags: self.cleanup_debug_info_options(&self.config.host_rustcflags),
`
124
``
`-
..self.config.clone()
`
125
``
`-
};
`
126
``
-
127
``
`-
let test_cx = TestCx { config: &config, ..*self };
`
128
``
-
129
``
`-
test_cx.run_debuginfo_gdb_test_no_opt();
`
130
``
`-
}
`
131
``
-
132
``
`-
fn run_debuginfo_gdb_test_no_opt(&self) {
`
133
108
`let dbg_cmds = DebuggerCommands::parse_from(&self.testpaths.file, "gdb")
`
134
109
`.unwrap_or_else(|e| self.fatal(&e));
`
135
110
`let mut cmds = dbg_cmds.commands.join("\n");
`
`@@ -355,18 +330,6 @@ impl TestCx<'_> {
`
355
330
`self.fatal("Can't run LLDB test because LLDB's python path is not set.");
`
356
331
`}
`
357
332
``
358
``
`-
let config = Config {
`
359
``
`-
target_rustcflags: self.cleanup_debug_info_options(&self.config.target_rustcflags),
`
360
``
`-
host_rustcflags: self.cleanup_debug_info_options(&self.config.host_rustcflags),
`
361
``
`-
..self.config.clone()
`
362
``
`-
};
`
363
``
-
364
``
`-
let test_cx = TestCx { config: &config, ..*self };
`
365
``
-
366
``
`-
test_cx.run_debuginfo_lldb_test_no_opt();
`
367
``
`-
}
`
368
``
-
369
``
`-
fn run_debuginfo_lldb_test_no_opt(&self) {
`
370
333
`// compile test file (it should have 'compile-flags:-g' in the directive)
`
371
334
`let should_run = self.run_if_enabled();
`
372
335
`let compile_result = self.compile_test(should_run, Emit::None);
`
`@@ -501,11 +464,4 @@ impl TestCx<'_> {
`
501
464
`.env("PYTHONPATH", pythonpath),
`
502
465
`)
`
503
466
`}
`
504
``
-
505
``
`-
fn cleanup_debug_info_options(&self, options: &Vec) -> Vec {
`
506
``
`-
// Remove options that are either unwanted (-O) or may lead to duplicates due to RUSTFLAGS.
`
507
``
`-
let options_to_remove = ["-O".to_owned(), "-g".to_owned(), "--debuginfo".to_owned()];
`
508
``
-
509
``
`-
options.iter().filter(|x| !options_to_remove.contains(x)).cloned().collect()
`
510
``
`-
}
`
511
467
`}
`