Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions src/tools/compiletest/src/runtest/debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use tracing::debug;

use super::debugger::DebuggerCommands;
use super::{Debugger, Emit, ProcRes, TestCx, Truncated, WillExecute};
use crate::common::Config;
use crate::debuggers::{extract_gdb_version, is_android_gdb_target};

impl TestCx<'_> {
Expand All @@ -21,18 +20,6 @@ impl TestCx<'_> {
}

fn run_debuginfo_cdb_test(&self) {
let config = Config {
target_rustcflags: self.cleanup_debug_info_options(&self.config.target_rustcflags),
host_rustcflags: self.cleanup_debug_info_options(&self.config.host_rustcflags),
..self.config.clone()
};

let test_cx = TestCx { config: &config, ..*self };

test_cx.run_debuginfo_cdb_test_no_opt();
}

fn run_debuginfo_cdb_test_no_opt(&self) {
let exe_file = self.make_exe_name();

// Existing PDB files are update in-place. When changing the debuginfo
Expand Down Expand Up @@ -118,18 +105,6 @@ impl TestCx<'_> {
}

fn run_debuginfo_gdb_test(&self) {
let config = Config {
target_rustcflags: self.cleanup_debug_info_options(&self.config.target_rustcflags),
host_rustcflags: self.cleanup_debug_info_options(&self.config.host_rustcflags),
..self.config.clone()
};

let test_cx = TestCx { config: &config, ..*self };

test_cx.run_debuginfo_gdb_test_no_opt();
}

fn run_debuginfo_gdb_test_no_opt(&self) {
let dbg_cmds = DebuggerCommands::parse_from(&self.testpaths.file, "gdb")
.unwrap_or_else(|e| self.fatal(&e));
let mut cmds = dbg_cmds.commands.join("\n");
Expand Down Expand Up @@ -355,18 +330,6 @@ impl TestCx<'_> {
self.fatal("Can't run LLDB test because LLDB's python path is not set.");
}

let config = Config {
target_rustcflags: self.cleanup_debug_info_options(&self.config.target_rustcflags),
host_rustcflags: self.cleanup_debug_info_options(&self.config.host_rustcflags),
..self.config.clone()
};

let test_cx = TestCx { config: &config, ..*self };

test_cx.run_debuginfo_lldb_test_no_opt();
}

fn run_debuginfo_lldb_test_no_opt(&self) {
// compile test file (it should have 'compile-flags:-g' in the directive)
let should_run = self.run_if_enabled();
let compile_result = self.compile_test(should_run, Emit::None);
Expand Down Expand Up @@ -501,11 +464,4 @@ impl TestCx<'_> {
.env("PYTHONPATH", pythonpath),
)
}

fn cleanup_debug_info_options(&self, options: &Vec<String>) -> Vec<String> {
// Remove options that are either unwanted (-O) or may lead to duplicates due to RUSTFLAGS.
let options_to_remove = ["-O".to_owned(), "-g".to_owned(), "--debuginfo".to_owned()];

options.iter().filter(|x| !options_to_remove.contains(x)).cloned().collect()
}
}
Loading