Skip to content

Delete debuginfo test suite infra for gdb without Rust support and lldb with Rust support #129218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Aug 19, 2024
1 change: 0 additions & 1 deletion src/tools/compiletest/src/command-list.rs
Original file line number Diff line number Diff line change
@@ -142,7 +142,6 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"needs-relocation-model-pic",
"needs-run-enabled",
"needs-rust-lld",
"needs-rust-lldb",
"needs-sanitizer-address",
"needs-sanitizer-cfi",
"needs-sanitizer-dataflow",
6 changes: 0 additions & 6 deletions src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
@@ -296,15 +296,9 @@ pub struct Config {
/// Version of GDB, encoded as ((major * 1000) + minor) * 1000 + patch
pub gdb_version: Option<u32>,

/// Whether GDB has native rust support
pub gdb_native_rust: bool,

/// Version of LLDB
pub lldb_version: Option<u32>,

/// Whether LLDB has native rust support
pub lldb_native_rust: bool,

/// Version of LLVM
pub llvm_version: Option<u32>,

7 changes: 1 addition & 6 deletions src/tools/compiletest/src/header/needs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::common::{Config, Debugger, Sanitizer};
use crate::common::{Config, Sanitizer};
use crate::header::IgnoreDecision;

pub(super) fn handle_needs(
@@ -114,11 +114,6 @@ pub(super) fn handle_needs(
condition: cache.rust_lld,
ignore_reason: "ignored on targets without Rust's LLD",
},
Need {
name: "needs-rust-lldb",
condition: config.debugger != Some(Debugger::Lldb) || config.lldb_native_rust,
ignore_reason: "ignored on targets without Rust's LLDB",
},
Need {
name: "needs-dlltool",
condition: cache.dlltool,
36 changes: 11 additions & 25 deletions src/tools/compiletest/src/lib.rs
Original file line number Diff line number Diff line change
@@ -194,14 +194,8 @@ pub fn parse_config(args: Vec<String>) -> Config {
let target = opt_str2(matches.opt_str("target"));
let android_cross_path = opt_path(matches, "android-cross-path");
let (cdb, cdb_version) = analyze_cdb(matches.opt_str("cdb"), &target);
let (gdb, gdb_version, gdb_native_rust) =
analyze_gdb(matches.opt_str("gdb"), &target, &android_cross_path);
let (lldb_version, lldb_native_rust) = matches
.opt_str("lldb-version")
.as_deref()
.and_then(extract_lldb_version)
.map(|(v, b)| (Some(v), b))
.unwrap_or((None, false));
let (gdb, gdb_version) = analyze_gdb(matches.opt_str("gdb"), &target, &android_cross_path);
let lldb_version = matches.opt_str("lldb-version").as_deref().and_then(extract_lldb_version);
let color = match matches.opt_str("color").as_deref() {
Some("auto") | None => ColorConfig::AutoColor,
Some("always") => ColorConfig::AlwaysColor,
@@ -298,9 +292,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
cdb_version,
gdb,
gdb_version,
gdb_native_rust,
lldb_version,
lldb_native_rust,
llvm_version,
system_llvm: matches.opt_present("system-llvm"),
android_cross_path,
@@ -1035,19 +1027,17 @@ fn extract_cdb_version(full_version_line: &str) -> Option<[u16; 4]> {
Some([major, minor, patch, build])
}

/// Returns (Path to GDB, GDB Version, GDB has Rust Support)
/// Returns (Path to GDB, GDB Version)
fn analyze_gdb(
gdb: Option<String>,
target: &str,
android_cross_path: &PathBuf,
) -> (Option<String>, Option<u32>, bool) {
) -> (Option<String>, Option<u32>) {
#[cfg(not(windows))]
const GDB_FALLBACK: &str = "gdb";
#[cfg(windows)]
const GDB_FALLBACK: &str = "gdb.exe";

const MIN_GDB_WITH_RUST: u32 = 7011010;

let fallback_gdb = || {
if is_android_gdb_target(target) {
let mut gdb_path = match android_cross_path.to_str() {
@@ -1076,12 +1066,10 @@ fn analyze_gdb(

let version = match version_line {
Some(line) => extract_gdb_version(&line),
None => return (None, None, false),
None => return (None, None),
};

let gdb_native_rust = version.map_or(false, |v| v >= MIN_GDB_WITH_RUST);

(Some(gdb), version, gdb_native_rust)
(Some(gdb), version)
}

fn extract_gdb_version(full_version_line: &str) -> Option<u32> {
@@ -1131,8 +1119,8 @@ fn extract_gdb_version(full_version_line: &str) -> Option<u32> {
Some(((major * 1000) + minor) * 1000 + patch)
}

/// Returns (LLDB version, LLDB is rust-enabled)
fn extract_lldb_version(full_version_line: &str) -> Option<(u32, bool)> {
/// Returns LLDB version
fn extract_lldb_version(full_version_line: &str) -> Option<u32> {
// Extract the major LLDB version from the given version string.
// LLDB version strings are different for Apple and non-Apple platforms.
// The Apple variant looks like this:
@@ -1149,9 +1137,7 @@ fn extract_lldb_version(full_version_line: &str) -> Option<(u32, bool)> {
// There doesn't seem to be a way to correlate the Apple version
// with the upstream version, and since the tests were originally
// written against Apple versions, we make a fake Apple version by
// multiplying the first number by 100. This is a hack, but
// normally fine because the only non-Apple version we test is
// rust-enabled.
// multiplying the first number by 100. This is a hack.

let full_version_line = full_version_line.trim();

@@ -1160,12 +1146,12 @@ fn extract_lldb_version(full_version_line: &str) -> Option<(u32, bool)> {
{
if let Some(idx) = apple_ver.find(not_a_digit) {
let version: u32 = apple_ver[..idx].parse().unwrap();
return Some((version, full_version_line.contains("rust-enabled")));
return Some(version);
}
} else if let Some(lldb_ver) = full_version_line.strip_prefix("lldb version ") {
if let Some(idx) = lldb_ver.find(not_a_digit) {
let version: u32 = lldb_ver[..idx].parse().ok()?;
return Some((version * 100, full_version_line.contains("rust-enabled")));
return Some(version * 100);
}
}
None
30 changes: 3 additions & 27 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
@@ -856,22 +856,10 @@ impl<'test> TestCx<'test> {
}

fn run_debuginfo_gdb_test_no_opt(&self) {
let prefixes = if self.config.gdb_native_rust {
// GDB with Rust
static PREFIXES: &[&str] = &["gdb", "gdbr"];
println!("NOTE: compiletest thinks it is using GDB with native rust support");
PREFIXES
} else {
// Generic GDB
static PREFIXES: &[&str] = &["gdb", "gdbg"];
println!("NOTE: compiletest thinks it is using GDB without native rust support");
PREFIXES
};

let dbg_cmds = DebuggerCommands::parse_from(
&self.testpaths.file,
self.config,
prefixes,
&["gdb"],
self.revision,
)
.unwrap_or_else(|e| self.fatal(&e));
@@ -1053,9 +1041,7 @@ impl<'test> TestCx<'test> {
.push_str(&format!("file {}\n", exe_file.to_str().unwrap().replace(r"\", r"\\")));

// Force GDB to print values in the Rust format.
if self.config.gdb_native_rust {
script_str.push_str("set language rust\n");
}
script_str.push_str("set language rust\n");

// Add line breakpoints
for line in &dbg_cmds.breakpoint_lines {
@@ -1140,21 +1126,11 @@ impl<'test> TestCx<'test> {
}
}

let prefixes = if self.config.lldb_native_rust {
static PREFIXES: &[&str] = &["lldb", "lldbr"];
println!("NOTE: compiletest thinks it is using LLDB with native rust support");
PREFIXES
} else {
static PREFIXES: &[&str] = &["lldb", "lldbg"];
println!("NOTE: compiletest thinks it is using LLDB without native rust support");
PREFIXES
};

// Parse debugger commands etc from test files
let dbg_cmds = DebuggerCommands::parse_from(
&self.testpaths.file,
self.config,
prefixes,
&["lldb"],
self.revision,
)
.unwrap_or_else(|e| self.fatal(&e));
8 changes: 4 additions & 4 deletions src/tools/compiletest/src/tests.rs
Original file line number Diff line number Diff line change
@@ -48,12 +48,12 @@ fn test_extract_gdb_version() {
#[test]
fn test_extract_lldb_version() {
// Apple variants
assert_eq!(extract_lldb_version("LLDB-179.5"), Some((179, false)));
assert_eq!(extract_lldb_version("lldb-300.2.51"), Some((300, false)));
assert_eq!(extract_lldb_version("LLDB-179.5"), Some(179));
assert_eq!(extract_lldb_version("lldb-300.2.51"), Some(300));

// Upstream versions
assert_eq!(extract_lldb_version("lldb version 6.0.1"), Some((600, false)));
assert_eq!(extract_lldb_version("lldb version 9.0.0"), Some((900, false)));
assert_eq!(extract_lldb_version("lldb version 6.0.1"), Some(600));
assert_eq!(extract_lldb_version("lldb version 9.0.0"), Some(900));
}

#[test]
37 changes: 11 additions & 26 deletions tests/debuginfo/associated-types.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
// Some versions of the non-rust-enabled LLDB print the wrong generic
// parameter type names in this test.
//@ needs-rust-lldb

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
// gdb-command:run

// gdb-command:print arg
// gdbg-check:$1 = {b = -1, b1 = 0}
// gdbr-check:$1 = associated_types::Struct<i32> {b: -1, b1: 0}
// gdb-check:$1 = associated_types::Struct<i32> {b: -1, b1: 0}
// gdb-command:continue

// gdb-command:print inferred
@@ -23,8 +18,7 @@
// gdb-command:continue

// gdb-command:print arg
// gdbg-check:$5 = {__0 = 4, __1 = 5}
// gdbr-check:$5 = (4, 5)
// gdb-check:$5 = (4, 5)
// gdb-command:continue

// gdb-command:print a
@@ -43,42 +37,33 @@
// lldb-command:run

// lldb-command:v arg
// lldbg-check:[...] { b = -1, b1 = 0 }
// lldbr-check:(associated_types::Struct<i32>) arg = { b = -1, b1 = 0 }
// lldb-check:[...] { b = -1 b1 = 0 }
// lldb-command:continue

// lldb-command:v inferred
// lldbg-check:[...] 1
// lldbr-check:(i64) inferred = 1
// lldb-check:[...] 1
// lldb-command:v explicitly
// lldbg-check:[...] 1
// lldbr-check:(i64) explicitly = 1
// lldb-check:[...] 1
// lldb-command:continue

// lldb-command:v arg
// lldbg-check:[...] 2
// lldbr-check:(i64) arg = 2
// lldb-check:[...] 2
// lldb-command:continue

// lldb-command:v arg
// lldbg-check:[...] (4, 5)
// lldbr-check:((i32, i64)) arg = { = 4 = 5 }
// lldb-check:[...] { 0 = 4 1 = 5 }
// lldb-command:continue

// lldb-command:v a
// lldbg-check:[...] 6
// lldbr-check:(i32) a = 6
// lldb-check:[...] 6
// lldb-command:v b
// lldbg-check:[...] 7
// lldbr-check:(i64) b = 7
// lldb-check:[...] 7
// lldb-command:continue

// lldb-command:v a
// lldbg-check:[...] 8
// lldbr-check:(i64) a = 8
// lldb-check:[...] 8
// lldb-command:v b
// lldbg-check:[...] 9
// lldbr-check:(i32) b = 9
// lldb-check:[...] 9
// lldb-command:continue

#![allow(unused_variables)]
48 changes: 16 additions & 32 deletions tests/debuginfo/basic-types-globals-metadata.rs
Original file line number Diff line number Diff line change
@@ -1,51 +1,35 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// gdb-command:run
// gdbg-command:whatis 'basic_types_globals_metadata::B'
// gdbr-command:whatis basic_types_globals_metadata::B
// gdb-command:whatis basic_types_globals_metadata::B
// gdb-check:type = bool
// gdbg-command:whatis 'basic_types_globals_metadata::I'
// gdbr-command:whatis basic_types_globals_metadata::I
// gdb-command:whatis basic_types_globals_metadata::I
// gdb-check:type = isize
// gdbg-command:whatis 'basic_types_globals_metadata::C'
// gdbr-command:whatis basic_types_globals_metadata::C
// gdb-command:whatis basic_types_globals_metadata::C
// gdb-check:type = char
// gdbg-command:whatis 'basic_types_globals_metadata::I8'
// gdbr-command:whatis basic_types_globals_metadata::I8
// gdb-command:whatis basic_types_globals_metadata::I8
// gdb-check:type = i8
// gdbg-command:whatis 'basic_types_globals_metadata::I16'
// gdbr-command:whatis basic_types_globals_metadata::I16
// gdb-command:whatis basic_types_globals_metadata::I16
// gdb-check:type = i16
// gdbg-command:whatis 'basic_types_globals_metadata::I32'
// gdbr-command:whatis basic_types_globals_metadata::I32
// gdb-command:whatis basic_types_globals_metadata::I32
// gdb-check:type = i32
// gdbg-command:whatis 'basic_types_globals_metadata::I64'
// gdbr-command:whatis basic_types_globals_metadata::I64
// gdb-command:whatis basic_types_globals_metadata::I64
// gdb-check:type = i64
// gdbg-command:whatis 'basic_types_globals_metadata::U'
// gdbr-command:whatis basic_types_globals_metadata::U
// gdb-command:whatis basic_types_globals_metadata::U
// gdb-check:type = usize
// gdbg-command:whatis 'basic_types_globals_metadata::U8'
// gdbr-command:whatis basic_types_globals_metadata::U8
// gdb-command:whatis basic_types_globals_metadata::U8
// gdb-check:type = u8
// gdbg-command:whatis 'basic_types_globals_metadata::U16'
// gdbr-command:whatis basic_types_globals_metadata::U16
// gdb-command:whatis basic_types_globals_metadata::U16
// gdb-check:type = u16
// gdbg-command:whatis 'basic_types_globals_metadata::U32'
// gdbr-command:whatis basic_types_globals_metadata::U32
// gdb-command:whatis basic_types_globals_metadata::U32
// gdb-check:type = u32
// gdbg-command:whatis 'basic_types_globals_metadata::U64'
// gdbr-command:whatis basic_types_globals_metadata::U64
// gdb-command:whatis basic_types_globals_metadata::U64
// gdb-check:type = u64
// gdbg-command:whatis 'basic_types_globals_metadata::F16'
// gdbr-command:whatis basic_types_globals_metadata::F16
// gdb-command:whatis basic_types_globals_metadata::F16
// gdb-check:type = f16
// gdbg-command:whatis 'basic_types_globals_metadata::F32'
// gdbr-command:whatis basic_types_globals_metadata::F32
// gdb-command:whatis basic_types_globals_metadata::F32
// gdb-check:type = f32
// gdbg-command:whatis 'basic_types_globals_metadata::F64'
// gdbr-command:whatis basic_types_globals_metadata::F64
// gdb-command:whatis basic_types_globals_metadata::F64
// gdb-check:type = f64
// gdb-command:continue

54 changes: 16 additions & 38 deletions tests/debuginfo/basic-types-globals.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
// Caveat - gdb doesn't know about UTF-32 character encoding and will print a
// rust char as only its numerical value.

//@ min-lldb-version: 310
//@ min-gdb-version: 8.0

//@ revisions: lto no-lto

//@ compile-flags:-g
@@ -12,51 +6,35 @@
//@ [lto] no-prefer-dynamic

// gdb-command:run
// gdbg-command:print 'basic_types_globals::B'
// gdbr-command:print B
// gdb-command:print B
// gdb-check:$1 = false
// gdbg-command:print 'basic_types_globals::I'
// gdbr-command:print I
// gdb-command:print I
// gdb-check:$2 = -1
// gdbg-command:print 'basic_types_globals::C'
// gdbr-command:print/d C
// gdbg-check:$3 = 97
// gdbr-check:$3 = 97
// gdbg-command:print/d 'basic_types_globals::I8'
// gdbr-command:print I8
// gdb-command:print/d C
// gdb-check:$3 = 97
// gdb-command:print I8
// gdb-check:$4 = 68
// gdbg-command:print 'basic_types_globals::I16'
// gdbr-command:print I16
// gdb-command:print I16
// gdb-check:$5 = -16
// gdbg-command:print 'basic_types_globals::I32'
// gdbr-command:print I32
// gdb-command:print I32
// gdb-check:$6 = -32
// gdbg-command:print 'basic_types_globals::I64'
// gdbr-command:print I64
// gdb-command:print I64
// gdb-check:$7 = -64
// gdbg-command:print 'basic_types_globals::U'
// gdbr-command:print U
// gdb-command:print U
// gdb-check:$8 = 1
// gdbg-command:print/d 'basic_types_globals::U8'
// gdbr-command:print U8
// gdb-command:print U8
// gdb-check:$9 = 100
// gdbg-command:print 'basic_types_globals::U16'
// gdbr-command:print U16
// gdb-command:print U16
// gdb-check:$10 = 16
// gdbg-command:print 'basic_types_globals::U32'
// gdbr-command:print U32
// gdb-command:print U32
// gdb-check:$11 = 32
// gdbg-command:print 'basic_types_globals::U64'
// gdbr-command:print U64
// gdb-command:print U64
// gdb-check:$12 = 64
// gdbg-command:print 'basic_types_globals::F16'
// gdbr-command:print F16
// gdb-command:print F16
// gdb-check:$13 = 1.5
// gdbg-command:print 'basic_types_globals::F32'
// gdbr-command:print F32
// gdb-command:print F32
// gdb-check:$14 = 2.5
// gdbg-command:print 'basic_types_globals::F64'
// gdbr-command:print F64
// gdb-command:print F64
// gdb-check:$15 = 3.5
// gdb-command:continue

32 changes: 10 additions & 22 deletions tests/debuginfo/basic-types-metadata.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// gdb-command:run
// gdb-command:whatis unit
// gdb-check:type = ()
@@ -37,29 +36,18 @@
// gdb-command:whatis fnptr
// gdb-check:type = *mut fn ()
// gdb-command:info functions _yyy
// gdbg-check:[...]![...]_yyy([...]);
// gdbr-check:static fn basic_types_metadata::_yyy();
// gdb-check:static fn basic_types_metadata::_yyy();
// gdb-command:ptype closure_0
// gdbr-check: type = struct basic_types_metadata::main::{closure_env#0}
// gdbg-check: type = struct closure {
// gdbg-check: <no data fields>
// gdbg-check: }
// gdb-check: type = struct basic_types_metadata::main::{closure_env#0}
// gdb-command:ptype closure_1
// gdbg-check: type = struct closure {
// gdbg-check: bool *__0;
// gdbg-check: }
// gdbr-check: type = struct basic_types_metadata::main::{closure_env#1} {
// gdbr-check: *mut bool,
// gdbr-check: }
// gdb-check: type = struct basic_types_metadata::main::{closure_env#1} {
// gdb-check: *mut bool,
// gdb-check: }
// gdb-command:ptype closure_2
// gdbg-check: type = struct closure {
// gdbg-check: bool *__0;
// gdbg-check: isize *__1;
// gdbg-check: }
// gdbr-check: type = struct basic_types_metadata::main::{closure_env#2} {
// gdbr-check: *mut bool,
// gdbr-check: *mut isize,
// gdbr-check: }
// gdb-check: type = struct basic_types_metadata::main::{closure_env#2} {
// gdb-check: *mut bool,
// gdb-check: *mut isize,
// gdb-check: }

//
// gdb-command:continue
98 changes: 32 additions & 66 deletions tests/debuginfo/basic-types-mut-globals.rs
Original file line number Diff line number Diff line change
@@ -4,107 +4,73 @@
// about UTF-32 character encoding and will print a rust char as only
// its numerical value.

//@ min-lldb-version: 310

//@ compile-flags:-g

// gdb-command:run

// Check initializers
// gdbg-command:print 'basic_types_mut_globals::B'
// gdbr-command:print B
// gdb-command:print B
// gdb-check:$1 = false
// gdbg-command:print 'basic_types_mut_globals::I'
// gdbr-command:print I
// gdb-command:print I
// gdb-check:$2 = -1
// gdbg-command:print/d 'basic_types_mut_globals::C'
// gdbr-command:print C
// gdbg-check:$3 = 97
// gdbr-check:$3 = 97 'a'
// gdbg-command:print/d 'basic_types_mut_globals::I8'
// gdbr-command:print I8
// gdb-command:print C
// gdb-check:$3 = 97 'a'
// gdb-command:print I8
// gdb-check:$4 = 68
// gdbg-command:print 'basic_types_mut_globals::I16'
// gdbr-command:print I16
// gdb-command:print I16
// gdb-check:$5 = -16
// gdbg-command:print 'basic_types_mut_globals::I32'
// gdbr-command:print I32
// gdb-command:print I32
// gdb-check:$6 = -32
// gdbg-command:print 'basic_types_mut_globals::I64'
// gdbr-command:print I64
// gdb-command:print I64
// gdb-check:$7 = -64
// gdbg-command:print 'basic_types_mut_globals::U'
// gdbr-command:print U
// gdb-command:print U
// gdb-check:$8 = 1
// gdbg-command:print/d 'basic_types_mut_globals::U8'
// gdbr-command:print U8
// gdb-command:print U8
// gdb-check:$9 = 100
// gdbg-command:print 'basic_types_mut_globals::U16'
// gdbr-command:print U16
// gdb-command:print U16
// gdb-check:$10 = 16
// gdbg-command:print 'basic_types_mut_globals::U32'
// gdbr-command:print U32
// gdb-command:print U32
// gdb-check:$11 = 32
// gdbg-command:print 'basic_types_mut_globals::U64'
// gdbr-command:print U64
// gdb-command:print U64
// gdb-check:$12 = 64
// gdbg-command:print 'basic_types_mut_globals::F16'
// gdbr-command:print F16
// gdb-command:print F16
// gdb-check:$13 = 1.5
// gdbg-command:print 'basic_types_mut_globals::F32'
// gdbr-command:print F32
// gdb-command:print F32
// gdb-check:$14 = 2.5
// gdbg-command:print 'basic_types_mut_globals::F64'
// gdbr-command:print F64
// gdb-command:print F64
// gdb-check:$15 = 3.5
// gdb-command:continue

// Check new values
// gdbg-command:print 'basic_types_mut_globals'::B
// gdbr-command:print B
// gdb-command:print B
// gdb-check:$16 = true
// gdbg-command:print 'basic_types_mut_globals'::I
// gdbr-command:print I
// gdb-command:print I
// gdb-check:$17 = 2
// gdbg-command:print/d 'basic_types_mut_globals'::C
// gdbr-command:print C
// gdbg-check:$18 = 102
// gdbr-check:$18 = 102 'f'
// gdbg-command:print/d 'basic_types_mut_globals'::I8
// gdbr-command:print/d I8
// gdb-command:print C
// gdb-check:$18 = 102 'f'
// gdb-command:print/d I8
// gdb-check:$19 = 78
// gdbg-command:print 'basic_types_mut_globals'::I16
// gdbr-command:print I16
// gdb-command:print I16
// gdb-check:$20 = -26
// gdbg-command:print 'basic_types_mut_globals'::I32
// gdbr-command:print I32
// gdb-command:print I32
// gdb-check:$21 = -12
// gdbg-command:print 'basic_types_mut_globals'::I64
// gdbr-command:print I64
// gdb-command:print I64
// gdb-check:$22 = -54
// gdbg-command:print 'basic_types_mut_globals'::U
// gdbr-command:print U
// gdb-command:print U
// gdb-check:$23 = 5
// gdbg-command:print/d 'basic_types_mut_globals'::U8
// gdbr-command:print/d U8
// gdb-command:print/d U8
// gdb-check:$24 = 20
// gdbg-command:print 'basic_types_mut_globals'::U16
// gdbr-command:print U16
// gdb-command:print U16
// gdb-check:$25 = 32
// gdbg-command:print 'basic_types_mut_globals'::U32
// gdbr-command:print U32
// gdb-command:print U32
// gdb-check:$26 = 16
// gdbg-command:print 'basic_types_mut_globals'::U64
// gdbr-command:print U64
// gdb-command:print U64
// gdb-check:$27 = 128
// gdbg-command:print 'basic_types_mut_globals'::F16
// gdbr-command:print F16
// gdb-command:print F16
// gdb-check:$28 = 2.25
// gdbg-command:print 'basic_types_mut_globals'::F32
// gdbr-command:print F32
// gdb-command:print F32
// gdb-check:$29 = 5.75
// gdbg-command:print 'basic_types_mut_globals'::F64
// gdbr-command:print F64
// gdb-command:print F64
// gdb-check:$30 = 9.25

#![allow(unused_variables)]
51 changes: 15 additions & 36 deletions tests/debuginfo/basic-types.rs
Original file line number Diff line number Diff line change
@@ -4,8 +4,6 @@
// about UTF-32 character encoding and will print a rust char as only
// its numerical value.

//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -16,8 +14,7 @@
// gdb-command:print i
// gdb-check:$2 = -1
// gdb-command:print c
// gdbg-check:$3 = 97
// gdbr-check:$3 = 97 'a'
// gdb-check:$3 = 97 'a'
// gdb-command:print/d i8
// gdb-check:$4 = 68
// gdb-command:print i16
@@ -43,56 +40,38 @@
// gdb-command:print f64
// gdb-check:$15 = 3.5
// gdb-command:print s
// gdbg-check:$16 = {data_ptr = [...] "Hello, World!", length = 13}
// gdbr-check:$16 = "Hello, World!"
// gdb-check:$16 = "Hello, World!"

// === LLDB TESTS ==================================================================================

// lldb-command:run
// lldb-command:v b
// lldbg-check:[...] false
// lldbr-check:(bool) b = false
// lldb-check:[...] false
// lldb-command:v i
// lldbg-check:[...] -1
// lldbr-check:(isize) i = -1

// NOTE: only rust-enabled lldb supports 32bit chars
// lldbr-command:print c
// lldbr-check:(char) c = 'a'
// lldb-check:[...] -1

// lldb-command:v i8
// lldbg-check:[...] 'D'
// lldbr-check:(i8) i8 = 68
// lldb-check:[...] 'D'
// lldb-command:v i16
// lldbg-check:[...] -16
// lldbr-check:(i16) i16 = -16
// lldb-check:[...] -16
// lldb-command:v i32
// lldbg-check:[...] -32
// lldbr-check:(i32) i32 = -32
// lldb-check:[...] -32
// lldb-command:v i64
// lldbg-check:[...] -64
// lldbr-check:(i64) i64 = -64
// lldb-check:[...] -64
// lldb-command:v u
// lldbg-check:[...] 1
// lldbr-check:(usize) u = 1
// lldb-check:[...] 1
// lldb-command:v u8
// lldbg-check:[...] 'd'
// lldbr-check:(u8) u8 = 100
// lldb-check:[...] 'd'
// lldb-command:v u16
// lldbg-check:[...] 16
// lldbr-check:(u16) u16 = 16
// lldb-check:[...] 16
// lldb-command:v u32
// lldbg-check:[...] 32
// lldbr-check:(u32) u32 = 32
// lldb-check:[...] 32
// lldb-command:v u64
// lldbg-check:[...] 64
// lldbr-check:(u64) u64 = 64
// lldb-check:[...] 64
// lldb-command:v f32
// lldbg-check:[...] 2.5
// lldbr-check:(f32) f32 = 2.5
// lldb-check:[...] 2.5
// lldb-command:v f64
// lldbg-check:[...] 3.5
// lldbr-check:(f64) f64 = 3.5
// lldb-check:[...] 3.5

// === CDB TESTS ===================================================================================

52 changes: 16 additions & 36 deletions tests/debuginfo/borrowed-basic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ compile-flags:-g
//@ min-lldb-version: 310

// === GDB TESTS ===================================================================================

@@ -14,8 +13,7 @@
// gdb-check:$3 = 97

// gdb-command:print *i8_ref
// gdbg-check:$4 = 68 'D'
// gdbr-check:$4 = 68
// gdb-check:$4 = 68

// gdb-command:print *i16_ref
// gdb-check:$5 = -16
@@ -30,8 +28,7 @@
// gdb-check:$8 = 1

// gdb-command:print *u8_ref
// gdbg-check:$9 = 100 'd'
// gdbr-check:$9 = 100
// gdb-check:$9 = 100

// gdb-command:print *u16_ref
// gdb-check:$10 = 16
@@ -56,64 +53,47 @@

// lldb-command:run
// lldb-command:v *bool_ref
// lldbg-check:[...] true
// lldbr-check:(bool) *bool_ref = true
// lldb-check:[...] true

// lldb-command:v *int_ref
// lldbg-check:[...] -1
// lldbr-check:(isize) *int_ref = -1
// lldb-check:[...] -1

// NOTE: only rust-enabled lldb supports 32bit chars
// lldbr-command:print *char_ref
// lldbr-check:(char) *char_ref = 'a'

// lldb-command:v *i8_ref
// lldbg-check:[...] 'D'
// lldbr-check:(i8) *i8_ref = 68
// lldb-check:[...] 'D'

// lldb-command:v *i16_ref
// lldbg-check:[...] -16
// lldbr-check:(i16) *i16_ref = -16
// lldb-check:[...] -16

// lldb-command:v *i32_ref
// lldbg-check:[...] -32
// lldbr-check:(i32) *i32_ref = -32
// lldb-check:[...] -32

// lldb-command:v *i64_ref
// lldbg-check:[...] -64
// lldbr-check:(i64) *i64_ref = -64
// lldb-check:[...] -64

// lldb-command:v *uint_ref
// lldbg-check:[...] 1
// lldbr-check:(usize) *uint_ref = 1
// lldb-check:[...] 1

// lldb-command:v *u8_ref
// lldbg-check:[...] 'd'
// lldbr-check:(u8) *u8_ref = 100
// lldb-check:[...] 'd'

// lldb-command:v *u16_ref
// lldbg-check:[...] 16
// lldbr-check:(u16) *u16_ref = 16
// lldb-check:[...] 16

// lldb-command:v *u32_ref
// lldbg-check:[...] 32
// lldbr-check:(u32) *u32_ref = 32
// lldb-check:[...] 32

// lldb-command:v *u64_ref
// lldbg-check:[...] 64
// lldbr-check:(u64) *u64_ref = 64
// lldb-check:[...] 64

// lldb-command:v *f16_ref
// lldbg-check:[...] 1.5
// lldbr-check:(f16) *f16_ref = 1.5
// lldb-check:[...] 1.5

// lldb-command:v *f32_ref
// lldbg-check:[...] 2.5
// lldbr-check:(f32) *f32_ref = 2.5
// lldb-check:[...] 2.5

// lldb-command:v *f64_ref
// lldbg-check:[...] 3.5
// lldbr-check:(f64) *f64_ref = 3.5
// lldb-check:[...] 3.5

#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
19 changes: 6 additions & 13 deletions tests/debuginfo/borrowed-c-style-enum.rs
Original file line number Diff line number Diff line change
@@ -1,38 +1,31 @@
//@ compile-flags:-g
//@ min-lldb-version: 310

// === GDB TESTS ===================================================================================

// gdb-command:run

// gdb-command:print *the_a_ref
// gdbg-check:$1 = TheA
// gdbr-check:$1 = borrowed_c_style_enum::ABC::TheA
// gdb-check:$1 = borrowed_c_style_enum::ABC::TheA

// gdb-command:print *the_b_ref
// gdbg-check:$2 = TheB
// gdbr-check:$2 = borrowed_c_style_enum::ABC::TheB
// gdb-check:$2 = borrowed_c_style_enum::ABC::TheB

// gdb-command:print *the_c_ref
// gdbg-check:$3 = TheC
// gdbr-check:$3 = borrowed_c_style_enum::ABC::TheC
// gdb-check:$3 = borrowed_c_style_enum::ABC::TheC


// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:v *the_a_ref
// lldbg-check:[...] TheA
// lldbr-check:(borrowed_c_style_enum::ABC) *the_a_ref = borrowed_c_style_enum::ABC::TheA
// lldb-check:[...] TheA

// lldb-command:v *the_b_ref
// lldbg-check:[...] TheB
// lldbr-check:(borrowed_c_style_enum::ABC) *the_b_ref = borrowed_c_style_enum::ABC::TheB
// lldb-check:[...] TheB

// lldb-command:v *the_c_ref
// lldbg-check:[...] TheC
// lldbr-check:(borrowed_c_style_enum::ABC) *the_c_ref = borrowed_c_style_enum::ABC::TheC
// lldb-check:[...] TheC

#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
17 changes: 6 additions & 11 deletions tests/debuginfo/borrowed-enum.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Require a gdb or lldb that can read DW_TAG_variant_part.
//@ min-gdb-version: 8.2
//@ min-lldb-version: 1800

//@ compile-flags:-g
@@ -9,28 +7,25 @@
// gdb-command:run

// gdb-command:print *the_a_ref
// gdbr-check:$1 = borrowed_enum::ABC::TheA{x: 0, y: 8970181431921507452}
// gdb-check:$1 = borrowed_enum::ABC::TheA{x: 0, y: 8970181431921507452}

// gdb-command:print *the_b_ref
// gdbr-check:$2 = borrowed_enum::ABC::TheB(0, 286331153, 286331153)
// gdb-check:$2 = borrowed_enum::ABC::TheB(0, 286331153, 286331153)

// gdb-command:print *univariant_ref
// gdbr-check:$3 = borrowed_enum::Univariant::TheOnlyCase(4820353753753434)
// gdb-check:$3 = borrowed_enum::Univariant::TheOnlyCase(4820353753753434)


// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:v *the_a_ref
// lldbg-check:(borrowed_enum::ABC) *the_a_ref = { value = { x = 0 y = 8970181431921507452 } $discr$ = 0 }
// lldbr-check:(borrowed_enum::ABC::TheA) *the_a_ref = TheA { TheA: 0, TheB: 8970181431921507452 }
// lldb-check:(borrowed_enum::ABC) *the_a_ref = { value = { x = 0 y = 8970181431921507452 } $discr$ = 0 }
// lldb-command:v *the_b_ref
// lldbg-check:(borrowed_enum::ABC) *the_b_ref = { value = { 0 = 0 1 = 286331153 2 = 286331153 } $discr$ = 1 }
// lldbr-check:(borrowed_enum::ABC::TheB) *the_b_ref = { = 0 = 286331153 = 286331153 }
// lldb-check:(borrowed_enum::ABC) *the_b_ref = { value = { 0 = 0 1 = 286331153 2 = 286331153 } $discr$ = 1 }
// lldb-command:v *univariant_ref
// lldbg-check:(borrowed_enum::Univariant) *univariant_ref = { value = { 0 = 4820353753753434 } }
// lldbr-check:(borrowed_enum::Univariant) *univariant_ref = { TheOnlyCase = { = 4820353753753434 } }
// lldb-check:(borrowed_enum::Univariant) *univariant_ref = { value = { 0 = 4820353753753434 } }

#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
31 changes: 10 additions & 21 deletions tests/debuginfo/borrowed-struct.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
//@ compile-flags:-g
//@ min-lldb-version: 310

// === GDB TESTS ===================================================================================

// gdb-command:run

// gdb-command:print *stack_val_ref
// gdbg-check:$1 = {x = 10, y = 23.5}
// gdbr-check:$1 = borrowed_struct::SomeStruct {x: 10, y: 23.5}
// gdb-check:$1 = borrowed_struct::SomeStruct {x: 10, y: 23.5}

// gdb-command:print *stack_val_interior_ref_1
// gdb-check:$2 = 10
@@ -16,12 +14,10 @@
// gdb-check:$3 = 23.5

// gdb-command:print *ref_to_unnamed
// gdbg-check:$4 = {x = 11, y = 24.5}
// gdbr-check:$4 = borrowed_struct::SomeStruct {x: 11, y: 24.5}
// gdb-check:$4 = borrowed_struct::SomeStruct {x: 11, y: 24.5}

// gdb-command:print *unique_val_ref
// gdbg-check:$5 = {x = 13, y = 26.5}
// gdbr-check:$5 = borrowed_struct::SomeStruct {x: 13, y: 26.5}
// gdb-check:$5 = borrowed_struct::SomeStruct {x: 13, y: 26.5}

// gdb-command:print *unique_val_interior_ref_1
// gdb-check:$6 = 13
@@ -35,32 +31,25 @@
// lldb-command:run

// lldb-command:v *stack_val_ref
// lldbg-check:[...] { x = 10 y = 23.5 }
// lldbr-check:(borrowed_struct::SomeStruct) *stack_val_ref = (x = 10, y = 23.5)
// lldb-check:[...] { x = 10 y = 23.5 }

// lldb-command:v *stack_val_interior_ref_1
// lldbg-check:[...] 10
// lldbr-check:(isize) *stack_val_interior_ref_1 = 10
// lldb-check:[...] 10

// lldb-command:v *stack_val_interior_ref_2
// lldbg-check:[...] 23.5
// lldbr-check:(f64) *stack_val_interior_ref_2 = 23.5
// lldb-check:[...] 23.5

// lldb-command:v *ref_to_unnamed
// lldbg-check:[...] { x = 11 y = 24.5 }
// lldbr-check:(borrowed_struct::SomeStruct) *ref_to_unnamed = (x = 11, y = 24.5)
// lldb-check:[...] { x = 11 y = 24.5 }

// lldb-command:v *unique_val_ref
// lldbg-check:[...] { x = 13 y = 26.5 }
// lldbr-check:(borrowed_struct::SomeStruct) *unique_val_ref = (x = 13, y = 26.5)
// lldb-check:[...] { x = 13 y = 26.5 }

// lldb-command:v *unique_val_interior_ref_1
// lldbg-check:[...] 13
// lldbr-check:(isize) *unique_val_interior_ref_1 = 13
// lldb-check:[...] 13

// lldb-command:v *unique_val_interior_ref_2
// lldbg-check:[...] 26.5
// lldbr-check:(f64) *unique_val_interior_ref_2 = 26.5
// lldb-check:[...] 26.5

#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
20 changes: 6 additions & 14 deletions tests/debuginfo/borrowed-tuple.rs
Original file line number Diff line number Diff line change
@@ -1,39 +1,31 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================

// gdb-command:run

// gdb-command:print *stack_val_ref
// gdbg-check:$1 = {__0 = -14, __1 = -19}
// gdbr-check:$1 = (-14, -19)
// gdb-check:$1 = (-14, -19)

// gdb-command:print *ref_to_unnamed
// gdbg-check:$2 = {__0 = -15, __1 = -20}
// gdbr-check:$2 = (-15, -20)
// gdb-check:$2 = (-15, -20)

// gdb-command:print *unique_val_ref
// gdbg-check:$3 = {__0 = -17, __1 = -22}
// gdbr-check:$3 = (-17, -22)
// gdb-check:$3 = (-17, -22)


// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:v *stack_val_ref
// lldbg-check:[...] { 0 = -14 1 = -19 }
// lldbr-check:((i16, f32)) *stack_val_ref = { 0 = -14 1 = -19 }
// lldb-check:[...] { 0 = -14 1 = -19 }

// lldb-command:v *ref_to_unnamed
// lldbg-check:[...] { 0 = -15 1 = -20 }
// lldbr-check:((i16, f32)) *ref_to_unnamed = { 0 = -15 1 = -20 }
// lldb-check:[...] { 0 = -15 1 = -20 }

// lldb-command:v *unique_val_ref
// lldbg-check:[...] { 0 = -17 1 = -22 }
// lldbr-check:((i16, f32)) *unique_val_ref = { 0 = -17 1 = -22 }
// lldb-check:[...] { 0 = -17 1 = -22 }


#![allow(unused_variables)]
47 changes: 14 additions & 33 deletions tests/debuginfo/borrowed-unique-basic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -59,64 +57,47 @@
// lldb-command:run

// lldb-command:v *bool_ref
// lldbg-check:[...] true
// lldbr-check:(bool) *bool_ref = true
// lldb-check:[...] true

// lldb-command:v *int_ref
// lldbg-check:[...] -1
// lldbr-check:(isize) *int_ref = -1
// lldb-check:[...] -1

// NOTE: only rust-enabled lldb supports 32bit chars
// lldbr-command:print *char_ref
// lldbr-check:(char) *char_ref = 97

// lldb-command:v *i8_ref
// lldbg-check:[...] 68
// lldbr-check:(i8) *i8_ref = 68
// lldb-check:[...] 68

// lldb-command:v *i16_ref
// lldbg-check:[...] -16
// lldbr-check:(i16) *i16_ref = -16
// lldb-check:[...] -16

// lldb-command:v *i32_ref
// lldbg-check:[...] -32
// lldbr-check:(i32) *i32_ref = -32
// lldb-check:[...] -32

// lldb-command:v *i64_ref
// lldbg-check:[...] -64
// lldbr-check:(i64) *i64_ref = -64
// lldb-check:[...] -64

// lldb-command:v *uint_ref
// lldbg-check:[...] 1
// lldbr-check:(usize) *uint_ref = 1
// lldb-check:[...] 1

// lldb-command:v *u8_ref
// lldbg-check:[...] 100
// lldbr-check:(u8) *u8_ref = 100
// lldb-check:[...] 100

// lldb-command:v *u16_ref
// lldbg-check:[...] 16
// lldbr-check:(u16) *u16_ref = 16
// lldb-check:[...] 16

// lldb-command:v *u32_ref
// lldbg-check:[...] 32
// lldbr-check:(u32) *u32_ref = 32
// lldb-check:[...] 32

// lldb-command:v *u64_ref
// lldbg-check:[...] 64
// lldbr-check:(u64) *u64_ref = 64
// lldb-check:[...] 64

// lldb-command:v *f16_ref
// lldbg-check:[...] 1.5
// lldbr-check:(f16) *f16_ref = 1.5
// lldb-check:[...] 1.5

// lldb-command:v *f32_ref
// lldbg-check:[...] 2.5
// lldbr-check:(f32) *f32_ref = 2.5
// lldb-check:[...] 2.5

// lldb-command:v *f64_ref
// lldbg-check:[...] 3.5
// lldbr-check:(f64) *f64_ref = 3.5
// lldb-check:[...] 3.5

#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
11 changes: 3 additions & 8 deletions tests/debuginfo/box.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -9,19 +7,16 @@
// gdb-command:print *a
// gdb-check:$1 = 1
// gdb-command:print *b
// gdbg-check:$2 = {__0 = 2, __1 = 3.5}
// gdbr-check:$2 = (2, 3.5)
// gdb-check:$2 = (2, 3.5)


// === LLDB TESTS ==================================================================================

// lldb-command:run
// lldb-command:v *a
// lldbg-check:[...] 1
// lldbr-check:(i32) *a = 1
// lldb-check:[...] 1
// lldb-command:v *b
// lldbg-check:[...] { 0 = 2 1 = 3.5 }
// lldbr-check:((i32, f64)) *b = { 0 = 2 1 = 3.5 }
// lldb-check:[...] { 0 = 2 1 = 3.5 }

#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
14 changes: 4 additions & 10 deletions tests/debuginfo/boxed-struct.rs
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================

// gdb-command:run

// gdb-command:print *boxed_with_padding
// gdbg-check:$1 = {x = 99, y = 999, z = 9999, w = 99999}
// gdbr-check:$1 = boxed_struct::StructWithSomePadding {x: 99, y: 999, z: 9999, w: 99999}
// gdb-check:$1 = boxed_struct::StructWithSomePadding {x: 99, y: 999, z: 9999, w: 99999}

// gdb-command:print *boxed_with_dtor
// gdbg-check:$2 = {x = 77, y = 777, z = 7777, w = 77777}
// gdbr-check:$2 = boxed_struct::StructWithDestructor {x: 77, y: 777, z: 7777, w: 77777}
// gdb-check:$2 = boxed_struct::StructWithDestructor {x: 77, y: 777, z: 7777, w: 77777}


// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:v *boxed_with_padding
// lldbg-check:[...] { x = 99 y = 999 z = 9999 w = 99999 }
// lldbr-check:(boxed_struct::StructWithSomePadding) *boxed_with_padding = { x = 99 y = 999 z = 9999 w = 99999 }
// lldb-check:[...] { x = 99 y = 999 z = 9999 w = 99999 }

// lldb-command:v *boxed_with_dtor
// lldbg-check:[...] { x = 77 y = 777 z = 7777 w = 77777 }
// lldbr-check:(boxed_struct::StructWithDestructor) *boxed_with_dtor = { x = 77 y = 777 z = 7777 w = 77777 }
// lldb-check:[...] { x = 77 y = 777 z = 7777 w = 77777 }

#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
15 changes: 5 additions & 10 deletions tests/debuginfo/by-value-non-immediate-argument.rs
Original file line number Diff line number Diff line change
@@ -7,32 +7,27 @@
// gdb-command:run

// gdb-command:print s
// gdbg-check:$1 = {a = 1, b = 2.5}
// gdbr-check:$1 = by_value_non_immediate_argument::Struct {a: 1, b: 2.5}
// gdb-check:$1 = by_value_non_immediate_argument::Struct {a: 1, b: 2.5}
// gdb-command:continue

// gdb-command:print x
// gdbg-check:$2 = {a = 3, b = 4.5}
// gdbr-check:$2 = by_value_non_immediate_argument::Struct {a: 3, b: 4.5}
// gdb-check:$2 = by_value_non_immediate_argument::Struct {a: 3, b: 4.5}
// gdb-command:print y
// gdb-check:$3 = 5
// gdb-command:print z
// gdb-check:$4 = 6.5
// gdb-command:continue

// gdb-command:print a
// gdbg-check:$5 = {__0 = 7, __1 = 8, __2 = 9.5, __3 = 10.5}
// gdbr-check:$5 = (7, 8, 9.5, 10.5)
// gdb-check:$5 = (7, 8, 9.5, 10.5)
// gdb-command:continue

// gdb-command:print a
// gdbg-check:$6 = {__0 = 11.5, __1 = 12.5, __2 = 13, __3 = 14}
// gdbr-check:$6 = by_value_non_immediate_argument::Newtype (11.5, 12.5, 13, 14)
// gdb-check:$6 = by_value_non_immediate_argument::Newtype (11.5, 12.5, 13, 14)
// gdb-command:continue

// gdb-command:print x
// gdbg-check:$7 = {{RUST$ENUM$DISR = Case1, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = Case1, [...]}}
// gdbr-check:$7 = by_value_non_immediate_argument::Enum::Case1{x: 0, y: 8970181431921507452}
// gdb-check:$7 = by_value_non_immediate_argument::Enum::Case1{x: 0, y: 8970181431921507452}
// gdb-command:continue


17 changes: 5 additions & 12 deletions tests/debuginfo/by-value-self-argument-in-trait-impl.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -11,13 +9,11 @@
// gdb-command:continue

// gdb-command:print self
// gdbg-check:$2 = {x = 2222, y = 3333}
// gdbr-check:$2 = by_value_self_argument_in_trait_impl::Struct {x: 2222, y: 3333}
// gdb-check:$2 = by_value_self_argument_in_trait_impl::Struct {x: 2222, y: 3333}
// gdb-command:continue

// gdb-command:print self
// gdbg-check:$3 = {__0 = 4444.5, __1 = 5555, __2 = 6666, __3 = 7777.5}
// gdbr-check:$3 = (4444.5, 5555, 6666, 7777.5)
// gdb-check:$3 = (4444.5, 5555, 6666, 7777.5)
// gdb-command:continue


@@ -26,18 +22,15 @@
// lldb-command:run

// lldb-command:v self
// lldbg-check:[...] 1111
// lldbr-check:(isize) self = 1111
// lldb-check:[...] 1111
// lldb-command:continue

// lldb-command:v self
// lldbg-check:[...] { x = 2222 y = 3333 }
// lldbr-check:(by_value_self_argument_in_trait_impl::Struct) self = { x = 2222 y = 3333 }
// lldb-check:[...] { x = 2222 y = 3333 }
// lldb-command:continue

// lldb-command:v self
// lldbg-check:[...] { 0 = 4444.5 1 = 5555 2 = 6666 3 = 7777.5 }
// lldbr-check:((f64, isize, isize, f64)) self = { 0 = 4444.5 1 = 5555 2 = 6666 3 = 7777.5 }
// lldb-check:[...] { 0 = 4444.5 1 = 5555 2 = 6666 3 = 7777.5 }
// lldb-command:continue

#![feature(omit_gdb_pretty_printer_section)]
44 changes: 14 additions & 30 deletions tests/debuginfo/c-style-enum-in-composite.rs
Original file line number Diff line number Diff line change
@@ -1,70 +1,54 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================

// gdb-command:run

// gdb-command:print tuple_interior_padding
// gdbg-check:$1 = {__0 = 0, __1 = OneHundred}
// gdbr-check:$1 = (0, c_style_enum_in_composite::AnEnum::OneHundred)
// gdb-check:$1 = (0, c_style_enum_in_composite::AnEnum::OneHundred)

// gdb-command:print tuple_padding_at_end
// gdbg-check:$2 = {__0 = {__0 = 1, __1 = OneThousand}, __1 = 2}
// gdbr-check:$2 = ((1, c_style_enum_in_composite::AnEnum::OneThousand), 2)
// gdb-check:$2 = ((1, c_style_enum_in_composite::AnEnum::OneThousand), 2)

// gdb-command:print tuple_different_enums
// gdbg-check:$3 = {__0 = OneThousand, __1 = MountainView, __2 = OneMillion, __3 = Vienna}
// gdbr-check:$3 = (c_style_enum_in_composite::AnEnum::OneThousand, c_style_enum_in_composite::AnotherEnum::MountainView, c_style_enum_in_composite::AnEnum::OneMillion, c_style_enum_in_composite::AnotherEnum::Vienna)
// gdb-check:$3 = (c_style_enum_in_composite::AnEnum::OneThousand, c_style_enum_in_composite::AnotherEnum::MountainView, c_style_enum_in_composite::AnEnum::OneMillion, c_style_enum_in_composite::AnotherEnum::Vienna)

// gdb-command:print padded_struct
// gdbg-check:$4 = {a = 3, b = OneMillion, c = 4, d = Toronto, e = 5}
// gdbr-check:$4 = c_style_enum_in_composite::PaddedStruct {a: 3, b: c_style_enum_in_composite::AnEnum::OneMillion, c: 4, d: c_style_enum_in_composite::AnotherEnum::Toronto, e: 5}
// gdb-check:$4 = c_style_enum_in_composite::PaddedStruct {a: 3, b: c_style_enum_in_composite::AnEnum::OneMillion, c: 4, d: c_style_enum_in_composite::AnotherEnum::Toronto, e: 5}

// gdb-command:print packed_struct
// gdbg-check:$5 = {a = 6, b = OneHundred, c = 7, d = Vienna, e = 8}
// gdbr-check:$5 = c_style_enum_in_composite::PackedStruct {a: 6, b: c_style_enum_in_composite::AnEnum::OneHundred, c: 7, d: c_style_enum_in_composite::AnotherEnum::Vienna, e: 8}
// gdb-check:$5 = c_style_enum_in_composite::PackedStruct {a: 6, b: c_style_enum_in_composite::AnEnum::OneHundred, c: 7, d: c_style_enum_in_composite::AnotherEnum::Vienna, e: 8}

// gdb-command:print non_padded_struct
// gdbg-check:$6 = {a = OneMillion, b = MountainView, c = OneThousand, d = Toronto}
// gdbr-check:$6 = c_style_enum_in_composite::NonPaddedStruct {a: c_style_enum_in_composite::AnEnum::OneMillion, b: c_style_enum_in_composite::AnotherEnum::MountainView, c: c_style_enum_in_composite::AnEnum::OneThousand, d: c_style_enum_in_composite::AnotherEnum::Toronto}
// gdb-check:$6 = c_style_enum_in_composite::NonPaddedStruct {a: c_style_enum_in_composite::AnEnum::OneMillion, b: c_style_enum_in_composite::AnotherEnum::MountainView, c: c_style_enum_in_composite::AnEnum::OneThousand, d: c_style_enum_in_composite::AnotherEnum::Toronto}

// gdb-command:print struct_with_drop
// gdbg-check:$7 = {__0 = {a = OneHundred, b = Vienna}, __1 = 9}
// gdbr-check:$7 = (c_style_enum_in_composite::StructWithDrop {a: c_style_enum_in_composite::AnEnum::OneHundred, b: c_style_enum_in_composite::AnotherEnum::Vienna}, 9)
// gdb-check:$7 = (c_style_enum_in_composite::StructWithDrop {a: c_style_enum_in_composite::AnEnum::OneHundred, b: c_style_enum_in_composite::AnotherEnum::Vienna}, 9)

// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:v tuple_interior_padding
// lldbg-check:[...] { 0 = 0 1 = OneHundred }
// lldbr-check:((i16, c_style_enum_in_composite::AnEnum)) tuple_interior_padding = { 0 = 0 1 = OneHundred }
// lldb-check:[...] { 0 = 0 1 = OneHundred }

// lldb-command:v tuple_padding_at_end
// lldbg-check:[...] { 0 = { 0 = 1 1 = OneThousand } 1 = 2 }
// lldbr-check:(((u64, c_style_enum_in_composite::AnEnum), u64)) tuple_padding_at_end = { 0 = { 0 = 1 1 = OneThousand } 1 = 2 }
// lldb-check:[...] { 0 = { 0 = 1 1 = OneThousand } 1 = 2 }

// lldb-command:v tuple_different_enums
// lldbg-check:[...] { 0 = OneThousand 1 = MountainView 2 = OneMillion 3 = Vienna }
// lldbr-check:((c_style_enum_in_composite::AnEnum, c_style_enum_in_composite::AnotherEnum, c_style_enum_in_composite::AnEnum, c_style_enum_in_composite::AnotherEnum)) tuple_different_enums = { 0 = c_style_enum_in_composite::AnEnum::OneThousand 1 = c_style_enum_in_composite::AnotherEnum::MountainView 2 = c_style_enum_in_composite::AnEnum::OneMillion 3 = c_style_enum_in_composite::AnotherEnum::Vienna }
// lldb-check:[...] { 0 = OneThousand 1 = MountainView 2 = OneMillion 3 = Vienna }

// lldb-command:v padded_struct
// lldbg-check:[...] { a = 3 b = OneMillion c = 4 d = Toronto e = 5 }
// lldbr-check:(c_style_enum_in_composite::PaddedStruct) padded_struct = { a = 3 b = c_style_enum_in_composite::AnEnum::OneMillion c = 4 d = Toronto e = 5 }
// lldb-check:[...] { a = 3 b = OneMillion c = 4 d = Toronto e = 5 }

// lldb-command:v packed_struct
// lldbg-check:[...] { a = 6 b = OneHundred c = 7 d = Vienna e = 8 }
// lldbr-check:(c_style_enum_in_composite::PackedStruct) packed_struct = { a = 6 b = c_style_enum_in_composite::AnEnum::OneHundred c = 7 d = Vienna e = 8 }
// lldb-check:[...] { a = 6 b = OneHundred c = 7 d = Vienna e = 8 }

// lldb-command:v non_padded_struct
// lldbg-check:[...] { a = OneMillion b = MountainView c = OneThousand d = Toronto }
// lldbr-check:(c_style_enum_in_composite::NonPaddedStruct) non_padded_struct = { a = c_style_enum_in_composite::AnEnum::OneMillion, b = c_style_enum_in_composite::AnotherEnum::MountainView, c = c_style_enum_in_composite::AnEnum::OneThousand, d = c_style_enum_in_composite::AnotherEnum::Toronto }
// lldb-check:[...] { a = OneMillion b = MountainView c = OneThousand d = Toronto }

// lldb-command:v struct_with_drop
// lldbg-check:[...] { 0 = { a = OneHundred b = Vienna } 1 = 9 }
// lldbr-check:((c_style_enum_in_composite::StructWithDrop, i64)) struct_with_drop = { 0 = { a = c_style_enum_in_composite::AnEnum::OneHundred b = c_style_enum_in_composite::AnotherEnum::Vienna } 1 = 9 }
// lldb-check:[...] { 0 = { a = OneHundred b = Vienna } 1 = 9 }

#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
121 changes: 42 additions & 79 deletions tests/debuginfo/c-style-enum.rs
Original file line number Diff line number Diff line change
@@ -1,127 +1,90 @@
//@ ignore-aarch64
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================

// gdbg-command:print 'c_style_enum::SINGLE_VARIANT'
// gdbr-command:print c_style_enum::SINGLE_VARIANT
// gdbg-check:$1 = TheOnlyVariant
// gdbr-check:$1 = c_style_enum::SingleVariant::TheOnlyVariant

// gdbg-command:print 'c_style_enum::AUTO_ONE'
// gdbr-command:print c_style_enum::AUTO_ONE
// gdbg-check:$2 = One
// gdbr-check:$2 = c_style_enum::AutoDiscriminant::One

// gdbg-command:print 'c_style_enum::AUTO_TWO'
// gdbr-command:print c_style_enum::AUTO_TWO
// gdbg-check:$3 = One
// gdbr-check:$3 = c_style_enum::AutoDiscriminant::One

// gdbg-command:print 'c_style_enum::AUTO_THREE'
// gdbr-command:print c_style_enum::AUTO_THREE
// gdbg-check:$4 = One
// gdbr-check:$4 = c_style_enum::AutoDiscriminant::One

// gdbg-command:print 'c_style_enum::MANUAL_ONE'
// gdbr-command:print c_style_enum::MANUAL_ONE
// gdbg-check:$5 = OneHundred
// gdbr-check:$5 = c_style_enum::ManualDiscriminant::OneHundred

// gdbg-command:print 'c_style_enum::MANUAL_TWO'
// gdbr-command:print c_style_enum::MANUAL_TWO
// gdbg-check:$6 = OneHundred
// gdbr-check:$6 = c_style_enum::ManualDiscriminant::OneHundred

// gdbg-command:print 'c_style_enum::MANUAL_THREE'
// gdbr-command:print c_style_enum::MANUAL_THREE
// gdbg-check:$7 = OneHundred
// gdbr-check:$7 = c_style_enum::ManualDiscriminant::OneHundred
// gdb-command:print c_style_enum::SINGLE_VARIANT
// gdb-check:$1 = c_style_enum::SingleVariant::TheOnlyVariant

// gdb-command:print c_style_enum::AUTO_ONE
// gdb-check:$2 = c_style_enum::AutoDiscriminant::One

// gdb-command:print c_style_enum::AUTO_TWO
// gdb-check:$3 = c_style_enum::AutoDiscriminant::One

// gdb-command:print c_style_enum::AUTO_THREE
// gdb-check:$4 = c_style_enum::AutoDiscriminant::One

// gdb-command:print c_style_enum::MANUAL_ONE
// gdb-check:$5 = c_style_enum::ManualDiscriminant::OneHundred

// gdb-command:print c_style_enum::MANUAL_TWO
// gdb-check:$6 = c_style_enum::ManualDiscriminant::OneHundred

// gdb-command:print c_style_enum::MANUAL_THREE
// gdb-check:$7 = c_style_enum::ManualDiscriminant::OneHundred

// gdb-command:run

// gdb-command:print auto_one
// gdbg-check:$8 = One
// gdbr-check:$8 = c_style_enum::AutoDiscriminant::One
// gdb-check:$8 = c_style_enum::AutoDiscriminant::One

// gdb-command:print auto_two
// gdbg-check:$9 = Two
// gdbr-check:$9 = c_style_enum::AutoDiscriminant::Two
// gdb-check:$9 = c_style_enum::AutoDiscriminant::Two

// gdb-command:print auto_three
// gdbg-check:$10 = Three
// gdbr-check:$10 = c_style_enum::AutoDiscriminant::Three
// gdb-check:$10 = c_style_enum::AutoDiscriminant::Three

// gdb-command:print manual_one_hundred
// gdbg-check:$11 = OneHundred
// gdbr-check:$11 = c_style_enum::ManualDiscriminant::OneHundred
// gdb-check:$11 = c_style_enum::ManualDiscriminant::OneHundred

// gdb-command:print manual_one_thousand
// gdbg-check:$12 = OneThousand
// gdbr-check:$12 = c_style_enum::ManualDiscriminant::OneThousand
// gdb-check:$12 = c_style_enum::ManualDiscriminant::OneThousand

// gdb-command:print manual_one_million
// gdbg-check:$13 = OneMillion
// gdbr-check:$13 = c_style_enum::ManualDiscriminant::OneMillion
// gdb-check:$13 = c_style_enum::ManualDiscriminant::OneMillion

// gdb-command:print single_variant
// gdbg-check:$14 = TheOnlyVariant
// gdbr-check:$14 = c_style_enum::SingleVariant::TheOnlyVariant
// gdb-check:$14 = c_style_enum::SingleVariant::TheOnlyVariant

// gdbg-command:print 'c_style_enum::AUTO_TWO'
// gdbr-command:print AUTO_TWO
// gdbg-check:$15 = Two
// gdbr-check:$15 = c_style_enum::AutoDiscriminant::Two
// gdb-command:print AUTO_TWO
// gdb-check:$15 = c_style_enum::AutoDiscriminant::Two

// gdbg-command:print 'c_style_enum::AUTO_THREE'
// gdbr-command:print AUTO_THREE
// gdbg-check:$16 = Three
// gdbr-check:$16 = c_style_enum::AutoDiscriminant::Three
// gdb-command:print AUTO_THREE
// gdb-check:$16 = c_style_enum::AutoDiscriminant::Three

// gdbg-command:print 'c_style_enum::MANUAL_TWO'
// gdbr-command:print MANUAL_TWO
// gdbg-check:$17 = OneThousand
// gdbr-check:$17 = c_style_enum::ManualDiscriminant::OneThousand
// gdb-command:print MANUAL_TWO
// gdb-check:$17 = c_style_enum::ManualDiscriminant::OneThousand

// gdbg-command:print 'c_style_enum::MANUAL_THREE'
// gdbr-command:print MANUAL_THREE
// gdbg-check:$18 = OneMillion
// gdbr-check:$18 = c_style_enum::ManualDiscriminant::OneMillion
// gdb-command:print MANUAL_THREE
// gdb-check:$18 = c_style_enum::ManualDiscriminant::OneMillion


// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:v auto_one
// lldbg-check:[...] One
// lldbr-check:(c_style_enum::AutoDiscriminant) auto_one = c_style_enum::AutoDiscriminant::One
// lldb-check:[...] One

// lldb-command:v auto_two
// lldbg-check:[...] Two
// lldbr-check:(c_style_enum::AutoDiscriminant) auto_two = c_style_enum::AutoDiscriminant::Two
// lldb-check:[...] Two

// lldb-command:v auto_three
// lldbg-check:[...] Three
// lldbr-check:(c_style_enum::AutoDiscriminant) auto_three = c_style_enum::AutoDiscriminant::Three
// lldb-check:[...] Three

// lldb-command:v manual_one_hundred
// lldbg-check:[...] OneHundred
// lldbr-check:(c_style_enum::ManualDiscriminant) manual_one_hundred = c_style_enum::ManualDiscriminant::OneHundred
// lldb-check:[...] OneHundred

// lldb-command:v manual_one_thousand
// lldbg-check:[...] OneThousand
// lldbr-check:(c_style_enum::ManualDiscriminant) manual_one_thousand = c_style_enum::ManualDiscriminant::OneThousand
// lldb-check:[...] OneThousand

// lldb-command:v manual_one_million
// lldbg-check:[...] OneMillion
// lldbr-check:(c_style_enum::ManualDiscriminant) manual_one_million = c_style_enum::ManualDiscriminant::OneMillion
// lldb-check:[...] OneMillion

// lldb-command:v single_variant
// lldbg-check:[...] TheOnlyVariant
// lldbr-check:(c_style_enum::SingleVariant) single_variant = c_style_enum::SingleVariant::TheOnlyVariant
// lldb-check:[...] TheOnlyVariant

#![allow(unused_variables)]
#![allow(dead_code)]
24 changes: 12 additions & 12 deletions tests/debuginfo/captured-fields-1.rs
Original file line number Diff line number Diff line change
@@ -4,44 +4,44 @@

// gdb-command:run
// gdb-command:print test
// gdbr-check:$1 = captured_fields_1::main::{closure_env#0} {_ref__my_ref__my_field1: 0x[...]}
// gdb-check:$1 = captured_fields_1::main::{closure_env#0} {_ref__my_ref__my_field1: 0x[...]}
// gdb-command:continue
// gdb-command:print test
// gdbr-check:$2 = captured_fields_1::main::{closure_env#1} {_ref__my_ref__my_field2: 0x[...]}
// gdb-check:$2 = captured_fields_1::main::{closure_env#1} {_ref__my_ref__my_field2: 0x[...]}
// gdb-command:continue
// gdb-command:print test
// gdbr-check:$3 = captured_fields_1::main::{closure_env#2} {_ref__my_ref: 0x[...]}
// gdb-check:$3 = captured_fields_1::main::{closure_env#2} {_ref__my_ref: 0x[...]}
// gdb-command:continue
// gdb-command:print test
// gdbr-check:$4 = captured_fields_1::main::{closure_env#3} {my_ref: 0x[...]}
// gdb-check:$4 = captured_fields_1::main::{closure_env#3} {my_ref: 0x[...]}
// gdb-command:continue
// gdb-command:print test
// gdbr-check:$5 = captured_fields_1::main::{closure_env#4} {my_var__my_field2: 22}
// gdb-check:$5 = captured_fields_1::main::{closure_env#4} {my_var__my_field2: 22}
// gdb-command:continue
// gdb-command:print test
// gdbr-check:$6 = captured_fields_1::main::{closure_env#5} {my_var: captured_fields_1::MyStruct {my_field1: 11, my_field2: 22}}
// gdb-check:$6 = captured_fields_1::main::{closure_env#5} {my_var: captured_fields_1::MyStruct {my_field1: 11, my_field2: 22}}
// gdb-command:continue

// === LLDB TESTS ==================================================================================

// lldb-command:run
// lldb-command:v test
// lldbg-check:(captured_fields_1::main::{closure_env#0}) test = { _ref__my_ref__my_field1 = 0x[...] }
// lldb-check:(captured_fields_1::main::{closure_env#0}) test = { _ref__my_ref__my_field1 = 0x[...] }
// lldb-command:continue
// lldb-command:v test
// lldbg-check:(captured_fields_1::main::{closure_env#1}) test = { _ref__my_ref__my_field2 = 0x[...] }
// lldb-check:(captured_fields_1::main::{closure_env#1}) test = { _ref__my_ref__my_field2 = 0x[...] }
// lldb-command:continue
// lldb-command:v test
// lldbg-check:(captured_fields_1::main::{closure_env#2}) test = { _ref__my_ref = 0x[...] }
// lldb-check:(captured_fields_1::main::{closure_env#2}) test = { _ref__my_ref = 0x[...] }
// lldb-command:continue
// lldb-command:v test
// lldbg-check:(captured_fields_1::main::{closure_env#3}) test = { my_ref = 0x[...] }
// lldb-check:(captured_fields_1::main::{closure_env#3}) test = { my_ref = 0x[...] }
// lldb-command:continue
// lldb-command:v test
// lldbg-check:(captured_fields_1::main::{closure_env#4}) test = { my_var__my_field2 = 22 }
// lldb-check:(captured_fields_1::main::{closure_env#4}) test = { my_var__my_field2 = 22 }
// lldb-command:continue
// lldb-command:v test
// lldbg-check:(captured_fields_1::main::{closure_env#5}) test = { my_var = { my_field1 = 11 my_field2 = 22 } }
// lldb-check:(captured_fields_1::main::{closure_env#5}) test = { my_var = { my_field1 = 11 my_field2 = 22 } }
// lldb-command:continue

#![allow(unused)]
8 changes: 4 additions & 4 deletions tests/debuginfo/captured-fields-2.rs
Original file line number Diff line number Diff line change
@@ -4,20 +4,20 @@

// gdb-command:run
// gdb-command:print my_ref__my_field1
// gdbr-check:$1 = 11
// gdb-check:$1 = 11
// gdb-command:continue
// gdb-command:print my_var__my_field2
// gdbr-check:$2 = 22
// gdb-check:$2 = 22
// gdb-command:continue

// === LLDB TESTS ==================================================================================

// lldb-command:run
// lldb-command:v my_ref__my_field1
// lldbg-check:(unsigned int) my_ref__my_field1 = 11
// lldb-check:(unsigned int) my_ref__my_field1 = 11
// lldb-command:continue
// lldb-command:v my_var__my_field2
// lldbg-check:(unsigned int) my_var__my_field2 = 22
// lldb-check:(unsigned int) my_var__my_field2 = 22
// lldb-command:continue

#![allow(unused)]
14 changes: 4 additions & 10 deletions tests/debuginfo/closure-in-generic-function.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -24,19 +22,15 @@
// lldb-command:run

// lldb-command:v x
// lldbg-check:[...] 0.5
// lldbr-check:(f64) x = 0.5
// lldb-check:[...] 0.5
// lldb-command:v y
// lldbg-check:[...] 10
// lldbr-check:(i32) y = 10
// lldb-check:[...] 10
// lldb-command:continue

// lldb-command:v *x
// lldbg-check:[...] 29
// lldbr-check:(i32) *x = 29
// lldb-check:[...] 29
// lldb-command:v *y
// lldbg-check:[...] 110
// lldbr-check:(i32) *y = 110
// lldb-check:[...] 110
// lldb-command:continue

#![feature(omit_gdb_pretty_printer_section)]
2 changes: 0 additions & 2 deletions tests/debuginfo/constant-debug-locs.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

#![allow(dead_code, unused_variables)]
2 changes: 0 additions & 2 deletions tests/debuginfo/constant-in-match-pattern.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

#![allow(dead_code, unused_variables)]
2 changes: 0 additions & 2 deletions tests/debuginfo/coroutine-locals.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
2 changes: 0 additions & 2 deletions tests/debuginfo/coroutine-objects.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Require a gdb that can read DW_TAG_variant_part.
//@ min-gdb-version: 8.2
//@ min-lldb-version: 1800

// LLDB (18.1+) now supports DW_TAG_variant_part, but there is some bug in either compiler or LLDB
26 changes: 8 additions & 18 deletions tests/debuginfo/cross-crate-spans.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#![feature(omit_gdb_pretty_printer_section)]
#![omit_gdb_pretty_printer_section]

//@ min-lldb-version: 310

//@ aux-build:cross_crate_spans.rs
extern crate cross_crate_spans;

@@ -15,17 +13,15 @@ extern crate cross_crate_spans;
// gdb-command:run

// gdb-command:print result
// gdbg-check:$1 = {__0 = 17, __1 = 17}
// gdbr-check:$1 = (17, 17)
// gdb-check:$1 = (17, 17)
// gdb-command:print a_variable
// gdb-check:$2 = 123456789
// gdb-command:print another_variable
// gdb-check:$3 = 123456789.5
// gdb-command:continue

// gdb-command:print result
// gdbg-check:$4 = {__0 = 1212, __1 = 1212}
// gdbr-check:$4 = (1212, 1212)
// gdb-check:$4 = (1212, 1212)
// gdb-command:print a_variable
// gdb-check:$5 = 123456789
// gdb-command:print another_variable
@@ -40,25 +36,19 @@ extern crate cross_crate_spans;
// lldb-command:run

// lldb-command:v result
// lldbg-check:[...] { 0 = 17 1 = 17 }
// lldbr-check:((u32, u32)) result = { 0 = 17 1 = 17 }
// lldb-check:[...] { 0 = 17 1 = 17 }
// lldb-command:v a_variable
// lldbg-check:[...] 123456789
// lldbr-check:(u32) a_variable = 123456789
// lldb-check:[...] 123456789
// lldb-command:v another_variable
// lldbg-check:[...] 123456789.5
// lldbr-check:(f64) another_variable = 123456789.5
// lldb-check:[...] 123456789.5
// lldb-command:continue

// lldb-command:v result
// lldbg-check:[...] { 0 = 1212 1 = 1212 }
// lldbr-check:((i16, i16)) result = { 0 = 1212 1 = 1212 }
// lldb-check:[...] { 0 = 1212 1 = 1212 }
// lldb-command:v a_variable
// lldbg-check:[...] 123456789
// lldbr-check:(u32) a_variable = 123456789
// lldb-check:[...] 123456789
// lldb-command:v another_variable
// lldbg-check:[...] 123456789.5
// lldbr-check:(f64) another_variable = 123456789.5
// lldb-check:[...] 123456789.5
// lldb-command:continue


2 changes: 0 additions & 2 deletions tests/debuginfo/cross-crate-type-uniquing.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ aux-build:cross_crate_debuginfo_type_uniquing.rs
extern crate cross_crate_debuginfo_type_uniquing;

173 changes: 57 additions & 116 deletions tests/debuginfo/destructured-fn-argument.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -23,15 +21,13 @@
// gdb-command:print a
// gdb-check:$6 = 5
// gdb-command:print b
// gdbg-check:$7 = {__0 = 6, __1 = 7}
// gdbr-check:$7 = (6, 7)
// gdb-check:$7 = (6, 7)
// gdb-command:continue

// gdb-command:print h
// gdb-check:$8 = 8
// gdb-command:print i
// gdbg-check:$9 = {a = 9, b = 10}
// gdbr-check:$9 = destructured_fn_argument::Struct {a: 9, b: 10}
// gdb-check:$9 = destructured_fn_argument::Struct {a: 9, b: 10}
// gdb-command:print j
// gdb-check:$10 = 11
// gdb-command:continue
@@ -57,8 +53,7 @@
// gdb-command:print q
// gdb-check:$17 = 20
// gdb-command:print r
// gdbg-check:$18 = {a = 21, b = 22}
// gdbr-check:$18 = destructured_fn_argument::Struct {a: 21, b: 22}
// gdb-check:$18 = destructured_fn_argument::Struct {a: 21, b: 22}
// gdb-command:continue

// gdb-command:print s
@@ -88,34 +83,29 @@
// gdb-command:continue

// gdb-command:print aa
// gdbg-check:$30 = {__0 = 34, __1 = 35}
// gdbr-check:$30 = (34, 35)
// gdb-check:$30 = (34, 35)
// gdb-command:continue

// gdb-command:print bb
// gdbg-check:$31 = {__0 = 36, __1 = 37}
// gdbr-check:$31 = (36, 37)
// gdb-check:$31 = (36, 37)
// gdb-command:continue

// gdb-command:print cc
// gdb-check:$32 = 38
// gdb-command:continue

// gdb-command:print dd
// gdbg-check:$33 = {__0 = 40, __1 = 41, __2 = 42}
// gdbr-check:$33 = (40, 41, 42)
// gdb-check:$33 = (40, 41, 42)
// gdb-command:continue

// gdb-command:print *ee
// gdbg-check:$34 = {__0 = 43, __1 = 44, __2 = 45}
// gdbr-check:$34 = (43, 44, 45)
// gdb-check:$34 = (43, 44, 45)
// gdb-command:continue

// gdb-command:print *ff
// gdb-check:$35 = 46
// gdb-command:print gg
// gdbg-check:$36 = {__0 = 47, __1 = 48}
// gdbr-check:$36 = (47, 48)
// gdb-check:$36 = (47, 48)
// gdb-command:continue

// gdb-command:print *hh
@@ -164,196 +154,147 @@
// lldb-command:run

// lldb-command:v a
// lldbg-check:[...] 1
// lldbr-check:(isize) a = 1
// lldb-check:[...] 1
// lldb-command:v b
// lldbg-check:[...] false
// lldbr-check:(bool) b = false
// lldb-check:[...] false
// lldb-command:continue

// lldb-command:v a
// lldbg-check:[...] 2
// lldbr-check:(isize) a = 2
// lldb-check:[...] 2
// lldb-command:v b
// lldbg-check:[...] 3
// lldbr-check:(u16) b = 3
// lldb-check:[...] 3
// lldb-command:v c
// lldbg-check:[...] 4
// lldbr-check:(u16) c = 4
// lldb-check:[...] 4
// lldb-command:continue

// lldb-command:v a
// lldbg-check:[...] 5
// lldbr-check:(isize) a = 5
// lldb-check:[...] 5
// lldb-command:v b
// lldbg-check:[...] { 0 = 6 1 = 7 }
// lldbr-check:((u32, u32)) b = { 0 = 6 1 = 7 }
// lldb-check:[...] { 0 = 6 1 = 7 }
// lldb-command:continue

// lldb-command:v h
// lldbg-check:[...] 8
// lldbr-check:(i16) h = 8
// lldb-check:[...] 8
// lldb-command:v i
// lldbg-check:[...] { a = 9 b = 10 }
// lldbr-check:(destructured_fn_argument::Struct) i = { a = 9 b = 10 }
// lldb-check:[...] { a = 9 b = 10 }
// lldb-command:v j
// lldbg-check:[...] 11
// lldbr-check:(i16) j = 11
// lldb-check:[...] 11
// lldb-command:continue

// lldb-command:v k
// lldbg-check:[...] 12
// lldbr-check:(i64) k = 12
// lldb-check:[...] 12
// lldb-command:v l
// lldbg-check:[...] 13
// lldbr-check:(i32) l = 13
// lldb-check:[...] 13
// lldb-command:continue

// lldb-command:v m
// lldbg-check:[...] 14
// lldbr-check:(isize) m = 14
// lldb-check:[...] 14
// lldb-command:v n
// lldbg-check:[...] 16
// lldbr-check:(i32) n = 16
// lldb-check:[...] 16
// lldb-command:continue

// lldb-command:v o
// lldbg-check:[...] 18
// lldbr-check:(i32) o = 18
// lldb-check:[...] 18
// lldb-command:continue

// lldb-command:v p
// lldbg-check:[...] 19
// lldbr-check:(i64) p = 19
// lldb-check:[...] 19
// lldb-command:v q
// lldbg-check:[...] 20
// lldbr-check:(i32) q = 20
// lldb-check:[...] 20
// lldb-command:v r
// lldbg-check:[...] { a = 21 b = 22 }
// lldbr-check:(destructured_fn_argument::Struct) r = { a = 21, b = 22 }
// lldb-check:[...] { a = 21 b = 22 }
// lldb-command:continue

// lldb-command:v s
// lldbg-check:[...] 24
// lldbr-check:(i32) s = 24
// lldb-check:[...] 24
// lldb-command:v t
// lldbg-check:[...] 23
// lldbr-check:(i64) t = 23
// lldb-check:[...] 23
// lldb-command:continue

// lldb-command:v u
// lldbg-check:[...] 25
// lldbr-check:(i16) u = 25
// lldb-check:[...] 25
// lldb-command:v v
// lldbg-check:[...] 26
// lldbr-check:(i32) v = 26
// lldb-check:[...] 26
// lldb-command:v w
// lldbg-check:[...] 27
// lldbr-check:(i64) w = 27
// lldb-check:[...] 27
// lldb-command:v x
// lldbg-check:[...] 28
// lldbr-check:(i32) x = 28
// lldb-check:[...] 28
// lldb-command:v y
// lldbg-check:[...] 29
// lldbr-check:(i64) y = 29
// lldb-check:[...] 29
// lldb-command:v z
// lldbg-check:[...] 30
// lldbr-check:(i32) z = 30
// lldb-check:[...] 30
// lldb-command:v ae
// lldbg-check:[...] 31
// lldbr-check:(i64) ae = 31
// lldb-check:[...] 31
// lldb-command:v oe
// lldbg-check:[...] 32
// lldbr-check:(i32) oe = 32
// lldb-check:[...] 32
// lldb-command:v ue
// lldbg-check:[...] 33
// lldbr-check:(u16) ue = 33
// lldb-check:[...] 33
// lldb-command:continue

// lldb-command:v aa
// lldbg-check:[...] { 0 = 34 1 = 35 }
// lldbr-check:((isize, isize)) aa = { 0 = 34 1 = 35 }
// lldb-check:[...] { 0 = 34 1 = 35 }
// lldb-command:continue

// lldb-command:v bb
// lldbg-check:[...] { 0 = 36 1 = 37 }
// lldbr-check:((isize, isize)) bb = { 0 = 36 1 = 37 }
// lldb-check:[...] { 0 = 36 1 = 37 }
// lldb-command:continue

// lldb-command:v cc
// lldbg-check:[...] 38
// lldbr-check:(isize) cc = 38
// lldb-check:[...] 38
// lldb-command:continue

// lldb-command:v dd
// lldbg-check:[...] { 0 = 40 1 = 41 2 = 42 }
// lldbr-check:((isize, isize, isize)) dd = { 0 = 40 1 = 41 2 = 42 }
// lldb-check:[...] { 0 = 40 1 = 41 2 = 42 }
// lldb-command:continue

// lldb-command:v *ee
// lldbg-check:[...] { 0 = 43 1 = 44 2 = 45 }
// lldbr-check:((isize, isize, isize)) *ee = { 0 = 43 1 = 44 2 = 45 }
// lldb-check:[...] { 0 = 43 1 = 44 2 = 45 }
// lldb-command:continue

// lldb-command:v *ff
// lldbg-check:[...] 46
// lldbr-check:(isize) *ff = 46
// lldb-check:[...] 46
// lldb-command:v gg
// lldbg-check:[...] { 0 = 47 1 = 48 }
// lldbr-check:((isize, isize)) gg = { 0 = 47 1 = 48 }
// lldb-check:[...] { 0 = 47 1 = 48 }
// lldb-command:continue

// lldb-command:v *hh
// lldbg-check:[...] 50
// lldbr-check:(i32) *hh = 50
// lldb-check:[...] 50
// lldb-command:continue

// lldb-command:v ii
// lldbg-check:[...] 51
// lldbr-check:(i32) ii = 51
// lldb-check:[...] 51
// lldb-command:continue

// lldb-command:v *jj
// lldbg-check:[...] 52
// lldbr-check:(i32) *jj = 52
// lldb-check:[...] 52
// lldb-command:continue

// lldb-command:v kk
// lldbg-check:[...] 53
// lldbr-check:(f64) kk = 53
// lldb-check:[...] 53
// lldb-command:v ll
// lldbg-check:[...] 54
// lldbr-check:(isize) ll = 54
// lldb-check:[...] 54
// lldb-command:continue

// lldb-command:v mm
// lldbg-check:[...] 55
// lldbr-check:(f64) mm = 55
// lldb-check:[...] 55
// lldb-command:v *nn
// lldbg-check:[...] 56
// lldbr-check:(isize) *nn = 56
// lldb-check:[...] 56
// lldb-command:continue

// lldb-command:v oo
// lldbg-check:[...] 57
// lldbr-check:(isize) oo = 57
// lldb-check:[...] 57
// lldb-command:v pp
// lldbg-check:[...] 58
// lldbr-check:(isize) pp = 58
// lldb-check:[...] 58
// lldb-command:v qq
// lldbg-check:[...] 59
// lldbr-check:(isize) qq = 59
// lldb-check:[...] 59
// lldb-command:continue

// lldb-command:v rr
// lldbg-check:[...] 60
// lldbr-check:(isize) rr = 60
// lldb-check:[...] 60
// lldb-command:v ss
// lldbg-check:[...] 61
// lldbr-check:(isize) ss = 61
// lldb-check:[...] 61
// lldb-command:v tt
// lldbg-check:[...] 62
// lldbr-check:(isize) tt = 62
// lldb-check:[...] 62
// lldb-command:continue

#![allow(unused_variables)]
80 changes: 26 additions & 54 deletions tests/debuginfo/destructured-for-loop-variable.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -63,13 +61,11 @@
// gdb-command:continue

// gdb-command:print simple_struct_ident
// gdbg-check:$23 = {x = 3537, y = 35437.5, z = true}
// gdbr-check:$23 = destructured_for_loop_variable::Struct {x: 3537, y: 35437.5, z: true}
// gdb-check:$23 = destructured_for_loop_variable::Struct {x: 3537, y: 35437.5, z: true}
// gdb-command:continue

// gdb-command:print simple_tuple_ident
// gdbg-check:$24 = {__0 = 34903493, __1 = 232323}
// gdbr-check:$24 = (34903493, 232323)
// gdb-check:$24 = (34903493, 232323)
// gdb-command:continue

// === LLDB TESTS ==================================================================================
@@ -81,90 +77,66 @@

// DESTRUCTURED STRUCT
// lldb-command:v x
// lldbg-check:[...] 400
// lldbr-check:(i16) x = 400
// lldb-check:[...] 400
// lldb-command:v y
// lldbg-check:[...] 401.5
// lldbr-check:(f32) y = 401.5
// lldb-check:[...] 401.5
// lldb-command:v z
// lldbg-check:[...] true
// lldbr-check:(bool) z = true
// lldb-check:[...] true
// lldb-command:continue

// DESTRUCTURED TUPLE
// lldb-command:v _i8
// lldbg-check:[...] 0x6f
// lldbr-check:(i8) _i8 = 111
// lldb-check:[...] 0x6f
// lldb-command:v _u8
// lldbg-check:[...] 0x70
// lldbr-check:(u8) _u8 = 112
// lldb-check:[...] 0x70
// lldb-command:v _i16
// lldbg-check:[...] -113
// lldbr-check:(i16) _i16 = -113
// lldb-check:[...] -113
// lldb-command:v _u16
// lldbg-check:[...] 114
// lldbr-check:(u16) _u16 = 114
// lldb-check:[...] 114
// lldb-command:v _i32
// lldbg-check:[...] -115
// lldbr-check:(i32) _i32 = -115
// lldb-check:[...] -115
// lldb-command:v _u32
// lldbg-check:[...] 116
// lldbr-check:(u32) _u32 = 116
// lldb-check:[...] 116
// lldb-command:v _i64
// lldbg-check:[...] -117
// lldbr-check:(i64) _i64 = -117
// lldb-check:[...] -117
// lldb-command:v _u64
// lldbg-check:[...] 118
// lldbr-check:(u64) _u64 = 118
// lldb-check:[...] 118
// lldb-command:v _f32
// lldbg-check:[...] 119.5
// lldbr-check:(f32) _f32 = 119.5
// lldb-check:[...] 119.5
// lldb-command:v _f64
// lldbg-check:[...] 120.5
// lldbr-check:(f64) _f64 = 120.5
// lldb-check:[...] 120.5
// lldb-command:continue

// MORE COMPLEX CASE
// lldb-command:v v1
// lldbg-check:[...] 80000
// lldbr-check:(i32) v1 = 80000
// lldb-check:[...] 80000
// lldb-command:v x1
// lldbg-check:[...] 8000
// lldbr-check:(i16) x1 = 8000
// lldb-check:[...] 8000
// lldb-command:v *y1
// lldbg-check:[...] 80001.5
// lldbr-check:(f32) *y1 = 80001.5
// lldb-check:[...] 80001.5
// lldb-command:v z1
// lldbg-check:[...] false
// lldbr-check:(bool) z1 = false
// lldb-check:[...] false
// lldb-command:v *x2
// lldbg-check:[...] -30000
// lldbr-check:(i16) *x2 = -30000
// lldb-check:[...] -30000
// lldb-command:v y2
// lldbg-check:[...] -300001.5
// lldbr-check:(f32) y2 = -300001.5
// lldb-check:[...] -300001.5
// lldb-command:v *z2
// lldbg-check:[...] true
// lldbr-check:(bool) *z2 = true
// lldb-check:[...] true
// lldb-command:v v2
// lldbg-check:[...] 854237.5
// lldbr-check:(f64) v2 = 854237.5
// lldb-check:[...] 854237.5
// lldb-command:continue

// SIMPLE IDENTIFIER
// lldb-command:v i
// lldbg-check:[...] 1234
// lldbr-check:(i32) i = 1234
// lldb-check:[...] 1234
// lldb-command:continue

// lldb-command:v simple_struct_ident
// lldbg-check:[...] { x = 3537 y = 35437.5 z = true }
// lldbr-check:(destructured_for_loop_variable::Struct) simple_struct_ident = { x = 3537 y = 35437.5 z = true }
// lldb-check:[...] { x = 3537 y = 35437.5 z = true }
// lldb-command:continue

// lldb-command:v simple_tuple_ident
// lldbg-check:[...] { 0 = 34903493 1 = 232323 }
// lldbr-check:((u32, i64)) simple_tuple_ident = { 0 = 34903493 1 = 232323 }
// lldb-check:[...] { 0 = 34903493 1 = 232323 }
// lldb-command:continue

#![allow(unused_variables)]
155 changes: 51 additions & 104 deletions tests/debuginfo/destructured-local.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -21,14 +19,12 @@
// gdb-command:print f
// gdb-check:$6 = 5
// gdb-command:print g
// gdbg-check:$7 = {__0 = 6, __1 = 7}
// gdbr-check:$7 = (6, 7)
// gdb-check:$7 = (6, 7)

// gdb-command:print h
// gdb-check:$8 = 8
// gdb-command:print i
// gdbg-check:$9 = {a = 9, b = 10}
// gdbr-check:$9 = destructured_local::Struct {a: 9, b: 10}
// gdb-check:$9 = destructured_local::Struct {a: 9, b: 10}
// gdb-command:print j
// gdb-check:$10 = 11

@@ -50,8 +46,7 @@
// gdb-command:print q
// gdb-check:$17 = 20
// gdb-command:print r
// gdbg-check:$18 = {a = 21, b = 22}
// gdbr-check:$18 = destructured_local::Struct {a: 21, b: 22}
// gdb-check:$18 = destructured_local::Struct {a: 21, b: 22}

// gdb-command:print s
// gdb-check:$19 = 24
@@ -78,30 +73,25 @@
// gdb-check:$29 = 33

// gdb-command:print aa
// gdbg-check:$30 = {__0 = 34, __1 = 35}
// gdbr-check:$30 = (34, 35)
// gdb-check:$30 = (34, 35)

// gdb-command:print bb
// gdbg-check:$31 = {__0 = 36, __1 = 37}
// gdbr-check:$31 = (36, 37)
// gdb-check:$31 = (36, 37)

// gdb-command:print cc
// gdb-check:$32 = 38

// gdb-command:print dd
// gdbg-check:$33 = {__0 = 40, __1 = 41, __2 = 42}
// gdbr-check:$33 = (40, 41, 42)
// gdb-check:$33 = (40, 41, 42)

// gdb-command:print *ee
// gdbg-check:$34 = {__0 = 43, __1 = 44, __2 = 45}
// gdbr-check:$34 = (43, 44, 45)
// gdb-check:$34 = (43, 44, 45)

// gdb-command:print *ff
// gdb-check:$35 = 46

// gdb-command:print gg
// gdbg-check:$36 = {__0 = 47, __1 = 48}
// gdbr-check:$36 = (47, 48)
// gdb-check:$36 = (47, 48)

// gdb-command:print *hh
// gdb-check:$37 = 50
@@ -130,157 +120,114 @@
// lldb-command:run

// lldb-command:v a
// lldbg-check:[...] 1
// lldbr-check:(isize) a = 1
// lldb-check:[...] 1
// lldb-command:v b
// lldbg-check:[...] false
// lldbr-check:(bool) b = false
// lldb-check:[...] false

// lldb-command:v c
// lldbg-check:[...] 2
// lldbr-check:(isize) c = 2
// lldb-check:[...] 2
// lldb-command:v d
// lldbg-check:[...] 3
// lldbr-check:(u16) d = 3
// lldb-check:[...] 3
// lldb-command:v e
// lldbg-check:[...] 4
// lldbr-check:(u16) e = 4
// lldb-check:[...] 4

// lldb-command:v f
// lldbg-check:[...] 5
// lldbr-check:(isize) f = 5
// lldb-check:[...] 5
// lldb-command:v g
// lldbg-check:[...] { 0 = 6 1 = 7 }
// lldbr-check:((u32, u32)) g = { 0 = 6 1 = 7 }
// lldb-check:[...] { 0 = 6 1 = 7 }

// lldb-command:v h
// lldbg-check:[...] 8
// lldbr-check:(i16) h = 8
// lldb-check:[...] 8
// lldb-command:v i
// lldbg-check:[...] { a = 9 b = 10 }
// lldbr-check:(destructured_local::Struct) i = { a = 9 b = 10 }
// lldb-check:[...] { a = 9 b = 10 }
// lldb-command:v j
// lldbg-check:[...] 11
// lldbr-check:(i16) j = 11
// lldb-check:[...] 11

// lldb-command:v k
// lldbg-check:[...] 12
// lldbr-check:(i64) k = 12
// lldb-check:[...] 12
// lldb-command:v l
// lldbg-check:[...] 13
// lldbr-check:(i32) l = 13
// lldb-check:[...] 13

// lldb-command:v m
// lldbg-check:[...] 14
// lldbr-check:(i32) m = 14
// lldb-check:[...] 14
// lldb-command:v n
// lldbg-check:[...] 16
// lldbr-check:(i32) n = 16
// lldb-check:[...] 16

// lldb-command:v o
// lldbg-check:[...] 18
// lldbr-check:(i32) o = 18
// lldb-check:[...] 18

// lldb-command:v p
// lldbg-check:[...] 19
// lldbr-check:(i64) p = 19
// lldb-check:[...] 19
// lldb-command:v q
// lldbg-check:[...] 20
// lldbr-check:(i32) q = 20
// lldb-check:[...] 20
// lldb-command:v r
// lldbg-check:[...] { a = 21 b = 22 }
// lldbr-check:(destructured_local::Struct) r = { a = 21 b = 22 }
// lldb-check:[...] { a = 21 b = 22 }

// lldb-command:v s
// lldbg-check:[...] 24
// lldbr-check:(i32) s = 24
// lldb-check:[...] 24
// lldb-command:v t
// lldbg-check:[...] 23
// lldbr-check:(i64) t = 23
// lldb-check:[...] 23

// lldb-command:v u
// lldbg-check:[...] 25
// lldbr-check:(i32) u = 25
// lldb-check:[...] 25
// lldb-command:v v
// lldbg-check:[...] 26
// lldbr-check:(i32) v = 26
// lldb-check:[...] 26
// lldb-command:v w
// lldbg-check:[...] 27
// lldbr-check:(i32) w = 27
// lldb-check:[...] 27
// lldb-command:v x
// lldbg-check:[...] 28
// lldbr-check:(i32) x = 28
// lldb-check:[...] 28
// lldb-command:v y
// lldbg-check:[...] 29
// lldbr-check:(i64) y = 29
// lldb-check:[...] 29
// lldb-command:v z
// lldbg-check:[...] 30
// lldbr-check:(i32) z = 30
// lldb-check:[...] 30
// lldb-command:v ae
// lldbg-check:[...] 31
// lldbr-check:(i64) ae = 31
// lldb-check:[...] 31
// lldb-command:v oe
// lldbg-check:[...] 32
// lldbr-check:(i32) oe = 32
// lldb-check:[...] 32
// lldb-command:v ue
// lldbg-check:[...] 33
// lldbr-check:(i32) ue = 33
// lldb-check:[...] 33

// lldb-command:v aa
// lldbg-check:[...] { 0 = 34 1 = 35 }
// lldbr-check:((i32, i32)) aa = { 0 = 34 1 = 35 }
// lldb-check:[...] { 0 = 34 1 = 35 }

// lldb-command:v bb
// lldbg-check:[...] { 0 = 36 1 = 37 }
// lldbr-check:((i32, i32)) bb = { 0 = 36 1 = 37 }
// lldb-check:[...] { 0 = 36 1 = 37 }

// lldb-command:v cc
// lldbg-check:[...] 38
// lldbr-check:(i32) cc = 38
// lldb-check:[...] 38

// lldb-command:v dd
// lldbg-check:[...] { 0 = 40 1 = 41 2 = 42 }
// lldbr-check:((i32, i32, i32)) dd = { 0 = 40 1 = 41 2 = 42}
// lldb-check:[...] { 0 = 40 1 = 41 2 = 42 }

// lldb-command:v *ee
// lldbg-check:[...] { 0 = 43 1 = 44 2 = 45 }
// lldbr-check:((i32, i32, i32)) *ee = { 0 = 43 1 = 44 2 = 45}
// lldb-check:[...] { 0 = 43 1 = 44 2 = 45 }

// lldb-command:v *ff
// lldbg-check:[...] 46
// lldbr-check:(i32) *ff = 46
// lldb-check:[...] 46

// lldb-command:v gg
// lldbg-check:[...] { 0 = 47 1 = 48 }
// lldbr-check:((i32, i32)) gg = { 0 = 47 1 = 48 }
// lldb-check:[...] { 0 = 47 1 = 48 }

// lldb-command:v *hh
// lldbg-check:[...] 50
// lldbr-check:(i32) *hh = 50
// lldb-check:[...] 50

// lldb-command:v ii
// lldbg-check:[...] 51
// lldbr-check:(i32) ii = 51
// lldb-check:[...] 51

// lldb-command:v *jj
// lldbg-check:[...] 52
// lldbr-check:(i32) *jj = 52
// lldb-check:[...] 52

// lldb-command:v kk
// lldbg-check:[...] 53
// lldbr-check:(f64) kk = 53
// lldb-check:[...] 53

// lldb-command:v ll
// lldbg-check:[...] 54
// lldbr-check:(isize) ll = 54
// lldb-check:[...] 54

// lldb-command:v mm
// lldbg-check:[...] 55
// lldbr-check:(f64) mm = 55
// lldb-check:[...] 55

// lldb-command:v *nn
// lldbg-check:[...] 56
// lldbr-check:(isize) *nn = 56
// lldb-check:[...] 56


#![allow(unused_variables)]
1 change: 0 additions & 1 deletion tests/debuginfo/drop-locations.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ ignore-android
//@ min-lldb-version: 310
//@ ignore-test: #128971

#![allow(unused)]
1 change: 0 additions & 1 deletion tests/debuginfo/embedded-visualizer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ compile-flags:-g
//@ min-gdb-version: 8.1
//@ ignore-lldb
//@ ignore-windows-gnu: #128981

3 changes: 0 additions & 3 deletions tests/debuginfo/empty-string.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
//@ ignore-windows-gnu: #128981
//@ ignore-android: FIXME(#10381)
//@ compile-flags:-g
//@ min-gdb-version: 8.1
//@ ignore-gdb-version: 7.11.90 - 8.0.9
//@ min-lldb-version: 310

// === GDB TESTS ===================================================================================

7 changes: 2 additions & 5 deletions tests/debuginfo/enum-thinlto.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Require a gdb that can read DW_TAG_variant_part.
//@ min-gdb-version: 8.2
//@ min-lldb-version: 1800
//@ compile-flags:-g -Z thinlto

@@ -8,15 +6,14 @@
// gdb-command:run

// gdb-command:print *abc
// gdbr-check:$1 = enum_thinlto::ABC::TheA{x: 0, y: 8970181431921507452}
// gdb-check:$1 = enum_thinlto::ABC::TheA{x: 0, y: 8970181431921507452}

// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:v *abc
// lldbg-check:(enum_thinlto::ABC) *abc = { value = { x = 0 y = 8970181431921507452 } $discr$ = 0 }
// lldbr-check:(enum_thinlto::ABC) *abc = (x = 0, y = 8970181431921507452)
// lldb-check:(enum_thinlto::ABC) *abc = { value = { x = 0 y = 8970181431921507452 } $discr$ = 0 }

#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
32 changes: 10 additions & 22 deletions tests/debuginfo/evec-in-struct.rs
Original file line number Diff line number Diff line change
@@ -1,53 +1,41 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================

// gdb-command:run

// gdb-command:print no_padding1
// gdbg-check:$1 = {x = {0, 1, 2}, y = -3, z = {4.5, 5.5}}
// gdbr-check:$1 = evec_in_struct::NoPadding1 {x: [0, 1, 2], y: -3, z: [4.5, 5.5]}
// gdb-check:$1 = evec_in_struct::NoPadding1 {x: [0, 1, 2], y: -3, z: [4.5, 5.5]}
// gdb-command:print no_padding2
// gdbg-check:$2 = {x = {6, 7, 8}, y = {{9, 10}, {11, 12}}}
// gdbr-check:$2 = evec_in_struct::NoPadding2 {x: [6, 7, 8], y: [[9, 10], [11, 12]]}
// gdb-check:$2 = evec_in_struct::NoPadding2 {x: [6, 7, 8], y: [[9, 10], [11, 12]]}

// gdb-command:print struct_internal_padding
// gdbg-check:$3 = {x = {13, 14}, y = {15, 16}}
// gdbr-check:$3 = evec_in_struct::StructInternalPadding {x: [13, 14], y: [15, 16]}
// gdb-check:$3 = evec_in_struct::StructInternalPadding {x: [13, 14], y: [15, 16]}

// gdb-command:print single_vec
// gdbg-check:$4 = {x = {17, 18, 19, 20, 21}}
// gdbr-check:$4 = evec_in_struct::SingleVec {x: [17, 18, 19, 20, 21]}
// gdb-check:$4 = evec_in_struct::SingleVec {x: [17, 18, 19, 20, 21]}

// gdb-command:print struct_padded_at_end
// gdbg-check:$5 = {x = {22, 23}, y = {24, 25}}
// gdbr-check:$5 = evec_in_struct::StructPaddedAtEnd {x: [22, 23], y: [24, 25]}
// gdb-check:$5 = evec_in_struct::StructPaddedAtEnd {x: [22, 23], y: [24, 25]}


// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:v no_padding1
// lldbg-check:[...] { x = { [0] = 0 [1] = 1 [2] = 2 } y = -3 z = { [0] = 4.5 [1] = 5.5 } }
// lldbr-check:(evec_in_struct::NoPadding1) no_padding1 = { x = { [0] = 0 [1] = 1 [2] = 2 } y = -3 z = { [0] = 4.5 [1] = 5.5 } }
// lldb-check:[...] { x = { [0] = 0 [1] = 1 [2] = 2 } y = -3 z = { [0] = 4.5 [1] = 5.5 } }
// lldb-command:v no_padding2
// lldbg-check:[...] { x = { [0] = 6 [1] = 7 [2] = 8 } y = { [0] = { [0] = 9 [1] = 10 } [1] = { [0] = 11 [1] = 12 } } }
// lldbr-check:(evec_in_struct::NoPadding2) no_padding2 = { x = { [0] = 6 [1] = 7 [2] = 8 } y = { [0] = { [0] = 9 [1] = 10 } [1] = { [0] = 11 [1] = 12 } } }
// lldb-check:[...] { x = { [0] = 6 [1] = 7 [2] = 8 } y = { [0] = { [0] = 9 [1] = 10 } [1] = { [0] = 11 [1] = 12 } } }

// lldb-command:v struct_internal_padding
// lldbg-check:[...] { x = { [0] = 13 [1] = 14 } y = { [0] = 15 [1] = 16 } }
// lldbr-check:(evec_in_struct::StructInternalPadding) struct_internal_padding = { x = { [0] = 13 [1] = 14 } y = { [0] = 15 [1] = 16 } }
// lldb-check:[...] { x = { [0] = 13 [1] = 14 } y = { [0] = 15 [1] = 16 } }

// lldb-command:v single_vec
// lldbg-check:[...] { x = { [0] = 17 [1] = 18 [2] = 19 [3] = 20 [4] = 21 } }
// lldbr-check:(evec_in_struct::SingleVec) single_vec = { x = { [0] = 17 [1] = 18 [2] = 19 [3] = 20 [4] = 21 } }
// lldb-check:[...] { x = { [0] = 17 [1] = 18 [2] = 19 [3] = 20 [4] = 21 } }

// lldb-command:v struct_padded_at_end
// lldbg-check:[...] { x = { [0] = 22 [1] = 23 } y = { [0] = 24 [1] = 25 } }
// lldbr-check:(evec_in_struct::StructPaddedAtEnd) struct_padded_at_end = { x = { [0] = 22 [1] = 23 } y = { [0] = 24 [1] = 25 } }
// lldb-check:[...] { x = { [0] = 22 [1] = 23 } y = { [0] = 24 [1] = 25 } }

#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
14 changes: 4 additions & 10 deletions tests/debuginfo/extern-c-fn.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -22,17 +20,13 @@
// lldb-command:run

// lldb-command:v len
// lldbg-check:[...] 20
// lldbr-check:(i32) len = 20
// lldb-check:[...] 20
// lldb-command:v local0
// lldbg-check:[...] 19
// lldbr-check:(i32) local0 = 19
// lldb-check:[...] 19
// lldb-command:v local1
// lldbg-check:[...] true
// lldbr-check:(bool) local1 = true
// lldb-check:[...] true
// lldb-command:v local2
// lldbg-check:[...] 20.5
// lldbr-check:(f64) local2 = 20.5
// lldb-check:[...] 20.5

// lldb-command:continue

2 changes: 0 additions & 2 deletions tests/debuginfo/function-arg-initialization.rs
Original file line number Diff line number Diff line change
@@ -24,10 +24,8 @@

// NON IMMEDIATE ARGS
// gdb-command:print a
// gdbg-check:$4 = {a = 3, b = 4, c = 5, d = 6, e = 7, f = 8, g = 9, h = 10}
// gdbt-check:$4 = function_arg_initialization::BigStruct {a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10}
// gdb-command:print b
// gdbg-check:$5 = {a = 11, b = 12, c = 13, d = 14, e = 15, f = 16, g = 17, h = 18}
// gdbt-check:$5 = function_arg_initialization::BigStruct {a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18}
// gdb-command:continue

14 changes: 4 additions & 10 deletions tests/debuginfo/function-arguments.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -23,19 +21,15 @@
// lldb-command:run

// lldb-command:v x
// lldbg-check:[...] 111102
// lldbr-check:(isize) x = 111102
// lldb-check:[...] 111102
// lldb-command:v y
// lldbg-check:[...] true
// lldbr-check:(bool) y = true
// lldb-check:[...] true
// lldb-command:continue

// lldb-command:v a
// lldbg-check:[...] 2000
// lldbr-check:(i32) a = 2000
// lldb-check:[...] 2000
// lldb-command:v b
// lldbg-check:[...] 3000
// lldbr-check:(i64) b = 3000
// lldb-check:[...] 3000
// lldb-command:continue


16 changes: 5 additions & 11 deletions tests/debuginfo/gdb-pretty-struct-and-enums.rs
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
//@ ignore-lldb
//@ ignore-android: FIXME(#10381)
//@ min-gdb-version: 8.1

//@ compile-flags:-g

// gdb-command: run

// gdb-command: print regular_struct
// gdbg-check:$1 = {the_first_field = 101, the_second_field = 102.5, the_third_field = false}
// gdbr-check:$1 = gdb_pretty_struct_and_enums::RegularStruct {the_first_field: 101, the_second_field: 102.5, the_third_field: false}
// gdb-check:$1 = gdb_pretty_struct_and_enums::RegularStruct {the_first_field: 101, the_second_field: 102.5, the_third_field: false}

// gdb-command: print empty_struct
// gdbg-check:$2 = EmptyStruct
// gdbr-check:$2 = gdb_pretty_struct_and_enums::EmptyStruct
// gdb-check:$2 = gdb_pretty_struct_and_enums::EmptyStruct

// gdb-command: print c_style_enum1
// gdbg-check:$3 = CStyleEnumVar1
// gdbr-check:$3 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar1
// gdb-check:$3 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar1

// gdb-command: print c_style_enum2
// gdbg-check:$4 = CStyleEnumVar2
// gdbr-check:$4 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar2
// gdb-check:$4 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar2

// gdb-command: print c_style_enum3
// gdbg-check:$5 = CStyleEnumVar3
// gdbr-check:$5 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar3
// gdb-check:$5 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar3

#![allow(dead_code, unused_variables)]

20 changes: 8 additions & 12 deletions tests/debuginfo/generic-enum-with-different-disr-sizes.rs
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
//@ ignore-lldb: FIXME(#27089)
//@ min-lldb-version: 310

// Require a gdb that can read DW_TAG_variant_part.
//@ min-gdb-version: 8.2

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
// gdb-command:run

// gdb-command:print eight_bytes1
// gdbr-check:$1 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant1(100)
// gdb-check:$1 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant1(100)

// gdb-command:print four_bytes1
// gdbr-check:$2 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant1(101)
// gdb-check:$2 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant1(101)

// gdb-command:print two_bytes1
// gdbr-check:$3 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant1(102)
// gdb-check:$3 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant1(102)

// gdb-command:print one_byte1
// gdbr-check:$4 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant1(65)
// gdb-check:$4 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant1(65)


// gdb-command:print eight_bytes2
// gdbr-check:$5 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant2(100)
// gdb-check:$5 = generic_enum_with_different_disr_sizes::Enum<f64>::Variant2(100)

// gdb-command:print four_bytes2
// gdbr-check:$6 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant2(101)
// gdb-check:$6 = generic_enum_with_different_disr_sizes::Enum<i32>::Variant2(101)

// gdb-command:print two_bytes2
// gdbr-check:$7 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant2(102)
// gdb-check:$7 = generic_enum_with_different_disr_sizes::Enum<i16>::Variant2(102)

// gdb-command:print one_byte2
// gdbr-check:$8 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant2(65)
// gdb-check:$8 = generic_enum_with_different_disr_sizes::Enum<u8>::Variant2(65)

// gdb-command:continue

23 changes: 7 additions & 16 deletions tests/debuginfo/generic-function.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -21,36 +19,29 @@
// gdb-command:print *t0
// gdb-check:$5 = 5
// gdb-command:print *t1
// gdbg-check:$6 = {a = 6, b = 7.5}
// gdbr-check:$6 = generic_function::Struct {a: 6, b: 7.5}
// gdb-check:$6 = generic_function::Struct {a: 6, b: 7.5}
// gdb-command:continue

// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:v *t0
// lldbg-check:[...] 1
// lldbr-check:(i32) *t0 = 1
// lldb-check:[...] 1
// lldb-command:v *t1
// lldbg-check:[...] 2.5
// lldbr-check:(f64) *t1 = 2.5
// lldb-check:[...] 2.5
// lldb-command:continue

// lldb-command:v *t0
// lldbg-check:[...] 3.5
// lldbr-check:(f64) *t0 = 3.5
// lldb-check:[...] 3.5
// lldb-command:v *t1
// lldbg-check:[...] 4
// lldbr-check:(u16) *t1 = 4
// lldb-check:[...] 4
// lldb-command:continue

// lldb-command:v *t0
// lldbg-check:[...] 5
// lldbr-check:(i32) *t0 = 5
// lldb-check:[...] 5
// lldb-command:v *t1
// lldbg-check:[...] { a = 6 b = 7.5 }
// lldbr-check:(generic_function::Struct) *t1 = { a = 6 b = 7.5 }
// lldb-check:[...] { a = 6 b = 7.5 }
// lldb-command:continue

#![feature(omit_gdb_pretty_printer_section)]
26 changes: 8 additions & 18 deletions tests/debuginfo/generic-functions-nested.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -36,35 +34,27 @@
// lldb-command:run

// lldb-command:v x
// lldbg-check:[...] -1
// lldbr-check:(i32) x = -1
// lldb-check:[...] -1
// lldb-command:v y
// lldbg-check:[...] 1
// lldbr-check:(i32) y = 1
// lldb-check:[...] 1
// lldb-command:continue

// lldb-command:v x
// lldbg-check:[...] -1
// lldbr-check:(i32) x = -1
// lldb-check:[...] -1
// lldb-command:v y
// lldbg-check:[...] 2.5
// lldbr-check:(f64) y = 2.5
// lldb-check:[...] 2.5
// lldb-command:continue

// lldb-command:v x
// lldbg-check:[...] -2.5
// lldbr-check:(f64) x = -2.5
// lldb-check:[...] -2.5
// lldb-command:v y
// lldbg-check:[...] 1
// lldbr-check:(i32) y = 1
// lldb-check:[...] 1
// lldb-command:continue

// lldb-command:v x
// lldbg-check:[...] -2.5
// lldbr-check:(f64) x = -2.5
// lldb-check:[...] -2.5
// lldb-command:v y
// lldbg-check:[...] 2.5
// lldbr-check:(f64) y = 2.5
// lldb-check:[...] 2.5
// lldb-command:continue


64 changes: 20 additions & 44 deletions tests/debuginfo/generic-method-on-generic-struct.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
//@ compile-flags:-g

// Some versions of the non-rust-enabled LLDB print the wrong generic
// parameter type names in this test.
//@ needs-rust-lldb

// === GDB TESTS ===================================================================================

// gdb-command:run

// STACK BY REF
// gdb-command:print *self
// gdbg-check:$1 = {x = {__0 = 8888, __1 = -8888}}
// gdbr-check:$1 = generic_method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)}
// gdb-check:$1 = generic_method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)}
// gdb-command:print arg1
// gdb-check:$2 = -1
// gdb-command:print arg2
@@ -20,8 +15,7 @@

// STACK BY VAL
// gdb-command:print self
// gdbg-check:$4 = {x = {__0 = 8888, __1 = -8888}}
// gdbr-check:$4 = generic_method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)}
// gdb-check:$4 = generic_method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)}
// gdb-command:print arg1
// gdb-check:$5 = -3
// gdb-command:print arg2
@@ -30,8 +24,7 @@

// OWNED BY REF
// gdb-command:print *self
// gdbg-check:$7 = {x = 1234.5}
// gdbr-check:$7 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5}
// gdb-check:$7 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5}
// gdb-command:print arg1
// gdb-check:$8 = -5
// gdb-command:print arg2
@@ -40,8 +33,7 @@

// OWNED BY VAL
// gdb-command:print self
// gdbg-check:$10 = {x = 1234.5}
// gdbr-check:$10 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5}
// gdb-check:$10 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5}
// gdb-command:print arg1
// gdb-check:$11 = -7
// gdb-command:print arg2
@@ -50,8 +42,7 @@

// OWNED MOVED
// gdb-command:print *self
// gdbg-check:$13 = {x = 1234.5}
// gdbr-check:$13 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5}
// gdb-check:$13 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5}
// gdb-command:print arg1
// gdb-check:$14 = -9
// gdb-command:print arg2
@@ -65,62 +56,47 @@

// STACK BY REF
// lldb-command:v *self
// lldbg-check:[...] { x = { 0 = 8888, 1 = -8888 } }
// lldbr-check:(generic_method_on_generic_struct::Struct<(u32, i32)>) *self = { x = { 0 = 8888 1 = -8888 } }
// lldb-check:[...] { x = { 0 = 8888 1 = -8888 } }
// lldb-command:v arg1
// lldbg-check:[...] -1
// lldbr-check:(isize) arg1 = -1
// lldb-check:[...] -1
// lldb-command:v arg2
// lldbg-check:[...] 2
// lldbr-check:(u16) arg2 = 2
// lldb-check:[...] 2
// lldb-command:continue

// STACK BY VAL
// lldb-command:v self
// lldbg-check:[...] { x = { 0 = 8888, 1 = -8888 } }
// lldbr-check:(generic_method_on_generic_struct::Struct<(u32, i32)>) self = { x = { 0 = 8888, 1 = -8888 } }
// lldb-check:[...] { x = { 0 = 8888 1 = -8888 } }
// lldb-command:v arg1
// lldbg-check:[...] -3
// lldbr-check:(isize) arg1 = -3
// lldb-check:[...] -3
// lldb-command:v arg2
// lldbg-check:[...] -4
// lldbr-check:(i16) arg2 = -4
// lldb-check:[...] -4
// lldb-command:continue

// OWNED BY REF
// lldb-command:v *self
// lldbg-check:[...] { x = 1234.5 }
// lldbr-check:(generic_method_on_generic_struct::Struct<f64>) *self = { x = 1234.5 }
// lldb-check:[...] { x = 1234.5 }
// lldb-command:v arg1
// lldbg-check:[...] -5
// lldbr-check:(isize) arg1 = -5
// lldb-check:[...] -5
// lldb-command:v arg2
// lldbg-check:[...] -6
// lldbr-check:(i32) arg2 = -6
// lldb-check:[...] -6
// lldb-command:continue

// OWNED BY VAL
// lldb-command:v self
// lldbg-check:[...] { x = 1234.5 }
// lldbr-check:(generic_method_on_generic_struct::Struct<f64>) self = { x = 1234.5 }
// lldb-check:[...] { x = 1234.5 }
// lldb-command:v arg1
// lldbg-check:[...] -7
// lldbr-check:(isize) arg1 = -7
// lldb-check:[...] -7
// lldb-command:v arg2
// lldbg-check:[...] -8
// lldbr-check:(i64) arg2 = -8
// lldb-check:[...] -8
// lldb-command:continue

// OWNED MOVED
// lldb-command:v *self
// lldbg-check:[...] { x = 1234.5 }
// lldbr-check:(generic_method_on_generic_struct::Struct<f64>) *self = { x = 1234.5 }
// lldb-check:[...] { x = 1234.5 }
// lldb-command:v arg1
// lldbg-check:[...] -9
// lldbr-check:(isize) arg1 = -9
// lldb-check:[...] -9
// lldb-command:v arg2
// lldbg-check:[...] -10.5
// lldbr-check:(f32) arg2 = -10.5
// lldb-check:[...] -10.5
// lldb-command:continue

#![feature(omit_gdb_pretty_printer_section)]
2 changes: 0 additions & 2 deletions tests/debuginfo/generic-static-method-on-struct-and-enum.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// gdb-command:run
13 changes: 4 additions & 9 deletions tests/debuginfo/generic-struct-style-enum.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
//@ min-lldb-version: 310

// Require a gdb that can read DW_TAG_variant_part.
//@ min-gdb-version: 8.2

//@ compile-flags:-g

// gdb-command:set print union on
// gdb-command:run

// gdb-command:print case1
// gdbr-check:$1 = generic_struct_style_enum::Regular<u16, u32, i64>::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868}
// gdb-check:$1 = generic_struct_style_enum::Regular<u16, u32, i64>::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868}

// gdb-command:print case2
// gdbr-check:$2 = generic_struct_style_enum::Regular<i16, u32, i64>::Case2{a: 0, b: 286331153, c: 286331153}
// gdb-check:$2 = generic_struct_style_enum::Regular<i16, u32, i64>::Case2{a: 0, b: 286331153, c: 286331153}

// gdb-command:print case3
// gdbr-check:$3 = generic_struct_style_enum::Regular<u16, i32, u64>::Case3{a: 0, b: 6438275382588823897}
// gdb-check:$3 = generic_struct_style_enum::Regular<u16, i32, u64>::Case3{a: 0, b: 6438275382588823897}

// gdb-command:print univariant
// gdbr-check:$4 = generic_struct_style_enum::Univariant<i32>::TheOnlyCase{a: -1}
// gdb-check:$4 = generic_struct_style_enum::Univariant<i32>::TheOnlyCase{a: -1}


#![feature(omit_gdb_pretty_printer_section)]
28 changes: 8 additions & 20 deletions tests/debuginfo/generic-struct.rs
Original file line number Diff line number Diff line change
@@ -1,43 +1,31 @@
// Some versions of the non-rust-enabled LLDB print the wrong generic
// parameter type names in this test.
//@ needs-rust-lldb

//@ compile-flags:-g

// === GDB TESTS ===================================================================================

// gdb-command:run

// gdb-command:print int_int
// gdbg-check:$1 = {key = 0, value = 1}
// gdbr-check:$1 = generic_struct::AGenericStruct<i32, i32> {key: 0, value: 1}
// gdb-check:$1 = generic_struct::AGenericStruct<i32, i32> {key: 0, value: 1}
// gdb-command:print int_float
// gdbg-check:$2 = {key = 2, value = 3.5}
// gdbr-check:$2 = generic_struct::AGenericStruct<i32, f64> {key: 2, value: 3.5}
// gdb-check:$2 = generic_struct::AGenericStruct<i32, f64> {key: 2, value: 3.5}
// gdb-command:print float_int
// gdbg-check:$3 = {key = 4.5, value = 5}
// gdbr-check:$3 = generic_struct::AGenericStruct<f64, i32> {key: 4.5, value: 5}
// gdb-check:$3 = generic_struct::AGenericStruct<f64, i32> {key: 4.5, value: 5}
// gdb-command:print float_int_float
// gdbg-check:$4 = {key = 6.5, value = {key = 7, value = 8.5}}
// gdbr-check:$4 = generic_struct::AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>> {key: 6.5, value: generic_struct::AGenericStruct<i32, f64> {key: 7, value: 8.5}}
// gdb-check:$4 = generic_struct::AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>> {key: 6.5, value: generic_struct::AGenericStruct<i32, f64> {key: 7, value: 8.5}}

// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:v int_int
// lldbg-check:[...] AGenericStruct<i32, i32> { key: 0, value: 1 }
// lldbr-check:(generic_struct::AGenericStruct<i32, i32>) int_int = AGenericStruct<i32, i32> { key: 0, value: 1 }
// lldb-check:[...]AGenericStruct<int, int>) int_int = { key = 0 value = 1 }
// lldb-command:v int_float
// lldbg-check:[...] AGenericStruct<i32, f64> { key: 2, value: 3.5 }
// lldbr-check:(generic_struct::AGenericStruct<i32, f64>) int_float = AGenericStruct<i32, f64> { key: 2, value: 3.5 }
// lldb-check:[...]AGenericStruct<int, double>) int_float = { key = 2 value = 3.5 }
// lldb-command:v float_int
// lldbg-check:[...] AGenericStruct<f64, i32> { key: 4.5, value: 5 }
// lldbr-check:(generic_struct::AGenericStruct<f64, i32>) float_int = AGenericStruct<f64, i32> { key: 4.5, value: 5 }
// lldb-check:[...]AGenericStruct<double, int>) float_int = { key = 4.5 value = 5 }

// lldb-command:v float_int_float
// lldbg-check:[...] AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>> { key: 6.5, value: AGenericStruct<i32, f64> { key: 7, value: 8.5 } }
// lldbr-check:(generic_struct::AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>>) float_int_float = AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>> { key: 6.5, value: AGenericStruct<i32, f64> { key: 7, value: 8.5 } }
// lldb-check:[...]AGenericStruct<double, generic_struct::AGenericStruct<int, double> >) float_int_float = { key = 6.5 value = { key = 7 value = 8.5 } }

// === CDB TESTS ===================================================================================

16 changes: 4 additions & 12 deletions tests/debuginfo/generic-tuple-style-enum.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Require a gdb or lldb that can read DW_TAG_variant_part.
//@ min-gdb-version: 8.2
//@ needs-rust-lldb

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -10,33 +6,29 @@
// gdb-command:run

// gdb-command:print case1
// gdbr-check:$1 = generic_tuple_style_enum::Regular<u16, u32, u64>::Case1(0, 31868, 31868, 31868, 31868)
// gdb-check:$1 = generic_tuple_style_enum::Regular<u16, u32, u64>::Case1(0, 31868, 31868, 31868, 31868)

// gdb-command:print case2
// gdbr-check:$2 = generic_tuple_style_enum::Regular<i16, i32, i64>::Case2(0, 286331153, 286331153)
// gdb-check:$2 = generic_tuple_style_enum::Regular<i16, i32, i64>::Case2(0, 286331153, 286331153)

// gdb-command:print case3
// gdbr-check:$3 = generic_tuple_style_enum::Regular<i16, i32, i64>::Case3(0, 6438275382588823897)
// gdb-check:$3 = generic_tuple_style_enum::Regular<i16, i32, i64>::Case3(0, 6438275382588823897)

// gdb-command:print univariant
// gdbr-check:$4 = generic_tuple_style_enum::Univariant<i64>::TheOnlyCase(-1)
// gdb-check:$4 = generic_tuple_style_enum::Univariant<i64>::TheOnlyCase(-1)


// === LLDB TESTS ==================================================================================

// lldb-command:run

// lldb-command:v case1
// lldbr-check:(generic_tuple_style_enum::Regular<u16, u32, u64>::Case1) case1 = { __0 = 0 __1 = 31868 __2 = 31868 __3 = 31868 __4 = 31868 }

// lldb-command:v case2
// lldbr-check:(generic_tuple_style_enum::Regular<i16, i32, i64>::Case2) case2 = Regular<i16, i32, i64>::Case2 { Case1: 0, Case2: 286331153, Case3: 286331153 }

// lldb-command:v case3
// lldbr-check:(generic_tuple_style_enum::Regular<i16, i32, i64>::Case3) case3 = Regular<i16, i32, i64>::Case3 { Case1: 0, Case2: 6438275382588823897 }

// lldb-command:v univariant
// lldbr-check:(generic_tuple_style_enum::Univariant<i64>) univariant = Univariant<i64> { TheOnlyCase: Univariant<i64>::TheOnlyCase(-1) }

#![feature(omit_gdb_pretty_printer_section)]
#![omit_gdb_pretty_printer_section]
10 changes: 3 additions & 7 deletions tests/debuginfo/include_string.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//@ min-lldb-version: 310
//@ ignore-gdb-version: 15.0 - 99.0
// ^ test temporarily disabled as it fails under gdb 15

@@ -18,14 +17,11 @@
// lldb-command:run

// lldb-command:v string1.length
// lldbg-check:[...] 48
// lldbr-check:(usize) length = 48
// lldb-check:[...] 48
// lldb-command:v string2.length
// lldbg-check:[...] 49
// lldbr-check:(usize) length = 49
// lldb-check:[...] 49
// lldb-command:v string3.length
// lldbg-check:[...] 50
// lldbr-check:(usize) length = 50
// lldb-check:[...] 50

// lldb-command:continue

1 change: 0 additions & 1 deletion tests/debuginfo/issue-13213.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//@ min-lldb-version: 310
//@ ignore-cdb: Fails with exit code 0xc0000135 ("the application failed to initialize properly")

//@ aux-build:issue-13213-aux.rs
2 changes: 0 additions & 2 deletions tests/debuginfo/issue-14411.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// No debugger interaction required: just make sure it compiles without
8 changes: 2 additions & 6 deletions tests/debuginfo/issue-22656.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
// when trying to handle a Vec<> or anything else that contains zero-sized
// fields.

//@ min-lldb-version: 310
//@ ignore-gdb

//@ compile-flags:-g
@@ -11,12 +10,9 @@
// lldb-command:run

// lldb-command:v v
// lldbg-check:[...] size=3 { [0] = 1 [1] = 2 [2] = 3 }
// lldbr-check:(alloc::vec::Vec<i32>) v = size=3 { [0] = 1 [1] = 2 [2] = 3 }
// lldb-check:[...] size=3 { [0] = 1 [1] = 2 [2] = 3 }
// lldb-command:v zs
// lldbg-check:[...] { x = y = 123 z = w = 456 }
// lldbr-check:(issue_22656::StructWithZeroSizedField) zs = { x = y = 123 z = w = 456 }
// lldbr-command:continue
// lldb-check:[...] { x = y = 123 z = w = 456 }

#![allow(unused_variables)]
#![allow(dead_code)]
6 changes: 2 additions & 4 deletions tests/debuginfo/issue-57822.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// This test makes sure that the LLDB pretty printer does not throw an exception
// for nested closures and coroutines.

// Require a gdb that can read DW_TAG_variant_part.
//@ min-gdb-version: 8.2
//@ min-lldb-version: 1800
//@ compile-flags:-g

@@ -21,10 +19,10 @@
// lldb-command:run

// lldb-command:v g
// lldbg-check:(issue_57822::main::{closure_env#1}) g = { f = { x = 1 } }
// lldb-check:(issue_57822::main::{closure_env#1}) g = { f = { x = 1 } }

// lldb-command:v b
// lldbg-check:(issue_57822::main::{coroutine_env#3}) b = { value = { a = { value = { y = 2 } $discr$ = '\x02' } } $discr$ = '\x02' }
// lldb-check:(issue_57822::main::{coroutine_env#3}) b = { value = { a = { value = { y = 2 } $discr$ = '\x02' } } $discr$ = '\x02' }

#![feature(omit_gdb_pretty_printer_section, coroutines, coroutine_trait, stmt_expr_attributes)]
#![omit_gdb_pretty_printer_section]
1 change: 0 additions & 1 deletion tests/debuginfo/issue-7712.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ compile-flags:-C debuginfo=1
//@ min-lldb-version: 310

pub trait TraitWithDefaultMethod : Sized {
fn method(self) {
23 changes: 7 additions & 16 deletions tests/debuginfo/lexical-scope-in-for-loop.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -45,41 +43,34 @@

// FIRST ITERATION
// lldb-command:v x
// lldbg-check:[...] 1
// lldbr-check:(i32) x = 1
// lldb-check:[...] 1
// lldb-command:continue

// lldb-command:v x
// lldbg-check:[...] -1
// lldbr-check:(i32) x = -1
// lldb-check:[...] -1
// lldb-command:continue

// SECOND ITERATION
// lldb-command:v x
// lldbg-check:[...] 2
// lldbr-check:(i32) x = 2
// lldb-check:[...] 2
// lldb-command:continue

// lldb-command:v x
// lldbg-check:[...] -2
// lldbr-check:(i32) x = -2
// lldb-check:[...] -2
// lldb-command:continue

// THIRD ITERATION
// lldb-command:v x
// lldbg-check:[...] 3
// lldbr-check:(i32) x = 3
// lldb-check:[...] 3
// lldb-command:continue

// lldb-command:v x
// lldbg-check:[...] -3
// lldbr-check:(i32) x = -3
// lldb-check:[...] -3
// lldb-command:continue

// AFTER LOOP
// lldb-command:v x
// lldbg-check:[...] 1000000
// lldbr-check:(i32) x = 1000000
// lldb-check:[...] 1000000
// lldb-command:continue

#![feature(omit_gdb_pretty_printer_section)]
50 changes: 16 additions & 34 deletions tests/debuginfo/lexical-scope-in-if.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//@ min-lldb-version: 310

//@ compile-flags:-g

// === GDB TESTS ===================================================================================
@@ -69,74 +67,58 @@

// BEFORE if
// lldb-command:v x
// lldbg-check:[...] 999
// lldbr-check:(i32) x = 999
// lldb-check:[...] 999
// lldb-command:v y
// lldbg-check:[...] -1
// lldbr-check:(i32) y = -1
// lldb-check:[...] -1
// lldb-command:continue

// AT BEGINNING of 'then' block
// lldb-command:v x
// lldbg-check:[...] 999
// lldbr-check:(i32) x = 999
// lldb-check:[...] 999
// lldb-command:v y
// lldbg-check:[...] -1
// lldbr-check:(i32) y = -1
// lldb-check:[...] -1
// lldb-command:continue

// AFTER 1st redeclaration of 'x'
// lldb-command:v x
// lldbg-check:[...] 1001
// lldbr-check:(i32) x = 1001
// lldb-check:[...] 1001
// lldb-command:v y
// lldbg-check:[...] -1
// lldbr-check:(i32) y = -1
// lldb-check:[...] -1
// lldb-command:continue

// AFTER 2st redeclaration of 'x'
// lldb-command:v x
// lldbg-check:[...] 1002
// lldbr-check:(i32) x = 1002
// lldb-check:[...] 1002
// lldb-command:v y
// lldbg-check:[...] 1003
// lldbr-check:(i32) y = 1003
// lldb-check:[...] 1003
// lldb-command:continue

// AFTER 1st if expression
// lldb-command:v x
// lldbg-check:[...] 999
// lldbr-check:(i32) x = 999
// lldb-check:[...] 999
// lldb-command:v y
// lldbg-check:[...] -1
// lldbr-check:(i32) y = -1
// lldb-check:[...] -1
// lldb-command:continue

// BEGINNING of else branch
// lldb-command:v x
// lldbg-check:[...] 999
// lldbr-check:(i32) x = 999
// lldb-check:[...] 999
// lldb-command:v y
// lldbg-check:[...] -1
// lldbr-check:(i32) y = -1
// lldb-check:[...] -1
// lldb-command:continue

// BEGINNING of else branch
// lldb-command:v x
// lldbg-check:[...] 1004
// lldbr-check:(i32) x = 1004
// lldb-check:[...] 1004
// lldb-command:v y
// lldbg-check:[...] 1005
// lldbr-check:(i32) y = 1005
// lldb-check:[...] 1005
// lldb-command:continue

// BEGINNING of else branch
// lldb-command:v x
// lldbg-check:[...] 999
// lldbr-check:(i32) x = 999
// lldb-check:[...] 999
// lldb-command:v y
// lldbg-check:[...] -1
// lldbr-check:(i32) y = -1
// lldb-check:[...] -1
// lldb-command:continue

#![feature(omit_gdb_pretty_printer_section)]
Loading