Merge branch 'gdb-next-gen' of https://github.com/TimNN/rust into rollup

This commit is contained in:
Alex Crichton 2016-11-05 10:51:34 -07:00
commit 18ee04b3df
77 changed files with 1213 additions and 592 deletions

7
configure vendored
View File

@ -868,13 +868,6 @@ then
fi
fi
if [ -n "$CFG_GDB" ]
then
# Store GDB's version
CFG_GDB_VERSION=$($CFG_GDB --version 2>/dev/null | head -1)
putvar CFG_GDB_VERSION
fi
if [ -n "$CFG_LLDB" ]
then
# Store LLDB's version

View File

@ -648,7 +648,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) = \
--host $(3) \
--docck-python $$(CFG_PYTHON) \
--lldb-python $$(CFG_LLDB_PYTHON) \
--gdb-version="$(CFG_GDB_VERSION)" \
--gdb="$(CFG_GDB)" \
--lldb-version="$(CFG_LLDB_VERSION)" \
--llvm-version="$$(LLVM_VERSION_$(3))" \
--android-cross-path=$(CFG_ARM_LINUX_ANDROIDEABI_NDK) \

View File

@ -143,8 +143,8 @@ pub fn compiletest(build: &Build,
cmd.arg("--lldb-python").arg(python_default);
}
if let Some(ref vers) = build.gdb_version {
cmd.arg("--gdb-version").arg(vers);
if let Some(ref gdb) = build.config.gdb {
cmd.arg("--gdb").arg(gdb);
}
if let Some(ref vers) = build.lldb_version {
cmd.arg("--lldb-version").arg(vers);

View File

@ -23,6 +23,7 @@ use std::process;
use num_cpus;
use rustc_serialize::Decodable;
use toml::{Parser, Decoder, Value};
use util::push_exe_path;
/// Global configuration for the entire build and/or bootstrap.
///
@ -86,6 +87,7 @@ pub struct Config {
pub mandir: Option<String>,
pub codegen_tests: bool,
pub nodejs: Option<PathBuf>,
pub gdb: Option<PathBuf>,
}
/// Per-target configuration stored in the global configuration structure.
@ -123,6 +125,7 @@ struct Build {
compiler_docs: Option<bool>,
docs: Option<bool>,
submodules: Option<bool>,
gdb: Option<String>,
}
/// TOML representation of how the LLVM build is configured.
@ -227,6 +230,7 @@ impl Config {
}
config.rustc = build.rustc.map(PathBuf::from);
config.cargo = build.cargo.map(PathBuf::from);
config.gdb = build.gdb.map(PathBuf::from);
set(&mut config.compiler_docs, build.compiler_docs);
set(&mut config.docs, build.docs);
set(&mut config.submodules, build.submodules);
@ -356,37 +360,37 @@ impl Config {
.collect();
}
"CFG_MUSL_ROOT" if value.len() > 0 => {
self.musl_root = Some(PathBuf::from(value));
self.musl_root = Some(parse_configure_path(value));
}
"CFG_MUSL_ROOT_X86_64" if value.len() > 0 => {
let target = "x86_64-unknown-linux-musl".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.musl_root = Some(PathBuf::from(value));
target.musl_root = Some(parse_configure_path(value));
}
"CFG_MUSL_ROOT_I686" if value.len() > 0 => {
let target = "i686-unknown-linux-musl".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.musl_root = Some(PathBuf::from(value));
target.musl_root = Some(parse_configure_path(value));
}
"CFG_MUSL_ROOT_ARM" if value.len() > 0 => {
let target = "arm-unknown-linux-musleabi".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.musl_root = Some(PathBuf::from(value));
target.musl_root = Some(parse_configure_path(value));
}
"CFG_MUSL_ROOT_ARMHF" if value.len() > 0 => {
let target = "arm-unknown-linux-musleabihf".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.musl_root = Some(PathBuf::from(value));
target.musl_root = Some(parse_configure_path(value));
}
"CFG_MUSL_ROOT_ARMV7" if value.len() > 0 => {
let target = "armv7-unknown-linux-musleabihf".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.musl_root = Some(PathBuf::from(value));
target.musl_root = Some(parse_configure_path(value));
}
"CFG_DEFAULT_AR" if value.len() > 0 => {
self.rustc_default_ar = Some(value.to_string());
@ -394,6 +398,9 @@ impl Config {
"CFG_DEFAULT_LINKER" if value.len() > 0 => {
self.rustc_default_linker = Some(value.to_string());
}
"CFG_GDB" if value.len() > 0 => {
self.gdb = Some(parse_configure_path(value));
}
"CFG_RELEASE_CHANNEL" => {
self.channel = value.to_string();
}
@ -412,41 +419,42 @@ impl Config {
"CFG_LLVM_ROOT" if value.len() > 0 => {
let target = self.target_config.entry(self.build.clone())
.or_insert(Target::default());
let root = PathBuf::from(value);
target.llvm_config = Some(root.join("bin/llvm-config"));
let root = parse_configure_path(value);
target.llvm_config = Some(push_exe_path(root, &["bin", "llvm-config"]));
}
"CFG_JEMALLOC_ROOT" if value.len() > 0 => {
let target = self.target_config.entry(self.build.clone())
.or_insert(Target::default());
target.jemalloc = Some(PathBuf::from(value));
target.jemalloc = Some(parse_configure_path(value));
}
"CFG_ARM_LINUX_ANDROIDEABI_NDK" if value.len() > 0 => {
let target = "arm-linux-androideabi".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.ndk = Some(PathBuf::from(value));
target.ndk = Some(parse_configure_path(value));
}
"CFG_ARMV7_LINUX_ANDROIDEABI_NDK" if value.len() > 0 => {
let target = "armv7-linux-androideabi".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.ndk = Some(PathBuf::from(value));
target.ndk = Some(parse_configure_path(value));
}
"CFG_I686_LINUX_ANDROID_NDK" if value.len() > 0 => {
let target = "i686-linux-android".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.ndk = Some(PathBuf::from(value));
target.ndk = Some(parse_configure_path(value));
}
"CFG_AARCH64_LINUX_ANDROID_NDK" if value.len() > 0 => {
let target = "aarch64-linux-android".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.ndk = Some(PathBuf::from(value));
target.ndk = Some(parse_configure_path(value));
}
"CFG_LOCAL_RUST_ROOT" if value.len() > 0 => {
self.rustc = Some(PathBuf::from(value).join("bin/rustc"));
self.cargo = Some(PathBuf::from(value).join("bin/cargo"));
let path = parse_configure_path(value);
self.rustc = Some(push_exe_path(path.clone(), &["bin", "rustc"]));
self.cargo = Some(push_exe_path(path, &["bin", "cargo"]));
}
_ => {}
}

View File

@ -79,6 +79,9 @@
# Indicate whether submodules are managed and updated automatically.
#submodules = true
# The path to (or name of) the GDB executable to use
#gdb = "gdb"
# =============================================================================
# Options for compiling Rust code itself
# =============================================================================

View File

@ -124,7 +124,6 @@ pub struct Build {
bootstrap_key_stage0: String,
// Probed tools at runtime
gdb_version: Option<String>,
lldb_version: Option<String>,
lldb_python_dir: Option<String>,
@ -211,7 +210,6 @@ impl Build {
cc: HashMap::new(),
cxx: HashMap::new(),
crates: HashMap::new(),
gdb_version: None,
lldb_version: None,
lldb_python_dir: None,
}

View File

@ -92,6 +92,12 @@ pub fn check(build: &mut Build) {
need_cmd(s.as_ref());
}
if let Some(ref gdb) = build.config.gdb {
need_cmd(gdb.as_ref());
} else {
build.config.gdb = have_cmd("gdb".as_ref());
}
// We're gonna build some custom C code here and there, host triples
// also build some C++ shims for LLVM so we need a C++ compiler.
for target in build.config.target.iter() {
@ -198,7 +204,6 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
.to_string()
})
};
build.gdb_version = run(Command::new("gdb").arg("--version")).ok();
build.lldb_version = run(Command::new("lldb").arg("--version")).ok();
if build.lldb_version.is_some() {
build.lldb_python_dir = run(Command::new("lldb").arg("-P")).ok();

View File

@ -171,3 +171,21 @@ pub fn dylib_path() -> Vec<PathBuf> {
env::split_paths(&env::var_os(dylib_path_var()).unwrap_or(OsString::new()))
.collect()
}
/// `push` all components to `buf`. On windows, append `.exe` to the last component.
pub fn push_exe_path(mut buf: PathBuf, components: &[&str]) -> PathBuf {
let (&file, components) = components.split_last().expect("at least one component required");
let mut file = file.to_owned();
if cfg!(windows) {
file.push_str(".exe");
}
for c in components {
buf.push(c);
}
buf.push(file);
buf
}

View File

@ -16,7 +16,8 @@
// gdb-command:run
// gdb-command:print arg
// gdb-check:$1 = {b = -1, b1 = 0}
// gdbg-check:$1 = {b = -1, b1 = 0}
// gdbr-check:$1 = associated_types::Struct<i32> {b: -1, b1: 0}
// gdb-command:continue
// gdb-command:print inferred
@ -30,7 +31,8 @@
// gdb-command:continue
// gdb-command:print arg
// gdb-check:$5 = {__0 = 4, __1 = 5}
// gdbg-check:$5 = {__0 = 4, __1 = 5}
// gdbr-check:$5 = (4, 5)
// gdb-command:continue
// gdb-command:print a

View File

@ -12,33 +12,47 @@
// compile-flags:-g
// gdb-command:run
// gdb-command:whatis 'basic_types_globals_metadata::B'
// gdbg-command:whatis 'basic_types_globals_metadata::B'
// gdbr-command:whatis basic_types_globals_metadata::B
// gdb-check:type = bool
// gdb-command:whatis 'basic_types_globals_metadata::I'
// gdbg-command:whatis 'basic_types_globals_metadata::I'
// gdbr-command:whatis basic_types_globals_metadata::I
// gdb-check:type = isize
// gdb-command:whatis 'basic_types_globals_metadata::C'
// gdbg-command:whatis 'basic_types_globals_metadata::C'
// gdbr-command:whatis basic_types_globals_metadata::C
// gdb-check:type = char
// gdb-command:whatis 'basic_types_globals_metadata::I8'
// gdbg-command:whatis 'basic_types_globals_metadata::I8'
// gdbr-command:whatis basic_types_globals_metadata::I8
// gdb-check:type = i8
// gdb-command:whatis 'basic_types_globals_metadata::I16'
// gdbg-command:whatis 'basic_types_globals_metadata::I16'
// gdbr-command:whatis basic_types_globals_metadata::I16
// gdb-check:type = i16
// gdb-command:whatis 'basic_types_globals_metadata::I32'
// gdbg-command:whatis 'basic_types_globals_metadata::I32'
// gdbr-command:whatis basic_types_globals_metadata::I32
// gdb-check:type = i32
// gdb-command:whatis 'basic_types_globals_metadata::I64'
// gdbg-command:whatis 'basic_types_globals_metadata::I64'
// gdbr-command:whatis basic_types_globals_metadata::I64
// gdb-check:type = i64
// gdb-command:whatis 'basic_types_globals_metadata::U'
// gdbg-command:whatis 'basic_types_globals_metadata::U'
// gdbr-command:whatis basic_types_globals_metadata::U
// gdb-check:type = usize
// gdb-command:whatis 'basic_types_globals_metadata::U8'
// gdbg-command:whatis 'basic_types_globals_metadata::U8'
// gdbr-command:whatis basic_types_globals_metadata::U8
// gdb-check:type = u8
// gdb-command:whatis 'basic_types_globals_metadata::U16'
// gdbg-command:whatis 'basic_types_globals_metadata::U16'
// gdbr-command:whatis basic_types_globals_metadata::U16
// gdb-check:type = u16
// gdb-command:whatis 'basic_types_globals_metadata::U32'
// gdbg-command:whatis 'basic_types_globals_metadata::U32'
// gdbr-command:whatis basic_types_globals_metadata::U32
// gdb-check:type = u32
// gdb-command:whatis 'basic_types_globals_metadata::U64'
// gdbg-command:whatis 'basic_types_globals_metadata::U64'
// gdbr-command:whatis basic_types_globals_metadata::U64
// gdb-check:type = u64
// gdb-command:whatis 'basic_types_globals_metadata::F32'
// gdbg-command:whatis 'basic_types_globals_metadata::F32'
// gdbr-command:whatis basic_types_globals_metadata::F32
// gdb-check:type = f32
// gdb-command:whatis 'basic_types_globals_metadata::F64'
// gdbg-command:whatis 'basic_types_globals_metadata::F64'
// gdbr-command:whatis basic_types_globals_metadata::F64
// gdb-check:type = f64
// gdb-command:continue

View File

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

View File

@ -45,20 +45,29 @@
// gdb-command:whatis fnptr
// gdb-check:type = [...] (*)([...])
// gdb-command:info functions _yyy
// gdb-check:[...]![...]_yyy([...]);
// gdbg-check:[...]![...]_yyy([...]);
// gdbr-check:static fn basic_types_metadata::_yyy() -> !;
// gdb-command:ptype closure_0
// gdb-check: type = struct closure {
// gdb-check: <no data fields>
// gdb-check: }
// gdbr-check: type = struct closure
// gdbg-check: type = struct closure {
// gdbg-check: <no data fields>
// gdbg-check: }
// gdb-command:ptype closure_1
// gdb-check: type = struct closure {
// gdb-check: bool *__0;
// gdb-check: }
// gdbg-check: type = struct closure {
// gdbg-check: bool *__0;
// gdbg-check: }
// gdbr-check: type = struct closure (
// gdbr-check: bool *,
// gdbr-check: )
// gdb-command:ptype closure_2
// gdb-check: type = struct closure {
// gdb-check: bool *__0;
// gdb-check: isize *__1;
// gdb-check: }
// gdbg-check: type = struct closure {
// gdbg-check: bool *__0;
// gdbg-check: isize *__1;
// gdbg-check: }
// gdbr-check: type = struct closure (
// gdbr-check: bool *,
// gdbr-check: isize *,
// gdbr-check: )
//
// gdb-command:continue

View File

@ -21,64 +21,94 @@
// gdb-command:run
// Check initializers
// gdb-command:print 'basic_types_mut_globals::B'
// gdbg-command:print 'basic_types_mut_globals::B'
// gdbr-command:print B
// gdb-check:$1 = false
// gdb-command:print 'basic_types_mut_globals::I'
// gdbg-command:print 'basic_types_mut_globals::I'
// gdbr-command:print I
// gdb-check:$2 = -1
// gdb-command:print 'basic_types_mut_globals::C'
// gdb-check:$3 = 97
// gdb-command:print/d 'basic_types_mut_globals::I8'
// 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-check:$4 = 68
// gdb-command:print 'basic_types_mut_globals::I16'
// gdbg-command:print 'basic_types_mut_globals::I16'
// gdbr-command:print I16
// gdb-check:$5 = -16
// gdb-command:print 'basic_types_mut_globals::I32'
// gdbg-command:print 'basic_types_mut_globals::I32'
// gdbr-command:print I32
// gdb-check:$6 = -32
// gdb-command:print 'basic_types_mut_globals::I64'
// gdbg-command:print 'basic_types_mut_globals::I64'
// gdbr-command:print I64
// gdb-check:$7 = -64
// gdb-command:print 'basic_types_mut_globals::U'
// gdbg-command:print 'basic_types_mut_globals::U'
// gdbr-command:print U
// gdb-check:$8 = 1
// gdb-command:print/d 'basic_types_mut_globals::U8'
// gdbg-command:print/d 'basic_types_mut_globals::U8'
// gdbr-command:print U8
// gdb-check:$9 = 100
// gdb-command:print 'basic_types_mut_globals::U16'
// gdbg-command:print 'basic_types_mut_globals::U16'
// gdbr-command:print U16
// gdb-check:$10 = 16
// gdb-command:print 'basic_types_mut_globals::U32'
// gdbg-command:print 'basic_types_mut_globals::U32'
// gdbr-command:print U32
// gdb-check:$11 = 32
// gdb-command:print 'basic_types_mut_globals::U64'
// gdbg-command:print 'basic_types_mut_globals::U64'
// gdbr-command:print U64
// gdb-check:$12 = 64
// gdb-command:print 'basic_types_mut_globals::F32'
// gdbg-command:print 'basic_types_mut_globals::F32'
// gdbr-command:print F32
// gdb-check:$13 = 2.5
// gdb-command:print 'basic_types_mut_globals::F64'
// gdbg-command:print 'basic_types_mut_globals::F64'
// gdbr-command:print F64
// gdb-check:$14 = 3.5
// gdb-command:continue
// Check new values
// gdb-command:print 'basic_types_mut_globals'::B
// gdbg-command:print 'basic_types_mut_globals'::B
// gdbr-command:print B
// gdb-check:$15 = true
// gdb-command:print 'basic_types_mut_globals'::I
// gdbg-command:print 'basic_types_mut_globals'::I
// gdbr-command:print I
// gdb-check:$16 = 2
// gdb-command:print 'basic_types_mut_globals'::C
// gdb-check:$17 = 102
// gdb-command:print/d 'basic_types_mut_globals'::I8
// gdbg-command:print/d 'basic_types_mut_globals'::C
// gdbr-command:print C
// gdbg-check:$17 = 102
// gdbr-check:$17 = 102 'f'
// gdbg-command:print/d 'basic_types_mut_globals'::I8
// gdbr-command:print/d I8
// gdb-check:$18 = 78
// gdb-command:print 'basic_types_mut_globals'::I16
// gdbg-command:print 'basic_types_mut_globals'::I16
// gdbr-command:print I16
// gdb-check:$19 = -26
// gdb-command:print 'basic_types_mut_globals'::I32
// gdbg-command:print 'basic_types_mut_globals'::I32
// gdbr-command:print I32
// gdb-check:$20 = -12
// gdb-command:print 'basic_types_mut_globals'::I64
// gdbg-command:print 'basic_types_mut_globals'::I64
// gdbr-command:print I64
// gdb-check:$21 = -54
// gdb-command:print 'basic_types_mut_globals'::U
// gdbg-command:print 'basic_types_mut_globals'::U
// gdbr-command:print U
// gdb-check:$22 = 5
// gdb-command:print/d 'basic_types_mut_globals'::U8
// gdbg-command:print/d 'basic_types_mut_globals'::U8
// gdbr-command:print/d U8
// gdb-check:$23 = 20
// gdb-command:print 'basic_types_mut_globals'::U16
// gdbg-command:print 'basic_types_mut_globals'::U16
// gdbr-command:print U16
// gdb-check:$24 = 32
// gdb-command:print 'basic_types_mut_globals'::U32
// gdbg-command:print 'basic_types_mut_globals'::U32
// gdbr-command:print U32
// gdb-check:$25 = 16
// gdb-command:print 'basic_types_mut_globals'::U64
// gdbg-command:print 'basic_types_mut_globals'::U64
// gdbr-command:print U64
// gdb-check:$26 = 128
// gdb-command:print 'basic_types_mut_globals'::F32
// gdbg-command:print 'basic_types_mut_globals'::F32
// gdbr-command:print F32
// gdb-check:$27 = 5.75
// gdb-command:print 'basic_types_mut_globals'::F64
// gdbg-command:print 'basic_types_mut_globals'::F64
// gdbr-command:print F64
// gdb-check:$28 = 9.25
#![allow(unused_variables)]

View File

@ -26,7 +26,8 @@
// gdb-command:print i
// gdb-check:$2 = -1
// gdb-command:print c
// gdb-check:$3 = 97
// gdbg-check:$3 = 97
// gdbr-check:$3 = 97 'a'
// gdb-command:print/d i8
// gdb-check:$4 = 68
// gdb-command:print i16

View File

@ -25,10 +25,12 @@
// gdb-check:$2 = -1
// gdb-command:print *char_ref
// gdb-check:$3 = 97
// gdbg-check:$3 = 97
// gdbr-check:$3 = 97 'a'
// gdb-command:print *i8_ref
// gdb-check:$4 = 68 'D'
// gdbg-check:$4 = 68 'D'
// gdbr-check:$4 = 68
// gdb-command:print *i16_ref
// gdb-check:$5 = -16
@ -43,7 +45,8 @@
// gdb-check:$8 = 1
// gdb-command:print *u8_ref
// gdb-check:$9 = 100 'd'
// gdbg-check:$9 = 100 'd'
// gdbr-check:$9 = 100
// gdb-command:print *u16_ref
// gdb-check:$10 = 16

View File

@ -17,13 +17,16 @@
// gdb-command:run
// gdb-command:print *the_a_ref
// gdb-check:$1 = TheA
// gdbg-check:$1 = TheA
// gdbr-check:$1 = borrowed_c_style_enum::ABC::TheA
// gdb-command:print *the_b_ref
// gdb-check:$2 = TheB
// gdbg-check:$2 = TheB
// gdbr-check:$2 = borrowed_c_style_enum::ABC::TheB
// gdb-command:print *the_c_ref
// gdb-check:$3 = TheC
// gdbg-check:$3 = TheC
// gdbr-check:$3 = borrowed_c_style_enum::ABC::TheC
// === LLDB TESTS ==================================================================================

View File

@ -18,13 +18,16 @@
// gdb-command:run
// gdb-command:print *the_a_ref
// gdb-check:$1 = {{RUST$ENUM$DISR = TheA, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = TheA, __0 = 0, __1 = 2088533116, __2 = 2088533116}}
// gdbg-check:$1 = {{RUST$ENUM$DISR = TheA, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = TheA, __0 = 0, __1 = 2088533116, __2 = 2088533116}}
// gdbr-check:$1 = borrowed_enum::ABC::TheA{x: 0, y: 8970181431921507452}
// gdb-command:print *the_b_ref
// gdb-check:$2 = {{RUST$ENUM$DISR = TheB, x = 0, y = 1229782938247303441}, {RUST$ENUM$DISR = TheB, __0 = 0, __1 = 286331153, __2 = 286331153}}
// gdbg-check:$2 = {{RUST$ENUM$DISR = TheB, x = 0, y = 1229782938247303441}, {RUST$ENUM$DISR = TheB, __0 = 0, __1 = 286331153, __2 = 286331153}}
// gdbr-check:$2 = borrowed_enum::ABC::TheB(0, 286331153, 286331153)
// gdb-command:print *univariant_ref
// gdb-check:$3 = {{__0 = 4820353753753434}}
// gdbg-check:$3 = {{__0 = 4820353753753434}}
// gdbr-check:$3 = borrowed_enum::Univariant::TheOnlyCase(4820353753753434)
// === LLDB TESTS ==================================================================================

View File

@ -16,7 +16,8 @@
// gdb-command:run
// gdb-command:print *stack_val_ref
// gdb-check:$1 = {x = 10, y = 23.5}
// gdbg-check:$1 = {x = 10, y = 23.5}
// gdbr-check:$1 = borrowed_struct::SomeStruct {x: 10, y: 23.5}
// gdb-command:print *stack_val_interior_ref_1
// gdb-check:$2 = 10
@ -25,10 +26,12 @@
// gdb-check:$3 = 23.5
// gdb-command:print *ref_to_unnamed
// gdb-check:$4 = {x = 11, y = 24.5}
// gdbg-check:$4 = {x = 11, y = 24.5}
// gdbr-check:$4 = borrowed_struct::SomeStruct {x: 11, y: 24.5}
// gdb-command:print *unique_val_ref
// gdb-check:$5 = {x = 13, y = 26.5}
// gdbg-check:$5 = {x = 13, y = 26.5}
// gdbr-check:$5 = borrowed_struct::SomeStruct {x: 13, y: 26.5}
// gdb-command:print *unique_val_interior_ref_1
// gdb-check:$6 = 13

View File

@ -17,13 +17,16 @@
// gdb-command:run
// gdb-command:print *stack_val_ref
// gdb-check:$1 = {__0 = -14, __1 = -19}
// gdbg-check:$1 = {__0 = -14, __1 = -19}
// gdbr-check:$1 = (-14, -19)
// gdb-command:print *ref_to_unnamed
// gdb-check:$2 = {__0 = -15, __1 = -20}
// gdbg-check:$2 = {__0 = -15, __1 = -20}
// gdbr-check:$2 = (-15, -20)
// gdb-command:print *unique_val_ref
// gdb-check:$3 = {__0 = -17, __1 = -22}
// gdbg-check:$3 = {__0 = -17, __1 = -22}
// gdbr-check:$3 = (-17, -22)
// === LLDB TESTS ==================================================================================

View File

@ -26,7 +26,8 @@
// gdb-check:$2 = -1
// gdb-command:print *char_ref
// gdb-check:$3 = 97
// gdbg-check:$3 = 97
// gdbr-check:$3 = 97 'a'
// gdb-command:print/d *i8_ref
// gdb-check:$4 = 68

View File

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

View File

@ -17,10 +17,12 @@
// gdb-command:run
// gdb-command:print *unique
// gdb-check:$1 = {x = 99, y = 999, z = 9999, w = 99999}
// 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-command:print *unique_dtor
// gdb-check:$2 = {x = 77, y = 777, z = 7777, w = 77777}
// 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}
// === LLDB TESTS ==================================================================================

View File

@ -18,11 +18,13 @@
// gdb-command:run
// gdb-command:print s
// gdb-check:$1 = {a = 1, b = 2.5}
// gdbg-check:$1 = {a = 1, b = 2.5}
// gdbr-check:$1 = by_value_non_immediate_argument::Struct {a: 1, b: 2.5}
// gdb-command:continue
// gdb-command:print x
// gdb-check:$2 = {a = 3, b = 4.5}
// gdbg-check:$2 = {a = 3, b = 4.5}
// gdbr-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
@ -30,15 +32,18 @@
// gdb-command:continue
// gdb-command:print a
// gdb-check:$5 = {__0 = 7, __1 = 8, __2 = 9.5, __3 = 10.5}
// gdbg-check:$5 = {__0 = 7, __1 = 8, __2 = 9.5, __3 = 10.5}
// gdbr-check:$5 = (7, 8, 9.5, 10.5)
// gdb-command:continue
// gdb-command:print a
// gdb-check:$6 = {__0 = 11.5, __1 = 12.5, __2 = 13, __3 = 14}
// 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-command:continue
// gdb-command:print x
// gdb-check:$7 = {{RUST$ENUM$DISR = Case1, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = Case1, __0 = 0, __1 = 2088533116, __2 = 2088533116}}
// gdbg-check:$7 = {{RUST$ENUM$DISR = Case1, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = Case1, __0 = 0, __1 = 2088533116, __2 = 2088533116}}
// gdbr-check:$7 = by_value_non_immediate_argument::Enum::Case1{x: 0, y: 8970181431921507452}
// gdb-command:continue

View File

@ -21,11 +21,13 @@
// gdb-command:continue
// gdb-command:print self
// gdb-check:$2 = {x = 2222, y = 3333}
// gdbg-check:$2 = {x = 2222, y = 3333}
// gdbr-check:$2 = by_value_self_argument_in_trait_impl::Struct {x: 2222, y: 3333}
// gdb-command:continue
// gdb-command:print self
// gdb-check:$3 = {__0 = 4444.5, __1 = 5555, __2 = 6666, __3 = 7777.5}
// gdbg-check:$3 = {__0 = 4444.5, __1 = 5555, __2 = 6666, __3 = 7777.5}
// gdbr-check:$3 = (4444.5, 5555, 6666, 7777.5)
// gdb-command:continue

View File

@ -18,26 +18,32 @@
// gdb-command:run
// gdb-command:print tuple_interior_padding
// gdb-check:$1 = {__0 = 0, __1 = OneHundred}
// gdbg-check:$1 = {__0 = 0, __1 = OneHundred}
// gdbr-check:$1 = (0, c_style_enum_in_composite::AnEnum::OneHundred)
// gdb-command:print tuple_padding_at_end
// gdb-check:$2 = {__0 = {__0 = 1, __1 = OneThousand}, __1 = 2}
// gdbg-check:$2 = {__0 = {__0 = 1, __1 = OneThousand}, __1 = 2}
// gdbr-check:$2 = ((1, c_style_enum_in_composite::AnEnum::OneThousand), 2)
// gdb-command:print tuple_different_enums
// gdb-check:$3 = {__0 = OneThousand, __1 = MountainView, __2 = OneMillion, __3 = Vienna}
// 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-command:print padded_struct
// gdb-check:$4 = {a = 3, b = OneMillion, c = 4, d = Toronto, e = 5}
// 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-command:print packed_struct
// gdb-check:$5 = {a = 6, b = OneHundred, c = 7, d = Vienna, e = 8}
// 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-command:print non_padded_struct
// gdb-check:$6 = {a = OneMillion, b = MountainView, c = OneThousand, d = Toronto}
// 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-command:print struct_with_drop
// gdb-check:$7 = {__0 = {a = OneHundred, b = Vienna}, __1 = 9}
// 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)
// === LLDB TESTS ==================================================================================

View File

@ -16,60 +16,82 @@
// === GDB TESTS ===================================================================================
// gdb-command:print 'c_style_enum::SINGLE_VARIANT'
// gdb-check:$1 = TheOnlyVariant
// gdbg-check:$1 = TheOnlyVariant
// gdbr-check:$1 = c_style_enum::SingleVariant::TheOnlyVariant
// gdb-command:print 'c_style_enum::AUTO_ONE'
// gdb-check:$2 = One
// gdbg-check:$2 = One
// gdbr-check:$2 = c_style_enum::AutoDiscriminant::One
// gdb-command:print 'c_style_enum::AUTO_TWO'
// gdb-check:$3 = One
// gdbg-check:$3 = One
// gdbr-check:$3 = c_style_enum::AutoDiscriminant::One
// gdb-command:print 'c_style_enum::AUTO_THREE'
// gdb-check:$4 = One
// gdbg-check:$4 = One
// gdbr-check:$4 = c_style_enum::AutoDiscriminant::One
// gdb-command:print 'c_style_enum::MANUAL_ONE'
// gdb-check:$5 = OneHundred
// gdbg-check:$5 = OneHundred
// gdbr-check:$5 = c_style_enum::ManualDiscriminant::OneHundred
// gdb-command:print 'c_style_enum::MANUAL_TWO'
// gdb-check:$6 = OneHundred
// gdbg-check:$6 = OneHundred
// gdbr-check:$6 = c_style_enum::ManualDiscriminant::OneHundred
// gdb-command:print 'c_style_enum::MANUAL_THREE'
// gdb-check:$7 = OneHundred
// gdbg-check:$7 = OneHundred
// gdbr-check:$7 = c_style_enum::ManualDiscriminant::OneHundred
// gdb-command:run
// gdb-command:print auto_one
// gdb-check:$8 = One
// gdbg-check:$8 = One
// gdbr-check:$8 = c_style_enum::AutoDiscriminant::One
// gdb-command:print auto_two
// gdb-check:$9 = Two
// gdbg-check:$9 = Two
// gdbr-check:$9 = c_style_enum::AutoDiscriminant::Two
// gdb-command:print auto_three
// gdb-check:$10 = Three
// gdbg-check:$10 = Three
// gdbr-check:$10 = c_style_enum::AutoDiscriminant::Three
// gdb-command:print manual_one_hundred
// gdb-check:$11 = OneHundred
// gdbg-check:$11 = OneHundred
// gdbr-check:$11 = c_style_enum::ManualDiscriminant::OneHundred
// gdb-command:print manual_one_thousand
// gdb-check:$12 = OneThousand
// gdbg-check:$12 = OneThousand
// gdbr-check:$12 = c_style_enum::ManualDiscriminant::OneThousand
// gdb-command:print manual_one_million
// gdb-check:$13 = OneMillion
// gdbg-check:$13 = OneMillion
// gdbr-check:$13 = c_style_enum::ManualDiscriminant::OneMillion
// gdb-command:print single_variant
// gdb-check:$14 = TheOnlyVariant
// gdbg-check:$14 = TheOnlyVariant
// gdbr-check:$14 = c_style_enum::SingleVariant::TheOnlyVariant
// gdb-command:print 'c_style_enum::AUTO_TWO'
// gdb-check:$15 = Two
// 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 'c_style_enum::AUTO_THREE'
// gdb-check:$16 = Three
// 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 'c_style_enum::MANUAL_TWO'
// gdb-check:$17 = OneThousand
// 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 'c_style_enum::MANUAL_THREE'
// gdb-check:$18 = OneMillion
// 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
// === LLDB TESTS ==================================================================================

View File

@ -25,7 +25,8 @@ extern crate cross_crate_spans;
// gdb-command:run
// gdb-command:print result
// gdb-check:$1 = {__0 = 17, __1 = 17}
// gdbg-check:$1 = {__0 = 17, __1 = 17}
// gdbr-check:$1 = (17, 17)
// gdb-command:print a_variable
// gdb-check:$2 = 123456789
// gdb-command:print another_variable
@ -33,7 +34,8 @@ extern crate cross_crate_spans;
// gdb-command:continue
// gdb-command:print result
// gdb-check:$4 = {__0 = 1212, __1 = 1212}
// gdbg-check:$4 = {__0 = 1212, __1 = 1212}
// gdbr-check:$4 = (1212, 1212)
// gdb-command:print a_variable
// gdb-check:$5 = 123456789
// gdb-command:print another_variable

View File

@ -33,13 +33,15 @@
// gdb-command:print a
// gdb-check:$6 = 5
// gdb-command:print b
// gdb-check:$7 = {__0 = 6, __1 = 7}
// gdbg-check:$7 = {__0 = 6, __1 = 7}
// gdbr-check:$7 = (6, 7)
// gdb-command:continue
// gdb-command:print h
// gdb-check:$8 = 8
// gdb-command:print i
// gdb-check:$9 = {a = 9, b = 10}
// gdbg-check:$9 = {a = 9, b = 10}
// gdbr-check:$9 = destructured_fn_argument::Struct {a: 9, b: 10}
// gdb-command:print j
// gdb-check:$10 = 11
// gdb-command:continue
@ -65,7 +67,8 @@
// gdb-command:print q
// gdb-check:$17 = 20
// gdb-command:print r
// gdb-check:$18 = {a = 21, b = 22}
// gdbg-check:$18 = {a = 21, b = 22}
// gdbr-check:$18 = destructured_fn_argument::Struct {a: 21, b: 22}
// gdb-command:continue
// gdb-command:print s
@ -95,11 +98,13 @@
// gdb-command:continue
// gdb-command:print aa
// gdb-check:$30 = {__0 = 34, __1 = 35}
// gdbg-check:$30 = {__0 = 34, __1 = 35}
// gdbr-check:$30 = (34, 35)
// gdb-command:continue
// gdb-command:print bb
// gdb-check:$31 = {__0 = 36, __1 = 37}
// gdbg-check:$31 = {__0 = 36, __1 = 37}
// gdbr-check:$31 = (36, 37)
// gdb-command:continue
// gdb-command:print cc
@ -107,17 +112,20 @@
// gdb-command:continue
// gdb-command:print dd
// gdb-check:$33 = {__0 = 40, __1 = 41, __2 = 42}
// gdbg-check:$33 = {__0 = 40, __1 = 41, __2 = 42}
// gdbr-check:$33 = (40, 41, 42)
// gdb-command:continue
// gdb-command:print *ee
// gdb-check:$34 = {__0 = 43, __1 = 44, __2 = 45}
// gdbg-check:$34 = {__0 = 43, __1 = 44, __2 = 45}
// gdbr-check:$34 = (43, 44, 45)
// gdb-command:continue
// gdb-command:print *ff
// gdb-check:$35 = 46
// gdb-command:print gg
// gdb-check:$36 = {__0 = 47, __1 = 48}
// gdbg-check:$36 = {__0 = 47, __1 = 48}
// gdbr-check:$36 = (47, 48)
// gdb-command:continue
// gdb-command:print *hh

View File

@ -73,11 +73,13 @@
// gdb-command:continue
// gdb-command:print simple_struct_ident
// gdb-check:$23 = {x = 3537, y = 35437.5, z = true}
// 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-command:continue
// gdb-command:print simple_tuple_ident
// gdb-check:$24 = {__0 = 34903493, __1 = 232323}
// gdbg-check:$24 = {__0 = 34903493, __1 = 232323}
// gdbr-check:$24 = (34903493, 232323)
// gdb-command:continue
// === LLDB TESTS ==================================================================================

View File

@ -31,12 +31,14 @@
// gdb-command:print f
// gdb-check:$6 = 5
// gdb-command:print g
// gdb-check:$7 = {__0 = 6, __1 = 7}
// gdbg-check:$7 = {__0 = 6, __1 = 7}
// gdbr-check:$7 = (6, 7)
// gdb-command:print h
// gdb-check:$8 = 8
// gdb-command:print i
// gdb-check:$9 = {a = 9, b = 10}
// gdbg-check:$9 = {a = 9, b = 10}
// gdbr-check:$9 = destructured_local::Struct {a: 9, b: 10}
// gdb-command:print j
// gdb-check:$10 = 11
@ -58,7 +60,8 @@
// gdb-command:print q
// gdb-check:$17 = 20
// gdb-command:print r
// gdb-check:$18 = {a = 21, b = 22}
// gdbg-check:$18 = {a = 21, b = 22}
// gdbr-check:$18 = destructured_local::Struct {a: 21, b: 22}
// gdb-command:print s
// gdb-check:$19 = 24
@ -85,25 +88,30 @@
// gdb-check:$29 = 33
// gdb-command:print aa
// gdb-check:$30 = {__0 = 34, __1 = 35}
// gdbg-check:$30 = {__0 = 34, __1 = 35}
// gdbr-check:$30 = (34, 35)
// gdb-command:print bb
// gdb-check:$31 = {__0 = 36, __1 = 37}
// gdbg-check:$31 = {__0 = 36, __1 = 37}
// gdbr-check:$31 = (36, 37)
// gdb-command:print cc
// gdb-check:$32 = 38
// gdb-command:print dd
// gdb-check:$33 = {__0 = 40, __1 = 41, __2 = 42}
// gdbg-check:$33 = {__0 = 40, __1 = 41, __2 = 42}
// gdbr-check:$33 = (40, 41, 42)
// gdb-command:print *ee
// gdb-check:$34 = {__0 = 43, __1 = 44, __2 = 45}
// gdbg-check:$34 = {__0 = 43, __1 = 44, __2 = 45}
// gdbr-check:$34 = (43, 44, 45)
// gdb-command:print *ff
// gdb-check:$35 = 46
// gdb-command:print gg
// gdb-check:$36 = {__0 = 47, __1 = 48}
// gdbg-check:$36 = {__0 = 47, __1 = 48}
// gdbr-check:$36 = (47, 48)
// gdb-command:print *hh
// gdb-check:$37 = 50

View File

@ -17,18 +17,23 @@
// gdb-command:run
// gdb-command:print no_padding1
// gdb-check:$1 = {x = {0, 1, 2}, y = -3, z = {4.5, 5.5}}
// 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-command:print no_padding2
// gdb-check:$2 = {x = {6, 7, 8}, y = {{9, 10}, {11, 12}}}
// 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-command:print struct_internal_padding
// gdb-check:$3 = {x = {13, 14}, y = {15, 16}}
// gdbg-check:$3 = {x = {13, 14}, y = {15, 16}}
// gdbr-check:$3 = evec_in_struct::StructInternalPadding {x: [13, 14], y: [15, 16]}
// gdb-command:print single_vec
// gdb-check:$4 = {x = {17, 18, 19, 20, 21}}
// gdbg-check:$4 = {x = {17, 18, 19, 20, 21}}
// gdbr-check:$4 = evec_in_struct::SingleVec {x: [17, 18, 19, 20, 21]}
// gdb-command:print struct_padded_at_end
// gdb-check:$5 = {x = {22, 23}, y = {24, 25}}
// gdbg-check:$5 = {x = {22, 23}, y = {24, 25}}
// gdbr-check:$5 = evec_in_struct::StructPaddedAtEnd {x: [22, 23], y: [24, 25]}
// === LLDB TESTS ==================================================================================

View File

@ -16,7 +16,8 @@
// gdb-command:run
// gdb-command:print s
// gdb-check:$1 = [...]"abcd"
// gdbg-check:$1 = [...]"abcd"
// gdbr-check:$1 = [...]"abcd\000"
// gdb-command:print len
// gdb-check:$2 = 20
// gdb-command:print local0

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-tidy-linelength
// min-lldb-version: 310
// This test case checks if function arguments already have the correct value
@ -34,9 +36,11 @@
// NON IMMEDIATE ARGS
// gdb-command:print a
// gdb-check:$4 = {a = 3, b = 4, c = 5, d = 6, e = 7, f = 8, g = 9, h = 10}
// 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
// gdb-check:$5 = {a = 11, b = 12, c = 13, d = 14, e = 15, f = 16, g = 17, h = 18}
// 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
// BINDING

View File

@ -26,13 +26,16 @@
// gdb-check:$2 = EmptyStruct
// gdb-command: print c_style_enum1
// gdb-check:$3 = CStyleEnumVar1
// gdbg-check:$3 = CStyleEnumVar1
// gdbr-check:$3 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnum::CStyleEnumVar1
// gdb-command: print c_style_enum2
// gdb-check:$4 = CStyleEnumVar2
// gdbg-check:$4 = CStyleEnumVar2
// gdbr-check:$4 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnum::CStyleEnumVar2
// gdb-command: print c_style_enum3
// gdb-check:$5 = CStyleEnumVar3
// gdbg-check:$5 = CStyleEnumVar3
// gdbr-check:$5 = gdb_pretty_struct_and_enums_pre_gdb_7_7::CStyleEnum::CStyleEnumVar3
#![allow(dead_code, unused_variables)]

View File

@ -18,22 +18,37 @@
// gdb-command:run
// gdb-command:print eight_bytes1
// gdb-check:$1 = {{RUST$ENUM$DISR = Variant1, __0 = 100}, {RUST$ENUM$DISR = Variant1, __0 = 100}}
// gdbg-check:$1 = {{RUST$ENUM$DISR = Variant1, __0 = 100}, {RUST$ENUM$DISR = Variant1, __0 = 100}}
// gdbr-check:$1 = generic_enum_with_different_disr_sizes::Enum::Variant1(100)
// gdb-command:print four_bytes1
// gdb-check:$2 = {{RUST$ENUM$DISR = Variant1, __0 = 101}, {RUST$ENUM$DISR = Variant1, __0 = 101}}
// gdbg-check:$2 = {{RUST$ENUM$DISR = Variant1, __0 = 101}, {RUST$ENUM$DISR = Variant1, __0 = 101}}
// gdbr-check:$2 = generic_enum_with_different_disr_sizes::Enum::Variant1(101)
// gdb-command:print two_bytes1
// gdb-check:$3 = {{RUST$ENUM$DISR = Variant1, __0 = 102}, {RUST$ENUM$DISR = Variant1, __0 = 102}}
// gdbg-check:$3 = {{RUST$ENUM$DISR = Variant1, __0 = 102}, {RUST$ENUM$DISR = Variant1, __0 = 102}}
// gdbr-check:$3 = generic_enum_with_different_disr_sizes::Enum::Variant1(102)
// gdb-command:print one_byte1
// gdb-check:$4 = {{RUST$ENUM$DISR = Variant1, __0 = 65 'A'}, {RUST$ENUM$DISR = Variant1, __0 = 65 'A'}}
// gdbg-check:$4 = {{RUST$ENUM$DISR = Variant1, __0 = 65 'A'}, {RUST$ENUM$DISR = Variant1, __0 = 65 'A'}}
// gdbr-check:$4 = generic_enum_with_different_disr_sizes::Enum::Variant1(65)
// gdb-command:print eight_bytes2
// gdb-check:$5 = {{RUST$ENUM$DISR = Variant2, __0 = 100}, {RUST$ENUM$DISR = Variant2, __0 = 100}}
// gdbg-check:$5 = {{RUST$ENUM$DISR = Variant2, __0 = 100}, {RUST$ENUM$DISR = Variant2, __0 = 100}}
// gdbr-check:$5 = generic_enum_with_different_disr_sizes::Enum::Variant2(100)
// gdb-command:print four_bytes2
// gdb-check:$6 = {{RUST$ENUM$DISR = Variant2, __0 = 101}, {RUST$ENUM$DISR = Variant2, __0 = 101}}
// gdbg-check:$6 = {{RUST$ENUM$DISR = Variant2, __0 = 101}, {RUST$ENUM$DISR = Variant2, __0 = 101}}
// gdbr-check:$6 = generic_enum_with_different_disr_sizes::Enum::Variant2(101)
// gdb-command:print two_bytes2
// gdb-check:$7 = {{RUST$ENUM$DISR = Variant2, __0 = 102}, {RUST$ENUM$DISR = Variant2, __0 = 102}}
// gdbg-check:$7 = {{RUST$ENUM$DISR = Variant2, __0 = 102}, {RUST$ENUM$DISR = Variant2, __0 = 102}}
// gdbr-check:$7 = generic_enum_with_different_disr_sizes::Enum::Variant2(102)
// gdb-command:print one_byte2
// gdb-check:$8 = {{RUST$ENUM$DISR = Variant2, __0 = 65 'A'}, {RUST$ENUM$DISR = Variant2, __0 = 65 'A'}}
// gdbg-check:$8 = {{RUST$ENUM$DISR = Variant2, __0 = 65 'A'}, {RUST$ENUM$DISR = Variant2, __0 = 65 'A'}}
// gdbr-check:$8 = generic_enum_with_different_disr_sizes::Enum::Variant2(65)
// gdb-command:continue

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-tidy-linelength
// min-lldb-version: 310
// compile-flags:-g
@ -21,7 +23,8 @@
// gdb-command:print *t1
// gdb-check:$2 = 2.5
// gdb-command:print ret
// gdb-check:$3 = {__0 = {__0 = 1, __1 = 2.5}, __1 = {__0 = 2.5, __1 = 1}}
// gdbg-check:$3 = {__0 = {__0 = 1, __1 = 2.5}, __1 = {__0 = 2.5, __1 = 1}}
// gdbr-check:$3 = ((1, 2.5), (2.5, 1))
// gdb-command:continue
// gdb-command:print *t0
@ -29,15 +32,18 @@
// gdb-command:print *t1
// gdb-check:$5 = 4
// gdb-command:print ret
// gdb-check:$6 = {__0 = {__0 = 3.5, __1 = 4}, __1 = {__0 = 4, __1 = 3.5}}
// gdbg-check:$6 = {__0 = {__0 = 3.5, __1 = 4}, __1 = {__0 = 4, __1 = 3.5}}
// gdbr-check:$6 = ((3.5, 4), (4, 3.5))
// gdb-command:continue
// gdb-command:print *t0
// gdb-check:$7 = 5
// gdb-command:print *t1
// gdb-check:$8 = {a = 6, b = 7.5}
// gdbg-check:$8 = {a = 6, b = 7.5}
// gdbr-check:$8 = generic_function::Struct {a: 6, b: 7.5}
// gdb-command:print ret
// gdb-check:$9 = {__0 = {__0 = 5, __1 = {a = 6, b = 7.5}}, __1 = {__0 = {a = 6, b = 7.5}, __1 = 5}}
// gdbg-check:$9 = {__0 = {__0 = 5, __1 = {a = 6, b = 7.5}}, __1 = {__0 = {a = 6, b = 7.5}, __1 = 5}}
// gdbr-check:$9 = ((5, generic_function::Struct {a: 6, b: 7.5}), (generic_function::Struct {a: 6, b: 7.5}, 5))
// gdb-command:continue

View File

@ -18,7 +18,8 @@
// STACK BY REF
// gdb-command:print *self
// gdb-check:$1 = {x = {__0 = 8888, __1 = -8888}}
// gdbg-check:$1 = {x = {__0 = 8888, __1 = -8888}}
// gdbr-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
@ -27,7 +28,8 @@
// STACK BY VAL
// gdb-command:print self
// gdb-check:$4 = {x = {__0 = 8888, __1 = -8888}}
// gdbg-check:$4 = {x = {__0 = 8888, __1 = -8888}}
// gdbr-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
@ -36,7 +38,8 @@
// OWNED BY REF
// gdb-command:print *self
// gdb-check:$7 = {x = 1234.5}
// gdbg-check:$7 = {x = 1234.5}
// gdbr-check:$7 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5}
// gdb-command:print arg1
// gdb-check:$8 = -5
// gdb-command:print arg2
@ -45,7 +48,8 @@
// OWNED BY VAL
// gdb-command:print self
// gdb-check:$10 = {x = 1234.5}
// gdbg-check:$10 = {x = 1234.5}
// gdbr-check:$10 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5}
// gdb-command:print arg1
// gdb-check:$11 = -7
// gdb-command:print arg2
@ -54,7 +58,8 @@
// OWNED MOVED
// gdb-command:print *self
// gdb-check:$13 = {x = 1234.5}
// gdbg-check:$13 = {x = 1234.5}
// gdbr-check:$13 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5}
// gdb-command:print arg1
// gdb-check:$14 = -9
// gdb-command:print arg2

View File

@ -17,16 +17,20 @@
// gdb-command:run
// gdb-command:print case1
// gdb-check:$1 = {{RUST$ENUM$DISR = Case1, a = 0, b = 31868, c = 31868, d = 31868, e = 31868}, {RUST$ENUM$DISR = Case1, a = 0, b = 2088533116, c = 2088533116}, {RUST$ENUM$DISR = Case1, a = 0, b = 8970181431921507452}}
// gdbg-check:$1 = {{RUST$ENUM$DISR = Case1, a = 0, b = 31868, c = 31868, d = 31868, e = 31868}, {RUST$ENUM$DISR = Case1, a = 0, b = 2088533116, c = 2088533116}, {RUST$ENUM$DISR = Case1, a = 0, b = 8970181431921507452}}
// gdbr-check:$1 = generic_struct_style_enum::Regular::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868}
// gdb-command:print case2
// gdb-check:$2 = {{RUST$ENUM$DISR = Case2, a = 0, b = 4369, c = 4369, d = 4369, e = 4369}, {RUST$ENUM$DISR = Case2, a = 0, b = 286331153, c = 286331153}, {RUST$ENUM$DISR = Case2, a = 0, b = 1229782938247303441}}
// gdbg-check:$2 = {{RUST$ENUM$DISR = Case2, a = 0, b = 4369, c = 4369, d = 4369, e = 4369}, {RUST$ENUM$DISR = Case2, a = 0, b = 286331153, c = 286331153}, {RUST$ENUM$DISR = Case2, a = 0, b = 1229782938247303441}}
// gdbr-check:$2 = generic_struct_style_enum::Regular::Case2{a: 0, b: 286331153, c: 286331153}
// gdb-command:print case3
// gdb-check:$3 = {{RUST$ENUM$DISR = Case3, a = 0, b = 22873, c = 22873, d = 22873, e = 22873}, {RUST$ENUM$DISR = Case3, a = 0, b = 1499027801, c = 1499027801}, {RUST$ENUM$DISR = Case3, a = 0, b = 6438275382588823897}}
// gdbg-check:$3 = {{RUST$ENUM$DISR = Case3, a = 0, b = 22873, c = 22873, d = 22873, e = 22873}, {RUST$ENUM$DISR = Case3, a = 0, b = 1499027801, c = 1499027801}, {RUST$ENUM$DISR = Case3, a = 0, b = 6438275382588823897}}
// gdbr-check:$3 = generic_struct_style_enum::Regular::Case3{a: 0, b: 6438275382588823897}
// gdb-command:print univariant
// gdb-check:$4 = {{a = -1}}
// gdbg-check:$4 = {{a = -1}}
// gdbr-check:$4 = generic_struct_style_enum::Univariant<i32>::TheOnlyCase{a: -1}
#![feature(omit_gdb_pretty_printer_section)]

View File

@ -18,13 +18,17 @@
// gdb-command:run
// gdb-command:print int_int
// gdb-check:$1 = {key = 0, value = 1}
// gdbg-check:$1 = {key = 0, value = 1}
// gdbr-check:$1 = generic_struct::AGenericStruct<i32, i32> {key: 0, value: 1}
// gdb-command:print int_float
// gdb-check:$2 = {key = 2, value = 3.5}
// gdbg-check:$2 = {key = 2, value = 3.5}
// gdbr-check:$2 = generic_struct::AGenericStruct<i32, f64> {key: 2, value: 3.5}
// gdb-command:print float_int
// gdb-check:$3 = {key = 4.5, value = 5}
// gdbg-check:$3 = {key = 4.5, value = 5}
// gdbr-check:$3 = generic_struct::AGenericStruct<f64, i32> {key: 4.5, value: 5}
// gdb-command:print float_int_float
// gdb-check:$4 = {key = 6.5, value = {key = 7, value = 8.5}}
// 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}}
// === LLDB TESTS ==================================================================================

View File

@ -19,16 +19,20 @@
// gdb-command:run
// gdb-command:print case1
// gdb-check:$1 = {{RUST$ENUM$DISR = Case1, __0 = 0, __1 = 31868, __2 = 31868, __3 = 31868, __4 = 31868}, {RUST$ENUM$DISR = Case1, __0 = 0, __1 = 2088533116, __2 = 2088533116}, {RUST$ENUM$DISR = Case1, __0 = 0, __1 = 8970181431921507452}}
// gdbg-check:$1 = {{RUST$ENUM$DISR = Case1, __0 = 0, __1 = 31868, __2 = 31868, __3 = 31868, __4 = 31868}, {RUST$ENUM$DISR = Case1, __0 = 0, __1 = 2088533116, __2 = 2088533116}, {RUST$ENUM$DISR = Case1, __0 = 0, __1 = 8970181431921507452}}
// gdbr-check:$1 = generic_tuple_style_enum::Regular::Case1(0, 31868, 31868, 31868, 31868)
// gdb-command:print case2
// gdb-check:$2 = {{RUST$ENUM$DISR = Case2, __0 = 0, __1 = 4369, __2 = 4369, __3 = 4369, __4 = 4369}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 286331153, __2 = 286331153}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 1229782938247303441}}
// gdbg-check:$2 = {{RUST$ENUM$DISR = Case2, __0 = 0, __1 = 4369, __2 = 4369, __3 = 4369, __4 = 4369}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 286331153, __2 = 286331153}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 1229782938247303441}}
// gdbr-check:$2 = generic_tuple_style_enum::Regular::Case2(0, 286331153, 286331153)
// gdb-command:print case3
// gdb-check:$3 = {{RUST$ENUM$DISR = Case3, __0 = 0, __1 = 22873, __2 = 22873, __3 = 22873, __4 = 22873}, {RUST$ENUM$DISR = Case3, __0 = 0, __1 = 1499027801, __2 = 1499027801}, {RUST$ENUM$DISR = Case3, __0 = 0, __1 = 6438275382588823897}}
// gdbg-check:$3 = {{RUST$ENUM$DISR = Case3, __0 = 0, __1 = 22873, __2 = 22873, __3 = 22873, __4 = 22873}, {RUST$ENUM$DISR = Case3, __0 = 0, __1 = 1499027801, __2 = 1499027801}, {RUST$ENUM$DISR = Case3, __0 = 0, __1 = 6438275382588823897}}
// gdbr-check:$3 = generic_tuple_style_enum::Regular::Case3(0, 6438275382588823897)
// gdb-command:print univariant
// gdb-check:$4 = {{__0 = -1}}
// gdbg-check:$4 = {{__0 = -1}}
// gdbr-check:$4 = generic_tuple_style_enum::Univariant<i64>::TheOnlyCase(-1)
// === LLDB TESTS ==================================================================================

View File

@ -16,7 +16,8 @@
// gdb-command:run
// gdb-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
// gdb-check:$1 = 0
// STRUCT EXPRESSION
@ -28,7 +29,8 @@
// gdb-command:print val
// gdb-check:$4 = 11
// gdb-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
// gdb-check:$5 = 1
// gdb-command:print ten
// gdb-check:$6 = 10
@ -49,7 +51,8 @@
// gdb-command:print val
// gdb-check:$11 = 12
// gdb-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
// gdb-check:$12 = 2
// gdb-command:print ten
// gdb-check:$13 = 10
@ -70,7 +73,8 @@
// gdb-command:print val
// gdb-check:$18 = 13
// gdb-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
// gdb-check:$19 = 3
// gdb-command:print ten
// gdb-check:$20 = 10
@ -91,7 +95,8 @@
// gdb-command:print val
// gdb-check:$25 = 14
// gdb-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
// gdb-check:$26 = 4
// gdb-command:print ten
// gdb-check:$27 = 10
@ -112,7 +117,8 @@
// gdb-command:print val
// gdb-check:$32 = 15
// gdb-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
// gdb-check:$33 = 5
// gdb-command:print ten
// gdb-check:$34 = 10
@ -133,7 +139,8 @@
// gdb-command:print val
// gdb-check:$39 = 16
// gdb-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
// gdb-check:$40 = 6
// gdb-command:print ten
// gdb-check:$41 = 10
@ -155,7 +162,8 @@
// gdb-command:print val
// gdb-check:$46 = 17
// gdb-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
// gdb-check:$47 = 7
// gdb-command:print ten
// gdb-check:$48 = 10
@ -176,7 +184,8 @@
// gdb-command:print val
// gdb-check:$53 = 18
// gdb-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbg-command:print 'lexical_scopes_in_block_expression::MUT_INT'
// gdbr-command:print lexical_scopes_in_block_expression::MUT_INT
// gdb-check:$54 = 8
// gdb-command:print ten
// gdb-check:$55 = 10

View File

@ -19,7 +19,8 @@
// STACK BY REF
// gdb-command:print *self
// gdb-check:$1 = {{RUST$ENUM$DISR = Variant2, [...]}, {RUST$ENUM$DISR = Variant2, __0 = 117901063}}
// gdbg-check:$1 = {{RUST$ENUM$DISR = Variant2, [...]}, {RUST$ENUM$DISR = Variant2, __0 = 117901063}}
// gdbr-check:$1 = method_on_enum::Enum::Variant2(117901063)
// gdb-command:print arg1
// gdb-check:$2 = -1
// gdb-command:print arg2
@ -28,7 +29,8 @@
// STACK BY VAL
// gdb-command:print self
// gdb-check:$4 = {{RUST$ENUM$DISR = Variant2, [...]}, {RUST$ENUM$DISR = Variant2, __0 = 117901063}}
// gdbg-check:$4 = {{RUST$ENUM$DISR = Variant2, [...]}, {RUST$ENUM$DISR = Variant2, __0 = 117901063}}
// gdbr-check:$4 = method_on_enum::Enum::Variant2(117901063)
// gdb-command:print arg1
// gdb-check:$5 = -3
// gdb-command:print arg2
@ -37,7 +39,8 @@
// OWNED BY REF
// gdb-command:print *self
// gdb-check:$7 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
// gdbg-check:$7 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
// gdbr-check:$7 = method_on_enum::Enum::Variant1{x: 1799, y: 1799}
// gdb-command:print arg1
// gdb-check:$8 = -5
// gdb-command:print arg2
@ -46,7 +49,8 @@
// OWNED BY VAL
// gdb-command:print self
// gdb-check:$10 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
// gdbg-check:$10 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
// gdbr-check:$10 = method_on_enum::Enum::Variant1{x: 1799, y: 1799}
// gdb-command:print arg1
// gdb-check:$11 = -7
// gdb-command:print arg2
@ -55,7 +59,8 @@
// OWNED MOVED
// gdb-command:print *self
// gdb-check:$13 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
// gdbg-check:$13 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
// gdbr-check:$13 = method_on_enum::Enum::Variant1{x: 1799, y: 1799}
// gdb-command:print arg1
// gdb-check:$14 = -9
// gdb-command:print arg2

View File

@ -18,7 +18,8 @@
// STACK BY REF
// gdb-command:print *self
// gdb-check:$1 = {x = {__0 = 8888, __1 = -8888}}
// gdbg-check:$1 = {x = {__0 = 8888, __1 = -8888}}
// gdbr-check:$1 = method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)}
// gdb-command:print arg1
// gdb-check:$2 = -1
// gdb-command:print arg2
@ -27,7 +28,8 @@
// STACK BY VAL
// gdb-command:print self
// gdb-check:$4 = {x = {__0 = 8888, __1 = -8888}}
// gdbg-check:$4 = {x = {__0 = 8888, __1 = -8888}}
// gdbr-check:$4 = method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)}
// gdb-command:print arg1
// gdb-check:$5 = -3
// gdb-command:print arg2
@ -36,7 +38,8 @@
// OWNED BY REF
// gdb-command:print *self
// gdb-check:$7 = {x = 1234.5}
// gdbg-check:$7 = {x = 1234.5}
// gdbr-check:$7 = method_on_generic_struct::Struct<f64> {x: 1234.5}
// gdb-command:print arg1
// gdb-check:$8 = -5
// gdb-command:print arg2
@ -45,7 +48,8 @@
// OWNED BY VAL
// gdb-command:print self
// gdb-check:$10 = {x = 1234.5}
// gdbg-check:$10 = {x = 1234.5}
// gdbr-check:$10 = method_on_generic_struct::Struct<f64> {x: 1234.5}
// gdb-command:print arg1
// gdb-check:$11 = -7
// gdb-command:print arg2
@ -54,7 +58,8 @@
// OWNED MOVED
// gdb-command:print *self
// gdb-check:$13 = {x = 1234.5}
// gdbg-check:$13 = {x = 1234.5}
// gdbr-check:$13 = method_on_generic_struct::Struct<f64> {x: 1234.5}
// gdb-command:print arg1
// gdb-check:$14 = -9
// gdb-command:print arg2

View File

@ -18,7 +18,8 @@
// STACK BY REF
// gdb-command:print *self
// gdb-check:$1 = {x = 100}
// gdbg-check:$1 = {x = 100}
// gdbr-check:$1 = method_on_struct::Struct {x: 100}
// gdb-command:print arg1
// gdb-check:$2 = -1
// gdb-command:print arg2
@ -27,7 +28,8 @@
// STACK BY VAL
// gdb-command:print self
// gdb-check:$4 = {x = 100}
// gdbg-check:$4 = {x = 100}
// gdbr-check:$4 = method_on_struct::Struct {x: 100}
// gdb-command:print arg1
// gdb-check:$5 = -3
// gdb-command:print arg2
@ -36,7 +38,8 @@
// OWNED BY REF
// gdb-command:print *self
// gdb-check:$7 = {x = 200}
// gdbg-check:$7 = {x = 200}
// gdbr-check:$7 = method_on_struct::Struct {x: 200}
// gdb-command:print arg1
// gdb-check:$8 = -5
// gdb-command:print arg2
@ -45,7 +48,8 @@
// OWNED BY VAL
// gdb-command:print self
// gdb-check:$10 = {x = 200}
// gdbg-check:$10 = {x = 200}
// gdbr-check:$10 = method_on_struct::Struct {x: 200}
// gdb-command:print arg1
// gdb-check:$11 = -7
// gdb-command:print arg2
@ -54,7 +58,8 @@
// OWNED MOVED
// gdb-command:print *self
// gdb-check:$13 = {x = 200}
// gdbg-check:$13 = {x = 200}
// gdbr-check:$13 = method_on_struct::Struct {x: 200}
// gdb-command:print arg1
// gdb-check:$14 = -9
// gdb-command:print arg2

View File

@ -18,7 +18,8 @@
// STACK BY REF
// gdb-command:print *self
// gdb-check:$1 = {x = 100}
// gdbg-check:$1 = {x = 100}
// gdbr-check:$1 = method_on_trait::Struct {x: 100}
// gdb-command:print arg1
// gdb-check:$2 = -1
// gdb-command:print arg2
@ -27,7 +28,8 @@
// STACK BY VAL
// gdb-command:print self
// gdb-check:$4 = {x = 100}
// gdbg-check:$4 = {x = 100}
// gdbr-check:$4 = method_on_trait::Struct {x: 100}
// gdb-command:print arg1
// gdb-check:$5 = -3
// gdb-command:print arg2
@ -36,7 +38,8 @@
// OWNED BY REF
// gdb-command:print *self
// gdb-check:$7 = {x = 200}
// gdbg-check:$7 = {x = 200}
// gdbr-check:$7 = method_on_trait::Struct {x: 200}
// gdb-command:print arg1
// gdb-check:$8 = -5
// gdb-command:print arg2
@ -45,7 +48,8 @@
// OWNED BY VAL
// gdb-command:print self
// gdb-check:$10 = {x = 200}
// gdbg-check:$10 = {x = 200}
// gdbr-check:$10 = method_on_trait::Struct {x: 200}
// gdb-command:print arg1
// gdb-check:$11 = -7
// gdb-command:print arg2
@ -54,7 +58,8 @@
// OWNED MOVED
// gdb-command:print *self
// gdb-check:$13 = {x = 200}
// gdbg-check:$13 = {x = 200}
// gdbr-check:$13 = method_on_trait::Struct {x: 200}
// gdb-command:print arg1
// gdb-check:$14 = -9
// gdb-command:print arg2

View File

@ -18,7 +18,8 @@
// STACK BY REF
// gdb-command:print *self
// gdb-check:$1 = {__0 = 100, __1 = -100.5}
// gdbg-check:$1 = {__0 = 100, __1 = -100.5}
// gdbr-check:$1 = method_on_tuple_struct::TupleStruct (100, -100.5)
// gdb-command:print arg1
// gdb-check:$2 = -1
// gdb-command:print arg2
@ -27,7 +28,8 @@
// STACK BY VAL
// gdb-command:print self
// gdb-check:$4 = {__0 = 100, __1 = -100.5}
// gdbg-check:$4 = {__0 = 100, __1 = -100.5}
// gdbr-check:$4 = method_on_tuple_struct::TupleStruct (100, -100.5)
// gdb-command:print arg1
// gdb-check:$5 = -3
// gdb-command:print arg2
@ -36,7 +38,8 @@
// OWNED BY REF
// gdb-command:print *self
// gdb-check:$7 = {__0 = 200, __1 = -200.5}
// gdbg-check:$7 = {__0 = 200, __1 = -200.5}
// gdbr-check:$7 = method_on_tuple_struct::TupleStruct (200, -200.5)
// gdb-command:print arg1
// gdb-check:$8 = -5
// gdb-command:print arg2
@ -45,7 +48,8 @@
// OWNED BY VAL
// gdb-command:print self
// gdb-check:$10 = {__0 = 200, __1 = -200.5}
// gdbg-check:$10 = {__0 = 200, __1 = -200.5}
// gdbr-check:$10 = method_on_tuple_struct::TupleStruct (200, -200.5)
// gdb-command:print arg1
// gdb-check:$11 = -7
// gdb-command:print arg2
@ -54,7 +58,8 @@
// OWNED MOVED
// gdb-command:print *self
// gdb-check:$13 = {__0 = 200, __1 = -200.5}
// gdbg-check:$13 = {__0 = 200, __1 = -200.5}
// gdbr-check:$13 = method_on_tuple_struct::TupleStruct (200, -200.5)
// gdb-command:print arg1
// gdb-check:$14 = -9
// gdb-command:print arg2

View File

@ -16,10 +16,12 @@
// gdb-command:run
// gdb-command:print first
// gdb-check:$1 = {<No data fields>}
// gdbg-check:$1 = {<No data fields>}
// gdbr-check:$1 = <error reading variable>
// gdb-command:print second
// gdb-check:$2 = {<No data fields>}
// gdbg-check:$2 = {<No data fields>}
// gdbr-check:$2 = <error reading variable>
#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
@ -28,8 +30,9 @@
enum ANilEnum {}
enum AnotherNilEnum {}
// This test relies on gdb printing the string "{<No data fields>}" for empty
// This test relies on gdbg printing the string "{<No data fields>}" for empty
// structs (which may change some time)
// The error from gdbr is expected since nil enums are not supposed to exist.
fn main() {
unsafe {
let first: ANilEnum = ::std::mem::zeroed();

View File

@ -18,28 +18,36 @@
// gdb-command:run
// gdb-command:print some
// gdb-check:$1 = {RUST$ENCODED$ENUM$0$None = {__0 = 0x12345678}}
// gdbg-check:$1 = {RUST$ENCODED$ENUM$0$None = {__0 = 0x12345678}}
// gdbr-check:$1 = core::option::Option<&u32>::Some(0x12345678)
// gdb-command:print none
// gdb-check:$2 = {RUST$ENCODED$ENUM$0$None = {__0 = 0x0}}
// gdbg-check:$2 = {RUST$ENCODED$ENUM$0$None = {__0 = 0x0}}
// gdbr-check:$2 = core::option::Option<&u32>::None
// gdb-command:print full
// gdb-check:$3 = {RUST$ENCODED$ENUM$1$Empty = {__0 = 454545, __1 = 0x87654321, __2 = 9988}}
// gdbg-check:$3 = {RUST$ENCODED$ENUM$1$Empty = {__0 = 454545, __1 = 0x87654321, __2 = 9988}}
// gdbr-check:$3 = option_like_enum::MoreFields::Full(454545, 0x87654321, 9988)
// gdb-command:print empty_gdb->discr
// gdbg-command:print empty_gdb->discr
// gdbr-command:print empty_gdb.discr
// gdb-check:$4 = (isize *) 0x0
// gdb-command:print droid
// gdb-check:$5 = {RUST$ENCODED$ENUM$2$Void = {id = 675675, range = 10000001, internals = 0x43218765}}
// gdbg-check:$5 = {RUST$ENCODED$ENUM$2$Void = {id = 675675, range = 10000001, internals = 0x43218765}}
// gdbr-check:$5 = option_like_enum::NamedFields::Droid{id: 675675, range: 10000001, internals: 0x43218765}
// gdb-command:print void_droid_gdb->internals
// gdbg-command:print void_droid_gdb->internals
// gdbr-command:print void_droid_gdb.internals
// gdb-check:$6 = (isize *) 0x0
// gdb-command:print nested_non_zero_yep
// gdb-check:$7 = {RUST$ENCODED$ENUM$1$2$Nope = {__0 = 10.5, __1 = {a = 10, b = 20, c = [...]}}}
// gdbg-check:$7 = {RUST$ENCODED$ENUM$1$2$Nope = {__0 = 10.5, __1 = {a = 10, b = 20, c = [...]}}}
// gdbr-check:$7 = option_like_enum::NestedNonZero::Yep(10.5, option_like_enum::NestedNonZeroField {a: 10, b: 20, c: 0x[...] "x[...]"})
// gdb-command:print nested_non_zero_nope
// gdb-check:$8 = {RUST$ENCODED$ENUM$1$2$Nope = {__0 = [...], __1 = {a = [...], b = [...], c = 0x0}}}
// gdbg-check:$8 = {RUST$ENCODED$ENUM$1$2$Nope = {__0 = [...], __1 = {a = [...], b = [...], c = 0x0}}}
// gdbr-check:$8 = option_like_enum::NestedNonZero::Nope
// gdb-command:continue

View File

@ -18,29 +18,37 @@
// gdb-command:run
// gdb-command:print packed
// gdb-check:$1 = {x = 123, y = 234, z = 345}
// gdbg-check:$1 = {x = 123, y = 234, z = 345}
// gdbr-check:$1 = packed_struct_with_destructor::Packed {x: 123, y: 234, z: 345}
// gdb-command:print packedInPacked
// gdb-check:$2 = {a = 1111, b = {x = 2222, y = 3333, z = 4444}, c = 5555, d = {x = 6666, y = 7777, z = 8888}}
// gdbg-check:$2 = {a = 1111, b = {x = 2222, y = 3333, z = 4444}, c = 5555, d = {x = 6666, y = 7777, z = 8888}}
// gdbr-check:$2 = packed_struct_with_destructor::PackedInPacked {a: 1111, b: packed_struct_with_destructor::Packed {x: 2222, y: 3333, z: 4444}, c: 5555, d: packed_struct_with_destructor::Packed {x: 6666, y: 7777, z: 8888}}
// gdb-command:print packedInUnpacked
// gdb-check:$3 = {a = -1111, b = {x = -2222, y = -3333, z = -4444}, c = -5555, d = {x = -6666, y = -7777, z = -8888}}
// gdbg-check:$3 = {a = -1111, b = {x = -2222, y = -3333, z = -4444}, c = -5555, d = {x = -6666, y = -7777, z = -8888}}
// gdbr-check:$3 = packed_struct_with_destructor::PackedInUnpacked {a: -1111, b: packed_struct_with_destructor::Packed {x: -2222, y: -3333, z: -4444}, c: -5555, d: packed_struct_with_destructor::Packed {x: -6666, y: -7777, z: -8888}}
// gdb-command:print unpackedInPacked
// gdb-check:$4 = {a = 987, b = {x = 876, y = 765, z = 654}, c = {x = 543, y = 432, z = 321}, d = 210}
// gdbg-check:$4 = {a = 987, b = {x = 876, y = 765, z = 654}, c = {x = 543, y = 432, z = 321}, d = 210}
// gdbr-check:$4 = packed_struct_with_destructor::UnpackedInPacked {a: 987, b: packed_struct_with_destructor::Unpacked {x: 876, y: 765, z: 654}, c: packed_struct_with_destructor::Unpacked {x: 543, y: 432, z: 321}, d: 210}
// gdb-command:print packedInPackedWithDrop
// gdb-check:$5 = {a = 11, b = {x = 22, y = 33, z = 44}, c = 55, d = {x = 66, y = 77, z = 88}}
// gdbg-check:$5 = {a = 11, b = {x = 22, y = 33, z = 44}, c = 55, d = {x = 66, y = 77, z = 88}}
// gdbr-check:$5 = packed_struct_with_destructor::PackedInPackedWithDrop {a: 11, b: packed_struct_with_destructor::Packed {x: 22, y: 33, z: 44}, c: 55, d: packed_struct_with_destructor::Packed {x: 66, y: 77, z: 88}}
// gdb-command:print packedInUnpackedWithDrop
// gdb-check:$6 = {a = -11, b = {x = -22, y = -33, z = -44}, c = -55, d = {x = -66, y = -77, z = -88}}
// gdbg-check:$6 = {a = -11, b = {x = -22, y = -33, z = -44}, c = -55, d = {x = -66, y = -77, z = -88}}
// gdbr-check:$6 = packed_struct_with_destructor::PackedInUnpackedWithDrop {a: -11, b: packed_struct_with_destructor::Packed {x: -22, y: -33, z: -44}, c: -55, d: packed_struct_with_destructor::Packed {x: -66, y: -77, z: -88}}
// gdb-command:print unpackedInPackedWithDrop
// gdb-check:$7 = {a = 98, b = {x = 87, y = 76, z = 65}, c = {x = 54, y = 43, z = 32}, d = 21}
// gdbg-check:$7 = {a = 98, b = {x = 87, y = 76, z = 65}, c = {x = 54, y = 43, z = 32}, d = 21}
// gdbr-check:$7 = packed_struct_with_destructor::UnpackedInPackedWithDrop {a: 98, b: packed_struct_with_destructor::Unpacked {x: 87, y: 76, z: 65}, c: packed_struct_with_destructor::Unpacked {x: 54, y: 43, z: 32}, d: 21}
// gdb-command:print deeplyNested
// gdb-check:$8 = {a = {a = 1, b = {x = 2, y = 3, z = 4}, c = 5, d = {x = 6, y = 7, z = 8}}, b = {a = 9, b = {x = 10, y = 11, z = 12}, c = {x = 13, y = 14, z = 15}, d = 16}, c = {a = 17, b = {x = 18, y = 19, z = 20}, c = 21, d = {x = 22, y = 23, z = 24}}, d = {a = 25, b = {x = 26, y = 27, z = 28}, c = 29, d = {x = 30, y = 31, z = 32}}, e = {a = 33, b = {x = 34, y = 35, z = 36}, c = {x = 37, y = 38, z = 39}, d = 40}, f = {a = 41, b = {x = 42, y = 43, z = 44}, c = 45, d = {x = 46, y = 47, z = 48}}}
// gdbg-check:$8 = {a = {a = 1, b = {x = 2, y = 3, z = 4}, c = 5, d = {x = 6, y = 7, z = 8}}, b = {a = 9, b = {x = 10, y = 11, z = 12}, c = {x = 13, y = 14, z = 15}, d = 16}, c = {a = 17, b = {x = 18, y = 19, z = 20}, c = 21, d = {x = 22, y = 23, z = 24}}, d = {a = 25, b = {x = 26, y = 27, z = 28}, c = 29, d = {x = 30, y = 31, z = 32}}, e = {a = 33, b = {x = 34, y = 35, z = 36}, c = {x = 37, y = 38, z = 39}, d = 40}, f = {a = 41, b = {x = 42, y = 43, z = 44}, c = 45, d = {x = 46, y = 47, z = 48}}}
// gdbr-check:$8 = packed_struct_with_destructor::DeeplyNested {a: packed_struct_with_destructor::PackedInPacked {a: 1, b: packed_struct_with_destructor::Packed {x: 2, y: 3, z: 4}, c: 5, d: packed_struct_with_destructor::Packed {x: 6, y: 7, z: 8}}, b: packed_struct_with_destructor::UnpackedInPackedWithDrop {a: 9, b: packed_struct_with_destructor::Unpacked {x: 10, y: 11, z: 12}, c: packed_struct_with_destructor::Unpacked {x: 13, y: 14, z: 15}, d: 16}, c: packed_struct_with_destructor::PackedInUnpacked {a: 17, b: packed_struct_with_destructor::Packed {x: 18, y: 19, z: 20}, c: 21, d: packed_struct_with_destructor::Packed {x: 22, y: 23, z: 24}}, d: packed_struct_with_destructor::PackedInUnpackedWithDrop {a: 25, b: packed_struct_with_destructor::Packed {x: 26, y: 27, z: 28}, c: 29, d: packed_struct_with_destructor::Packed {x: 30, y: 31, z: 32}}, e: packed_struct_with_destructor::UnpackedInPacked {a: 33, b: packed_struct_with_destructor::Unpacked {x: 34, y: 35, z: 36}, c: packed_struct_with_destructor::Unpacked {x: 37, y: 38, z: 39}, d: 40}, f: packed_struct_with_destructor::PackedInPackedWithDrop {a: 41, b: packed_struct_with_destructor::Packed {x: 42, y: 43, z: 44}, c: 45, d: packed_struct_with_destructor::Packed {x: 46, y: 47, z: 48}}}
// === LLDB TESTS ==================================================================================

View File

@ -18,16 +18,20 @@
// gdb-command:run
// gdb-command:print packed
// gdb-check:$1 = {x = 123, y = 234, z = 345}
// gdbg-check:$1 = {x = 123, y = 234, z = 345}
// gdbr-check:$1 = packed_struct::Packed {x: 123, y: 234, z: 345}
// gdb-command:print packedInPacked
// gdb-check:$2 = {a = 1111, b = {x = 2222, y = 3333, z = 4444}, c = 5555, d = {x = 6666, y = 7777, z = 8888}}
// gdbg-check:$2 = {a = 1111, b = {x = 2222, y = 3333, z = 4444}, c = 5555, d = {x = 6666, y = 7777, z = 8888}}
// gdbr-check:$2 = packed_struct::PackedInPacked {a: 1111, b: packed_struct::Packed {x: 2222, y: 3333, z: 4444}, c: 5555, d: packed_struct::Packed {x: 6666, y: 7777, z: 8888}}
// gdb-command:print packedInUnpacked
// gdb-check:$3 = {a = -1111, b = {x = -2222, y = -3333, z = -4444}, c = -5555, d = {x = -6666, y = -7777, z = -8888}}
// gdbg-check:$3 = {a = -1111, b = {x = -2222, y = -3333, z = -4444}, c = -5555, d = {x = -6666, y = -7777, z = -8888}}
// gdbr-check:$3 = packed_struct::PackedInUnpacked {a: -1111, b: packed_struct::Packed {x: -2222, y: -3333, z: -4444}, c: -5555, d: packed_struct::Packed {x: -6666, y: -7777, z: -8888}}
// gdb-command:print unpackedInPacked
// gdb-check:$4 = {a = 987, b = {x = 876, y = 765, z = 654, w = 543}, c = {x = 432, y = 321, z = 210, w = 109}, d = -98}
// gdbg-check:$4 = {a = 987, b = {x = 876, y = 765, z = 654, w = 543}, c = {x = 432, y = 321, z = 210, w = 109}, d = -98}
// gdbr-check:$4 = packed_struct::UnpackedInPacked {a: 987, b: packed_struct::Unpacked {x: 876, y: 765, z: 654, w: 543}, c: packed_struct::Unpacked {x: 432, y: 321, z: 210, w: 109}, d: -98}
// gdb-command:print sizeof(packed)
// gdb-check:$5 = 14

View File

@ -35,7 +35,8 @@
// gdb-check:$5 = Some = {8}
// gdb-command: print none
// gdb-check:$6 = None
// gdbg-check:$6 = None
// gdbr-check:$6 = core::option::Option::None
// === LLDB TESTS ==================================================================================

View File

@ -12,57 +12,72 @@
// ignore-lldb
// compile-flags:-g
// gdb-command:run
// gdb-command:print stack_unique.value
// gdb-check:$1 = 0
// gdb-command:print stack_unique.next.RUST$ENCODED$ENUM$0$Empty.val->value
// gdbg-command:print stack_unique.next.RUST$ENCODED$ENUM$0$Empty.val->value
// gdbr-command:print stack_unique.next.val.value
// gdb-check:$2 = 1
// gdb-command:print unique_unique->value
// gdbg-command:print unique_unique->value
// gdbr-command:print unique_unique.value
// gdb-check:$3 = 2
// gdb-command:print unique_unique->next.RUST$ENCODED$ENUM$0$Empty.val->value
// gdbg-command:print unique_unique->next.RUST$ENCODED$ENUM$0$Empty.val->value
// gdbr-command:print unique_unique.next.val.value
// gdb-check:$4 = 3
// gdb-command:print vec_unique[0].value
// gdb-check:$5 = 6.5
// gdb-command:print vec_unique[0].next.RUST$ENCODED$ENUM$0$Empty.val->value
// gdbg-command:print vec_unique[0].next.RUST$ENCODED$ENUM$0$Empty.val->value
// gdbr-command:print vec_unique[0].next.val.value
// gdb-check:$6 = 7.5
// gdb-command:print borrowed_unique->value
// gdbg-command:print borrowed_unique->value
// gdbr-command:print borrowed_unique.value
// gdb-check:$7 = 8.5
// gdb-command:print borrowed_unique->next.RUST$ENCODED$ENUM$0$Empty.val->value
// gdbg-command:print borrowed_unique->next.RUST$ENCODED$ENUM$0$Empty.val->value
// gdbr-command:print borrowed_unique.next.val.value
// gdb-check:$8 = 9.5
// LONG CYCLE
// gdb-command:print long_cycle1.value
// gdb-check:$9 = 20
// gdb-command:print long_cycle1.next->value
// gdbg-command:print long_cycle1.next->value
// gdbr-command:print long_cycle1.next.value
// gdb-check:$10 = 21
// gdb-command:print long_cycle1.next->next->value
// gdbg-command:print long_cycle1.next->next->value
// gdbr-command:print long_cycle1.next.next.value
// gdb-check:$11 = 22
// gdb-command:print long_cycle1.next->next->next->value
// gdbg-command:print long_cycle1.next->next->next->value
// gdbr-command:print long_cycle1.next.next.next.value
// gdb-check:$12 = 23
// gdb-command:print long_cycle2.value
// gdb-check:$13 = 24
// gdb-command:print long_cycle2.next->value
// gdbg-command:print long_cycle2.next->value
// gdbr-command:print long_cycle2.next.value
// gdb-check:$14 = 25
// gdb-command:print long_cycle2.next->next->value
// gdbg-command:print long_cycle2.next->next->value
// gdbr-command:print long_cycle2.next.next.value
// gdb-check:$15 = 26
// gdb-command:print long_cycle3.value
// gdb-check:$16 = 27
// gdb-command:print long_cycle3.next->value
// gdbg-command:print long_cycle3.next->value
// gdbr-command:print long_cycle3.next.value
// gdb-check:$17 = 28
// gdb-command:print long_cycle4.value
// gdb-check:$18 = 29.5
// gdb-command:print (*****long_cycle_w_anonymous_types).value
// gdbg-command:print (*****long_cycle_w_anonymous_types).value
// gdbr-command:print long_cycle_w_anonymous_types.value
// gdb-check:$19 = 30
// gdb-command:print (*****((*****long_cycle_w_anonymous_types).next.RUST$ENCODED$ENUM$0$Empty.val)).value
// gdbg-command:print (*****((*****long_cycle_w_anonymous_types).next.RUST$ENCODED$ENUM$0$Empty.val)).value
// gdbr-command:print long_cycle_w_anonymous_types.next.val.value
// gdb-check:$20 = 31
// gdb-command:continue

View File

@ -18,7 +18,8 @@
// STACK BY REF
// gdb-command:print *self
// gdb-check:$1 = {x = 100}
// gdbg-check:$1 = {x = 100}
// gdbr-check:$1 = self_in_default_method::Struct {x: 100}
// gdb-command:print arg1
// gdb-check:$2 = -1
// gdb-command:print arg2
@ -27,7 +28,8 @@
// STACK BY VAL
// gdb-command:print self
// gdb-check:$4 = {x = 100}
// gdbg-check:$4 = {x = 100}
// gdbr-check:$4 = self_in_default_method::Struct {x: 100}
// gdb-command:print arg1
// gdb-check:$5 = -3
// gdb-command:print arg2
@ -36,7 +38,8 @@
// OWNED BY REF
// gdb-command:print *self
// gdb-check:$7 = {x = 200}
// gdbg-check:$7 = {x = 200}
// gdbr-check:$7 = self_in_default_method::Struct {x: 200}
// gdb-command:print arg1
// gdb-check:$8 = -5
// gdb-command:print arg2
@ -45,7 +48,8 @@
// OWNED BY VAL
// gdb-command:print self
// gdb-check:$10 = {x = 200}
// gdbg-check:$10 = {x = 200}
// gdbr-check:$10 = self_in_default_method::Struct {x: 200}
// gdb-command:print arg1
// gdb-check:$11 = -7
// gdb-command:print arg2
@ -54,7 +58,8 @@
// OWNED MOVED
// gdb-command:print *self
// gdb-check:$13 = {x = 200}
// gdbg-check:$13 = {x = 200}
// gdbr-check:$13 = self_in_default_method::Struct {x: 200}
// gdb-command:print arg1
// gdb-check:$14 = -9
// gdb-command:print arg2

View File

@ -18,7 +18,8 @@
// STACK BY REF
// gdb-command:print *self
// gdb-check:$1 = {x = 987}
// gdbg-check:$1 = {x = 987}
// gdbr-check:$1 = self_in_generic_default_method::Struct {x: 987}
// gdb-command:print arg1
// gdb-check:$2 = -1
// gdb-command:print arg2
@ -27,7 +28,8 @@
// STACK BY VAL
// gdb-command:print self
// gdb-check:$4 = {x = 987}
// gdbg-check:$4 = {x = 987}
// gdbr-check:$4 = self_in_generic_default_method::Struct {x: 987}
// gdb-command:print arg1
// gdb-check:$5 = -3
// gdb-command:print arg2
@ -36,7 +38,8 @@
// OWNED BY REF
// gdb-command:print *self
// gdb-check:$7 = {x = 879}
// gdbg-check:$7 = {x = 879}
// gdbr-check:$7 = self_in_generic_default_method::Struct {x: 879}
// gdb-command:print arg1
// gdb-check:$8 = -5
// gdb-command:print arg2
@ -45,7 +48,8 @@
// OWNED BY VAL
// gdb-command:print self
// gdb-check:$10 = {x = 879}
// gdbg-check:$10 = {x = 879}
// gdbr-check:$10 = self_in_generic_default_method::Struct {x: 879}
// gdb-command:print arg1
// gdb-check:$11 = -7
// gdb-command:print arg2
@ -54,7 +58,8 @@
// OWNED MOVED
// gdb-command:print *self
// gdb-check:$13 = {x = 879}
// gdbg-check:$13 = {x = 879}
// gdbr-check:$13 = self_in_generic_default_method::Struct {x: 879}
// gdb-command:print arg1
// gdb-check:$14 = -9
// gdb-command:print arg2

View File

@ -20,28 +20,46 @@
// compile-flags:-g
// gdb-command:run
// gdb-command:print/d vi8x16
// gdb-check:$1 = {__0 = 0, __1 = 1, __2 = 2, __3 = 3, __4 = 4, __5 = 5, __6 = 6, __7 = 7, __8 = 8, __9 = 9, __10 = 10, __11 = 11, __12 = 12, __13 = 13, __14 = 14, __15 = 15}
// gdb-command:print/d vi16x8
// gdb-check:$2 = {__0 = 16, __1 = 17, __2 = 18, __3 = 19, __4 = 20, __5 = 21, __6 = 22, __7 = 23}
// gdb-command:print/d vi32x4
// gdb-check:$3 = {__0 = 24, __1 = 25, __2 = 26, __3 = 27}
// gdb-command:print/d vi64x2
// gdb-check:$4 = {__0 = 28, __1 = 29}
// gdbg-command:print/d vi8x16
// gdbr-command:print vi8x16
// gdbg-check:$1 = {__0 = 0, __1 = 1, __2 = 2, __3 = 3, __4 = 4, __5 = 5, __6 = 6, __7 = 7, __8 = 8, __9 = 9, __10 = 10, __11 = 11, __12 = 12, __13 = 13, __14 = 14, __15 = 15}
// gdbr-check:$1 = simd::i8x16 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
// gdbg-command:print/d vi16x8
// gdbr-command:print vi16x8
// gdbg-check:$2 = {__0 = 16, __1 = 17, __2 = 18, __3 = 19, __4 = 20, __5 = 21, __6 = 22, __7 = 23}
// gdbr-check:$2 = simd::i16x8 (16, 17, 18, 19, 20, 21, 22, 23)
// gdbg-command:print/d vi32x4
// gdbr-command:print vi32x4
// gdbg-check:$3 = {__0 = 24, __1 = 25, __2 = 26, __3 = 27}
// gdbr-check:$3 = simd::i32x4 (24, 25, 26, 27)
// gdbg-command:print/d vi64x2
// gdbr-command:print vi64x2
// gdbg-check:$4 = {__0 = 28, __1 = 29}
// gdbr-check:$4 = simd::i64x2 (28, 29)
// gdb-command:print/d vu8x16
// gdb-check:$5 = {__0 = 30, __1 = 31, __2 = 32, __3 = 33, __4 = 34, __5 = 35, __6 = 36, __7 = 37, __8 = 38, __9 = 39, __10 = 40, __11 = 41, __12 = 42, __13 = 43, __14 = 44, __15 = 45}
// gdb-command:print/d vu16x8
// gdb-check:$6 = {__0 = 46, __1 = 47, __2 = 48, __3 = 49, __4 = 50, __5 = 51, __6 = 52, __7 = 53}
// gdb-command:print/d vu32x4
// gdb-check:$7 = {__0 = 54, __1 = 55, __2 = 56, __3 = 57}
// gdb-command:print/d vu64x2
// gdb-check:$8 = {__0 = 58, __1 = 59}
// gdbg-command:print/d vu8x16
// gdbr-command:print vu8x16
// gdbg-check:$5 = {__0 = 30, __1 = 31, __2 = 32, __3 = 33, __4 = 34, __5 = 35, __6 = 36, __7 = 37, __8 = 38, __9 = 39, __10 = 40, __11 = 41, __12 = 42, __13 = 43, __14 = 44, __15 = 45}
// gdbr-check:$5 = simd::u8x16 (30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45)
// gdbg-command:print/d vu16x8
// gdbr-command:print vu16x8
// gdbg-check:$6 = {__0 = 46, __1 = 47, __2 = 48, __3 = 49, __4 = 50, __5 = 51, __6 = 52, __7 = 53}
// gdbr-check:$6 = simd::u16x8 (46, 47, 48, 49, 50, 51, 52, 53)
// gdbg-command:print/d vu32x4
// gdbr-command:print vu32x4
// gdbg-check:$7 = {__0 = 54, __1 = 55, __2 = 56, __3 = 57}
// gdbr-check:$7 = simd::u32x4 (54, 55, 56, 57)
// gdbg-command:print/d vu64x2
// gdbr-command:print vu64x2
// gdbg-check:$8 = {__0 = 58, __1 = 59}
// gdbr-check:$8 = simd::u64x2 (58, 59)
// gdb-command:print vf32x4
// gdb-check:$9 = {__0 = 60.5, __1 = 61.5, __2 = 62.5, __3 = 63.5}
// gdbg-check:$9 = {__0 = 60.5, __1 = 61.5, __2 = 62.5, __3 = 63.5}
// gdbr-check:$9 = simd::f32x4 (60.5, 61.5, 62.5, 63.5)
// gdb-command:print vf64x2
// gdb-check:$10 = {__0 = 64.5, __1 = 65.5}
// gdbg-check:$10 = {__0 = 64.5, __1 = 65.5}
// gdbr-check:$10 = simd::f64x2 (64.5, 65.5)
// gdb-command:continue

View File

@ -14,61 +14,94 @@
// === GDB TESTS ===================================================================================
// gdb-command:print 'simple_struct::NO_PADDING_16'
// gdb-check:$1 = {x = 1000, y = -1001}
// there's no frame yet for gdb to reliably detect the language, set it explicitly
// gdbr-command:set language rust
// gdb-command:print 'simple_struct::NO_PADDING_32'
// gdb-check:$2 = {x = 1, y = 2, z = 3}
// gdbg-command:print 'simple_struct::NO_PADDING_16'
// gdbr-command:print simple_struct::NO_PADDING_16
// gdbg-check:$1 = {x = 1000, y = -1001}
// gdbr-check:$1 = simple_struct::NoPadding16 {x: 1000, y: -1001}
// gdb-command:print 'simple_struct::NO_PADDING_64'
// gdb-check:$3 = {x = 4, y = 5, z = 6}
// gdbg-command:print 'simple_struct::NO_PADDING_32'
// gdbr-command:print simple_struct::NO_PADDING_32
// gdbg-check:$2 = {x = 1, y = 2, z = 3}
// gdbr-check:$2 = simple_struct::NoPadding32 {x: 1, y: 2, z: 3}
// gdb-command:print 'simple_struct::NO_PADDING_163264'
// gdb-check:$4 = {a = 7, b = 8, c = 9, d = 10}
// gdbg-command:print 'simple_struct::NO_PADDING_64'
// gdbr-command:print simple_struct::NO_PADDING_64
// gdbg-check:$3 = {x = 4, y = 5, z = 6}
// gdbr-check:$3 = simple_struct::NoPadding64 {x: 4, y: 5, z: 6}
// gdb-command:print 'simple_struct::INTERNAL_PADDING'
// gdb-check:$5 = {x = 11, y = 12}
// gdbg-command:print 'simple_struct::NO_PADDING_163264'
// gdbr-command:print simple_struct::NO_PADDING_163264
// gdbg-check:$4 = {a = 7, b = 8, c = 9, d = 10}
// gdbr-check:$4 = simple_struct::NoPadding163264 {a: 7, b: 8, c: 9, d: 10}
// gdb-command:print 'simple_struct::PADDING_AT_END'
// gdb-check:$6 = {x = 13, y = 14}
// gdbg-command:print 'simple_struct::INTERNAL_PADDING'
// gdbr-command:print simple_struct::INTERNAL_PADDING
// gdbg-check:$5 = {x = 11, y = 12}
// gdbr-check:$5 = simple_struct::InternalPadding {x: 11, y: 12}
// gdbg-command:print 'simple_struct::PADDING_AT_END'
// gdbr-command:print simple_struct::PADDING_AT_END
// gdbg-check:$6 = {x = 13, y = 14}
// gdbr-check:$6 = simple_struct::PaddingAtEnd {x: 13, y: 14}
// gdb-command:run
// gdb-command:print no_padding16
// gdb-check:$7 = {x = 10000, y = -10001}
// gdbg-check:$7 = {x = 10000, y = -10001}
// gdbr-check:$7 = simple_struct::NoPadding16 {x: 10000, y: -10001}
// gdb-command:print no_padding32
// gdb-check:$8 = {x = -10002, y = -10003.5, z = 10004}
// gdbg-check:$8 = {x = -10002, y = -10003.5, z = 10004}
// gdbr-check:$8 = simple_struct::NoPadding32 {x: -10002, y: -10003.5, z: 10004}
// gdb-command:print no_padding64
// gdb-check:$9 = {x = -10005.5, y = 10006, z = 10007}
// gdbg-check:$9 = {x = -10005.5, y = 10006, z = 10007}
// gdbr-check:$9 = simple_struct::NoPadding64 {x: -10005.5, y: 10006, z: 10007}
// gdb-command:print no_padding163264
// gdb-check:$10 = {a = -10008, b = 10009, c = 10010, d = 10011}
// gdbg-check:$10 = {a = -10008, b = 10009, c = 10010, d = 10011}
// gdbr-check:$10 = simple_struct::NoPadding163264 {a: -10008, b: 10009, c: 10010, d: 10011}
// gdb-command:print internal_padding
// gdb-check:$11 = {x = 10012, y = -10013}
// gdbg-check:$11 = {x = 10012, y = -10013}
// gdbr-check:$11 = simple_struct::InternalPadding {x: 10012, y: -10013}
// gdb-command:print padding_at_end
// gdb-check:$12 = {x = -10014, y = 10015}
// gdbg-check:$12 = {x = -10014, y = 10015}
// gdbr-check:$12 = simple_struct::PaddingAtEnd {x: -10014, y: 10015}
// gdb-command:print 'simple_struct::NO_PADDING_16'
// gdb-check:$13 = {x = 100, y = -101}
// gdbg-command:print 'simple_struct::NO_PADDING_16'
// gdbr-command:print simple_struct::NO_PADDING_16
// gdbg-check:$13 = {x = 100, y = -101}
// gdbr-check:$13 = simple_struct::NoPadding16 {x: 100, y: -101}
// gdb-command:print 'simple_struct::NO_PADDING_32'
// gdb-check:$14 = {x = -15, y = -16, z = 17}
// gdbg-command:print 'simple_struct::NO_PADDING_32'
// gdbr-command:print simple_struct::NO_PADDING_32
// gdbg-check:$14 = {x = -15, y = -16, z = 17}
// gdbr-check:$14 = simple_struct::NoPadding32 {x: -15, y: -16, z: 17}
// gdb-command:print 'simple_struct::NO_PADDING_64'
// gdb-check:$15 = {x = -18, y = 19, z = 20}
// gdbg-command:print 'simple_struct::NO_PADDING_64'
// gdbr-command:print simple_struct::NO_PADDING_64
// gdbg-check:$15 = {x = -18, y = 19, z = 20}
// gdbr-check:$15 = simple_struct::NoPadding64 {x: -18, y: 19, z: 20}
// gdb-command:print 'simple_struct::NO_PADDING_163264'
// gdb-check:$16 = {a = -21, b = 22, c = 23, d = 24}
// gdbg-command:print 'simple_struct::NO_PADDING_163264'
// gdbr-command:print simple_struct::NO_PADDING_163264
// gdbg-check:$16 = {a = -21, b = 22, c = 23, d = 24}
// gdbr-check:$16 = simple_struct::NoPadding163264 {a: -21, b: 22, c: 23, d: 24}
// gdb-command:print 'simple_struct::INTERNAL_PADDING'
// gdb-check:$17 = {x = 25, y = -26}
// gdbg-command:print 'simple_struct::INTERNAL_PADDING'
// gdbr-command:print simple_struct::INTERNAL_PADDING
// gdbg-check:$17 = {x = 25, y = -26}
// gdbr-check:$17 = simple_struct::InternalPadding {x: 25, y: -26}
// gdb-command:print 'simple_struct::PADDING_AT_END'
// gdb-check:$18 = {x = -27, y = 28}
// gdbg-command:print 'simple_struct::PADDING_AT_END'
// gdbr-command:print simple_struct::PADDING_AT_END
// gdbg-check:$18 = {x = -27, y = 28}
// gdbr-check:$18 = simple_struct::PaddingAtEnd {x: -27, y: 28}
// gdb-command:continue

View File

@ -14,58 +14,97 @@
// === GDB TESTS ===================================================================================
// gdb-command:print/d 'simple_tuple::NO_PADDING_8'
// gdb-check:$1 = {__0 = -50, __1 = 50}
// gdb-command:print 'simple_tuple::NO_PADDING_16'
// gdb-check:$2 = {__0 = -1, __1 = 2, __2 = 3}
// gdb-command:print 'simple_tuple::NO_PADDING_32'
// gdb-check:$3 = {__0 = 4, __1 = 5, __2 = 6}
// gdb-command:print 'simple_tuple::NO_PADDING_64'
// gdb-check:$4 = {__0 = 7, __1 = 8, __2 = 9}
// there's no frame yet for gdb to reliably detect the language, set it explicitly
// gdbr-command:set language rust
// gdb-command:print 'simple_tuple::INTERNAL_PADDING_1'
// gdb-check:$5 = {__0 = 10, __1 = 11}
// gdb-command:print 'simple_tuple::INTERNAL_PADDING_2'
// gdb-check:$6 = {__0 = 12, __1 = 13, __2 = 14, __3 = 15}
// gdbg-command:print/d 'simple_tuple::NO_PADDING_8'
// gdbr-command:print simple_tuple::NO_PADDING_8
// gdbg-check:$1 = {__0 = -50, __1 = 50}
// gdbr-check:$1 = (-50, 50)
// gdbg-command:print 'simple_tuple::NO_PADDING_16'
// gdbr-command:print simple_tuple::NO_PADDING_16
// gdbg-check:$2 = {__0 = -1, __1 = 2, __2 = 3}
// gdbr-check:$2 = (-1, 2, 3)
// gdbg-command:print 'simple_tuple::NO_PADDING_32'
// gdbr-command:print simple_tuple::NO_PADDING_32
// gdbg-check:$3 = {__0 = 4, __1 = 5, __2 = 6}
// gdbr-check:$3 = (4, 5, 6)
// gdbg-command:print 'simple_tuple::NO_PADDING_64'
// gdbr-command:print simple_tuple::NO_PADDING_64
// gdbg-check:$4 = {__0 = 7, __1 = 8, __2 = 9}
// gdbr-check:$4 = (7, 8, 9)
// gdb-command:print 'simple_tuple::PADDING_AT_END'
// gdb-check:$7 = {__0 = 16, __1 = 17}
// gdbg-command:print 'simple_tuple::INTERNAL_PADDING_1'
// gdbr-command:print simple_tuple::INTERNAL_PADDING_1
// gdbg-check:$5 = {__0 = 10, __1 = 11}
// gdbr-check:$5 = (10, 11)
// gdbg-command:print 'simple_tuple::INTERNAL_PADDING_2'
// gdbr-command:print simple_tuple::INTERNAL_PADDING_2
// gdbg-check:$6 = {__0 = 12, __1 = 13, __2 = 14, __3 = 15}
// gdbr-check:$6 = (12, 13, 14, 15)
// gdbg-command:print 'simple_tuple::PADDING_AT_END'
// gdbr-command:print simple_tuple::PADDING_AT_END
// gdbg-check:$7 = {__0 = 16, __1 = 17}
// gdbr-check:$7 = (16, 17)
// gdb-command:run
// gdb-command:print/d noPadding8
// gdb-check:$8 = {__0 = -100, __1 = 100}
// gdbg-command:print/d noPadding8
// gdbr-command:print noPadding8
// gdbg-check:$8 = {__0 = -100, __1 = 100}
// gdbr-check:$8 = (-100, 100)
// gdb-command:print noPadding16
// gdb-check:$9 = {__0 = 0, __1 = 1, __2 = 2}
// gdbg-check:$9 = {__0 = 0, __1 = 1, __2 = 2}
// gdbr-check:$9 = (0, 1, 2)
// gdb-command:print noPadding32
// gdb-check:$10 = {__0 = 3, __1 = 4.5, __2 = 5}
// gdbg-check:$10 = {__0 = 3, __1 = 4.5, __2 = 5}
// gdbr-check:$10 = (3, 4.5, 5)
// gdb-command:print noPadding64
// gdb-check:$11 = {__0 = 6, __1 = 7.5, __2 = 8}
// gdbg-check:$11 = {__0 = 6, __1 = 7.5, __2 = 8}
// gdbr-check:$11 = (6, 7.5, 8)
// gdb-command:print internalPadding1
// gdb-check:$12 = {__0 = 9, __1 = 10}
// gdbg-check:$12 = {__0 = 9, __1 = 10}
// gdbr-check:$12 = (9, 10)
// gdb-command:print internalPadding2
// gdb-check:$13 = {__0 = 11, __1 = 12, __2 = 13, __3 = 14}
// gdbg-check:$13 = {__0 = 11, __1 = 12, __2 = 13, __3 = 14}
// gdbr-check:$13 = (11, 12, 13, 14)
// gdb-command:print paddingAtEnd
// gdb-check:$14 = {__0 = 15, __1 = 16}
// gdbg-check:$14 = {__0 = 15, __1 = 16}
// gdbr-check:$14 = (15, 16)
// gdb-command:print/d 'simple_tuple::NO_PADDING_8'
// gdb-check:$15 = {__0 = -127, __1 = 127}
// gdb-command:print 'simple_tuple::NO_PADDING_16'
// gdb-check:$16 = {__0 = -10, __1 = 10, __2 = 9}
// gdb-command:print 'simple_tuple::NO_PADDING_32'
// gdb-check:$17 = {__0 = 14, __1 = 15, __2 = 16}
// gdb-command:print 'simple_tuple::NO_PADDING_64'
// gdb-check:$18 = {__0 = 17, __1 = 18, __2 = 19}
// gdbg-command:print/d 'simple_tuple::NO_PADDING_8'
// gdbr-command:print simple_tuple::NO_PADDING_8
// gdbg-check:$15 = {__0 = -127, __1 = 127}
// gdbr-check:$15 = (-127, 127)
// gdbg-command:print 'simple_tuple::NO_PADDING_16'
// gdbr-command:print simple_tuple::NO_PADDING_16
// gdbg-check:$16 = {__0 = -10, __1 = 10, __2 = 9}
// gdbr-check:$16 = (-10, 10, 9)
// gdbg-command:print 'simple_tuple::NO_PADDING_32'
// gdbr-command:print simple_tuple::NO_PADDING_32
// gdbg-check:$17 = {__0 = 14, __1 = 15, __2 = 16}
// gdbr-check:$17 = (14, 15, 16)
// gdbg-command:print 'simple_tuple::NO_PADDING_64'
// gdbr-command:print simple_tuple::NO_PADDING_64
// gdbg-check:$18 = {__0 = 17, __1 = 18, __2 = 19}
// gdbr-check:$18 = (17, 18, 19)
// gdb-command:print 'simple_tuple::INTERNAL_PADDING_1'
// gdb-check:$19 = {__0 = 110, __1 = 111}
// gdb-command:print 'simple_tuple::INTERNAL_PADDING_2'
// gdb-check:$20 = {__0 = 112, __1 = 113, __2 = 114, __3 = 115}
// gdbg-command:print 'simple_tuple::INTERNAL_PADDING_1'
// gdbr-command:print simple_tuple::INTERNAL_PADDING_1
// gdbg-check:$19 = {__0 = 110, __1 = 111}
// gdbr-check:$19 = (110, 111)
// gdbg-command:print 'simple_tuple::INTERNAL_PADDING_2'
// gdbr-command:print simple_tuple::INTERNAL_PADDING_2
// gdbg-check:$20 = {__0 = 112, __1 = 113, __2 = 114, __3 = 115}
// gdbr-check:$20 = (112, 113, 114, 115)
// gdb-command:print 'simple_tuple::PADDING_AT_END'
// gdb-check:$21 = {__0 = 116, __1 = 117}
// gdbg-command:print 'simple_tuple::PADDING_AT_END'
// gdbr-command:print simple_tuple::PADDING_AT_END
// gdbg-check:$21 = {__0 = 116, __1 = 117}
// gdbr-check:$21 = (116, 117)
// === LLDB TESTS ==================================================================================

View File

@ -19,13 +19,16 @@
// gdb-command:run
// gdb-command:print case1
// gdb-check:$1 = {{RUST$ENUM$DISR = Case1, __0 = 0, __1 = {x = 2088533116, y = 2088533116, z = 31868}}, {RUST$ENUM$DISR = Case1, __0 = 0, __1 = 8970181431921507452, __2 = 31868}}
// gdbg-check:$1 = {{RUST$ENUM$DISR = Case1, __0 = 0, __1 = {x = 2088533116, y = 2088533116, z = 31868}}, {RUST$ENUM$DISR = Case1, __0 = 0, __1 = 8970181431921507452, __2 = 31868}}
// gdbr-check:$1 = struct_in_enum::Regular::Case1(0, struct_in_enum::Struct {x: 2088533116, y: 2088533116, z: 31868})
// gdb-command:print case2
// gdb-check:$2 = {{RUST$ENUM$DISR = Case2, __0 = 0, __1 = {x = 286331153, y = 286331153, z = 4369}}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 1229782938247303441, __2 = 4369}}
// gdbg-check:$2 = {{RUST$ENUM$DISR = Case2, __0 = 0, __1 = {x = 286331153, y = 286331153, z = 4369}}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 1229782938247303441, __2 = 4369}}
// gdbr-check:$2 = struct_in_enum::Regular::Case2(0, 1229782938247303441, 4369)
// gdb-command:print univariant
// gdb-check:$3 = {{__0 = {x = 123, y = 456, z = 789}}}
// gdbg-check:$3 = {{__0 = {x = 123, y = 456, z = 789}}}
// gdbr-check:$3 = struct_in_enum::Univariant::TheOnlyCase(struct_in_enum::Struct {x: 123, y: 456, z: 789})
// === LLDB TESTS ==================================================================================

View File

@ -18,13 +18,16 @@
// gdb-command:run
// gdb-command:print three_simple_structs
// gdb-check:$1 = {x = {x = 1}, y = {x = 2}, z = {x = 3}}
// gdbg-check:$1 = {x = {x = 1}, y = {x = 2}, z = {x = 3}}
// gdbr-check:$1 = struct_in_struct::ThreeSimpleStructs {x: struct_in_struct::Simple {x: 1}, y: struct_in_struct::Simple {x: 2}, z: struct_in_struct::Simple {x: 3}}
// gdb-command:print internal_padding_parent
// gdb-check:$2 = {x = {x = 4, y = 5}, y = {x = 6, y = 7}, z = {x = 8, y = 9}}
// gdbg-check:$2 = {x = {x = 4, y = 5}, y = {x = 6, y = 7}, z = {x = 8, y = 9}}
// gdbr-check:$2 = struct_in_struct::InternalPaddingParent {x: struct_in_struct::InternalPadding {x: 4, y: 5}, y: struct_in_struct::InternalPadding {x: 6, y: 7}, z: struct_in_struct::InternalPadding {x: 8, y: 9}}
// gdb-command:print padding_at_end_parent
// gdb-check:$3 = {x = {x = 10, y = 11}, y = {x = 12, y = 13}, z = {x = 14, y = 15}}
// gdbg-check:$3 = {x = {x = 10, y = 11}, y = {x = 12, y = 13}, z = {x = 14, y = 15}}
// gdbr-check:$3 = struct_in_struct::PaddingAtEndParent {x: struct_in_struct::PaddingAtEnd {x: 10, y: 11}, y: struct_in_struct::PaddingAtEnd {x: 12, y: 13}, z: struct_in_struct::PaddingAtEnd {x: 14, y: 15}}
// === LLDB TESTS ==================================================================================

View File

@ -19,16 +19,20 @@
// gdb-command:run
// gdb-command:print case1
// gdb-check:$1 = {{RUST$ENUM$DISR = Case1, a = 0, b = 31868, c = 31868, d = 31868, e = 31868}, {RUST$ENUM$DISR = Case1, a = 0, b = 2088533116, c = 2088533116}, {RUST$ENUM$DISR = Case1, a = 0, b = 8970181431921507452}}
// gdbg-check:$1 = {{RUST$ENUM$DISR = Case1, a = 0, b = 31868, c = 31868, d = 31868, e = 31868}, {RUST$ENUM$DISR = Case1, a = 0, b = 2088533116, c = 2088533116}, {RUST$ENUM$DISR = Case1, a = 0, b = 8970181431921507452}}
// gdbr-check:$1 = struct_style_enum::Regular::Case1{a: 0, b: 31868, c: 31868, d: 31868, e: 31868}
// gdb-command:print case2
// gdb-check:$2 = {{RUST$ENUM$DISR = Case2, a = 0, b = 4369, c = 4369, d = 4369, e = 4369}, {RUST$ENUM$DISR = Case2, a = 0, b = 286331153, c = 286331153}, {RUST$ENUM$DISR = Case2, a = 0, b = 1229782938247303441}}
// gdbg-check:$2 = {{RUST$ENUM$DISR = Case2, a = 0, b = 4369, c = 4369, d = 4369, e = 4369}, {RUST$ENUM$DISR = Case2, a = 0, b = 286331153, c = 286331153}, {RUST$ENUM$DISR = Case2, a = 0, b = 1229782938247303441}}
// gdbr-check:$2 = struct_style_enum::Regular::Case2{a: 0, b: 286331153, c: 286331153}
// gdb-command:print case3
// gdb-check:$3 = {{RUST$ENUM$DISR = Case3, a = 0, b = 22873, c = 22873, d = 22873, e = 22873}, {RUST$ENUM$DISR = Case3, a = 0, b = 1499027801, c = 1499027801}, {RUST$ENUM$DISR = Case3, a = 0, b = 6438275382588823897}}
// gdbg-check:$3 = {{RUST$ENUM$DISR = Case3, a = 0, b = 22873, c = 22873, d = 22873, e = 22873}, {RUST$ENUM$DISR = Case3, a = 0, b = 1499027801, c = 1499027801}, {RUST$ENUM$DISR = Case3, a = 0, b = 6438275382588823897}}
// gdbr-check:$3 = struct_style_enum::Regular::Case3{a: 0, b: 6438275382588823897}
// gdb-command:print univariant
// gdb-check:$4 = {{a = -1}}
// gdbg-check:$4 = {{a = -1}}
// gdbr-check:$4 = struct_style_enum::Univariant::TheOnlyCase{a: -1}
// === LLDB TESTS ==================================================================================

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// ignore-tidy-linelength
// min-lldb-version: 310
// compile-flags:-g
@ -16,16 +18,20 @@
// gdb-command:run
// gdb-command:print simple
// gdb-check:$1 = {x = 10, y = 20}
// gdbg-check:$1 = {x = 10, y = 20}
// gdbr-check:$1 = struct_with_destructor::WithDestructor {x: 10, y: 20}
// gdb-command:print noDestructor
// gdb-check:$2 = {a = {x = 10, y = 20}, guard = -1}
// gdbg-check:$2 = {a = {x = 10, y = 20}, guard = -1}
// gdbr-check:$2 = struct_with_destructor::NoDestructorGuarded {a: struct_with_destructor::NoDestructor {x: 10, y: 20}, guard: -1}
// gdb-command:print withDestructor
// gdb-check:$3 = {a = {x = 10, y = 20}, guard = -1}
// gdbg-check:$3 = {a = {x = 10, y = 20}, guard = -1}
// gdbr-check:$3 = struct_with_destructor::WithDestructorGuarded {a: struct_with_destructor::WithDestructor {x: 10, y: 20}, guard: -1}
// gdb-command:print nested
// gdb-check:$4 = {a = {a = {x = 7890, y = 9870}}}
// gdbg-check:$4 = {a = {a = {x = 7890, y = 9870}}}
// gdbr-check:$4 = struct_with_destructor::NestedOuter {a: struct_with_destructor::NestedInner {a: struct_with_destructor::WithDestructor {x: 7890, y: 9870}}}
// === LLDB TESTS ==================================================================================

View File

@ -17,29 +17,39 @@
// gdb-command:run
// gdb-command:print no_padding1
// gdb-check:$1 = {x = {__0 = 0, __1 = 1}, y = 2, z = {__0 = 3, __1 = 4, __2 = 5}}
// gdbg-check:$1 = {x = {__0 = 0, __1 = 1}, y = 2, z = {__0 = 3, __1 = 4, __2 = 5}}
// gdbr-check:$1 = tuple_in_struct::NoPadding1 {x: (0, 1), y: 2, z: (3, 4, 5)}
// gdb-command:print no_padding2
// gdb-check:$2 = {x = {__0 = 6, __1 = 7}, y = {__0 = {__0 = 8, __1 = 9}, __1 = 10}}
// gdbg-check:$2 = {x = {__0 = 6, __1 = 7}, y = {__0 = {__0 = 8, __1 = 9}, __1 = 10}}
// gdbr-check:$2 = tuple_in_struct::NoPadding2 {x: (6, 7), y: ((8, 9), 10)}
// gdb-command:print tuple_internal_padding
// gdb-check:$3 = {x = {__0 = 11, __1 = 12}, y = {__0 = 13, __1 = 14}}
// gdbg-check:$3 = {x = {__0 = 11, __1 = 12}, y = {__0 = 13, __1 = 14}}
// gdbr-check:$3 = tuple_in_struct::TupleInternalPadding {x: (11, 12), y: (13, 14)}
// gdb-command:print struct_internal_padding
// gdb-check:$4 = {x = {__0 = 15, __1 = 16}, y = {__0 = 17, __1 = 18}}
// gdbg-check:$4 = {x = {__0 = 15, __1 = 16}, y = {__0 = 17, __1 = 18}}
// gdbr-check:$4 = tuple_in_struct::StructInternalPadding {x: (15, 16), y: (17, 18)}
// gdb-command:print both_internally_padded
// gdb-check:$5 = {x = {__0 = 19, __1 = 20, __2 = 21}, y = {__0 = 22, __1 = 23}}
// gdbg-check:$5 = {x = {__0 = 19, __1 = 20, __2 = 21}, y = {__0 = 22, __1 = 23}}
// gdbr-check:$5 = tuple_in_struct::BothInternallyPadded {x: (19, 20, 21), y: (22, 23)}
// gdb-command:print single_tuple
// gdb-check:$6 = {x = {__0 = 24, __1 = 25, __2 = 26}}
// gdbg-check:$6 = {x = {__0 = 24, __1 = 25, __2 = 26}}
// gdbr-check:$6 = tuple_in_struct::SingleTuple {x: (24, 25, 26)}
// gdb-command:print tuple_padded_at_end
// gdb-check:$7 = {x = {__0 = 27, __1 = 28}, y = {__0 = 29, __1 = 30}}
// gdbg-check:$7 = {x = {__0 = 27, __1 = 28}, y = {__0 = 29, __1 = 30}}
// gdbr-check:$7 = tuple_in_struct::TuplePaddedAtEnd {x: (27, 28), y: (29, 30)}
// gdb-command:print struct_padded_at_end
// gdb-check:$8 = {x = {__0 = 31, __1 = 32}, y = {__0 = 33, __1 = 34}}
// gdbg-check:$8 = {x = {__0 = 31, __1 = 32}, y = {__0 = 33, __1 = 34}}
// gdbr-check:$8 = tuple_in_struct::StructPaddedAtEnd {x: (31, 32), y: (33, 34)}
// gdb-command:print both_padded_at_end
// gdb-check:$9 = {x = {__0 = 35, __1 = 36, __2 = 37}, y = {__0 = 38, __1 = 39}}
// gdbg-check:$9 = {x = {__0 = 35, __1 = 36, __2 = 37}, y = {__0 = 38, __1 = 39}}
// gdbr-check:$9 = tuple_in_struct::BothPaddedAtEnd {x: (35, 36, 37), y: (38, 39)}
// gdb-command:print mixed_padding
// gdb-check:$10 = {x = {__0 = {__0 = 40, __1 = 41, __2 = 42}, __1 = {__0 = 43, __1 = 44}}, y = {__0 = 45, __1 = 46, __2 = 47, __3 = 48}}
// gdbg-check:$10 = {x = {__0 = {__0 = 40, __1 = 41, __2 = 42}, __1 = {__0 = 43, __1 = 44}}, y = {__0 = 45, __1 = 46, __2 = 47, __3 = 48}}
// gdbr-check:$10 = tuple_in_struct::MixedPadding {x: ((40, 41, 42), (43, 44)), y: (45, 46, 47, 48)}
#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]

View File

@ -17,21 +17,28 @@
// gdb-command:run
// gdb-command:print no_padding1
// gdb-check:$1 = {__0 = {__0 = 0, __1 = 1}, __1 = 2, __2 = 3}
// gdbg-check:$1 = {__0 = {__0 = 0, __1 = 1}, __1 = 2, __2 = 3}
// gdbr-check:$1 = ((0, 1), 2, 3)
// gdb-command:print no_padding2
// gdb-check:$2 = {__0 = 4, __1 = {__0 = 5, __1 = 6}, __2 = 7}
// gdbg-check:$2 = {__0 = 4, __1 = {__0 = 5, __1 = 6}, __2 = 7}
// gdbr-check:$2 = (4, (5, 6), 7)
// gdb-command:print no_padding3
// gdb-check:$3 = {__0 = 8, __1 = 9, __2 = {__0 = 10, __1 = 11}}
// gdbg-check:$3 = {__0 = 8, __1 = 9, __2 = {__0 = 10, __1 = 11}}
// gdbr-check:$3 = (8, 9, (10, 11))
// gdb-command:print internal_padding1
// gdb-check:$4 = {__0 = 12, __1 = {__0 = 13, __1 = 14}}
// gdbg-check:$4 = {__0 = 12, __1 = {__0 = 13, __1 = 14}}
// gdbr-check:$4 = (12, (13, 14))
// gdb-command:print internal_padding2
// gdb-check:$5 = {__0 = 15, __1 = {__0 = 16, __1 = 17}}
// gdbg-check:$5 = {__0 = 15, __1 = {__0 = 16, __1 = 17}}
// gdbr-check:$5 = (15, (16, 17))
// gdb-command:print padding_at_end1
// gdb-check:$6 = {__0 = 18, __1 = {__0 = 19, __1 = 20}}
// gdbg-check:$6 = {__0 = 18, __1 = {__0 = 19, __1 = 20}}
// gdbr-check:$6 = (18, (19, 20))
// gdb-command:print padding_at_end2
// gdb-check:$7 = {__0 = {__0 = 21, __1 = 22}, __1 = 23}
// gdbg-check:$7 = {__0 = {__0 = 21, __1 = 22}, __1 = 23}
// gdbr-check:$7 = ((21, 22), 23)
// === LLDB TESTS ==================================================================================

View File

@ -17,22 +17,28 @@
// gdb-command:run
// gdb-command:print no_padding16
// gdb-check:$1 = {__0 = 10000, __1 = -10001}
// gdbg-check:$1 = {__0 = 10000, __1 = -10001}
// gdbr-check:$1 = tuple_struct::NoPadding16 (10000, -10001)
// gdb-command:print no_padding32
// gdb-check:$2 = {__0 = -10002, __1 = -10003.5, __2 = 10004}
// gdbg-check:$2 = {__0 = -10002, __1 = -10003.5, __2 = 10004}
// gdbr-check:$2 = tuple_struct::NoPadding32 (-10002, -10003.5, 10004)
// gdb-command:print no_padding64
// gdb-check:$3 = {__0 = -10005.5, __1 = 10006, __2 = 10007}
// gdbg-check:$3 = {__0 = -10005.5, __1 = 10006, __2 = 10007}
// gdbr-check:$3 = tuple_struct::NoPadding64 (-10005.5, 10006, 10007)
// gdb-command:print no_padding163264
// gdb-check:$4 = {__0 = -10008, __1 = 10009, __2 = 10010, __3 = 10011}
// gdbg-check:$4 = {__0 = -10008, __1 = 10009, __2 = 10010, __3 = 10011}
// gdbr-check:$4 = tuple_struct::NoPadding163264 (-10008, 10009, 10010, 10011)
// gdb-command:print internal_padding
// gdb-check:$5 = {__0 = 10012, __1 = -10013}
// gdbg-check:$5 = {__0 = 10012, __1 = -10013}
// gdbr-check:$5 = tuple_struct::InternalPadding (10012, -10013)
// gdb-command:print padding_at_end
// gdb-check:$6 = {__0 = -10014, __1 = 10015}
// gdbg-check:$6 = {__0 = -10014, __1 = 10015}
// gdbr-check:$6 = tuple_struct::PaddingAtEnd (-10014, 10015)
// === LLDB TESTS ==================================================================================

View File

@ -19,16 +19,20 @@
// gdb-command:run
// gdb-command:print case1
// gdb-check:$1 = {{RUST$ENUM$DISR = Case1, __0 = 0, __1 = 31868, __2 = 31868, __3 = 31868, __4 = 31868}, {RUST$ENUM$DISR = Case1, __0 = 0, __1 = 2088533116, __2 = 2088533116}, {RUST$ENUM$DISR = Case1, __0 = 0, __1 = 8970181431921507452}}
// gdbg-check:$1 = {{RUST$ENUM$DISR = Case1, __0 = 0, __1 = 31868, __2 = 31868, __3 = 31868, __4 = 31868}, {RUST$ENUM$DISR = Case1, __0 = 0, __1 = 2088533116, __2 = 2088533116}, {RUST$ENUM$DISR = Case1, __0 = 0, __1 = 8970181431921507452}}
// gdbr-check:$1 = tuple_style_enum::Regular::Case1(0, 31868, 31868, 31868, 31868)
// gdb-command:print case2
// gdb-check:$2 = {{RUST$ENUM$DISR = Case2, __0 = 0, __1 = 4369, __2 = 4369, __3 = 4369, __4 = 4369}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 286331153, __2 = 286331153}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 1229782938247303441}}
// gdbg-check:$2 = {{RUST$ENUM$DISR = Case2, __0 = 0, __1 = 4369, __2 = 4369, __3 = 4369, __4 = 4369}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 286331153, __2 = 286331153}, {RUST$ENUM$DISR = Case2, __0 = 0, __1 = 1229782938247303441}}
// gdbr-check:$2 = tuple_style_enum::Regular::Case2(0, 286331153, 286331153)
// gdb-command:print case3
// gdb-check:$3 = {{RUST$ENUM$DISR = Case3, __0 = 0, __1 = 22873, __2 = 22873, __3 = 22873, __4 = 22873}, {RUST$ENUM$DISR = Case3, __0 = 0, __1 = 1499027801, __2 = 1499027801}, {RUST$ENUM$DISR = Case3, __0 = 0, __1 = 6438275382588823897}}
// gdbg-check:$3 = {{RUST$ENUM$DISR = Case3, __0 = 0, __1 = 22873, __2 = 22873, __3 = 22873, __4 = 22873}, {RUST$ENUM$DISR = Case3, __0 = 0, __1 = 1499027801, __2 = 1499027801}, {RUST$ENUM$DISR = Case3, __0 = 0, __1 = 6438275382588823897}}
// gdbr-check:$3 = tuple_style_enum::Regular::Case3(0, 6438275382588823897)
// gdb-command:print univariant
// gdb-check:$4 = {{__0 = -1}}
// gdbg-check:$4 = {{__0 = -1}}
// gdbr-check:$4 = tuple_style_enum::Univariant::TheOnlyCase(-1)
// === LLDB TESTS ==================================================================================

View File

@ -20,160 +20,206 @@
// STRUCTS
// gdb-command:whatis simple_struct
// gdb-check:type = struct Struct1
// gdbg-check:type = struct Struct1
// gdbr-check:type = type_names::Struct1
// gdb-command:whatis generic_struct1
// gdb-check:type = struct GenericStruct<type_names::mod1::Struct2, type_names::mod1::mod2::Struct3>
// gdbg-check:type = struct GenericStruct<type_names::mod1::Struct2, type_names::mod1::mod2::Struct3>
// gdbr-check:type = type_names::GenericStruct<type_names::mod1::Struct2, type_names::mod1::mod2::Struct3>
// gdb-command:whatis generic_struct2
// gdb-check:type = struct GenericStruct<type_names::Struct1, extern "fastcall" fn(isize) -> usize>
// gdbg-check:type = struct GenericStruct<type_names::Struct1, extern "fastcall" fn(isize) -> usize>
// gdbr-check:type = type_names::GenericStruct<type_names::Struct1, extern "fastcall" fn(isize) -> usize>
// gdb-command:whatis mod_struct
// gdb-check:type = struct Struct2
// gdbg-check:type = struct Struct2
// gdbr-check:type = type_names::mod1::Struct2
// ENUMS
// gdb-command:whatis simple_enum_1
// gdb-check:type = union Enum1
// gdbg-check:type = union Enum1
// gdbr-check:type = type_names::Enum1
// gdb-command:whatis simple_enum_2
// gdb-check:type = union Enum1
// gdbg-check:type = union Enum1
// gdbr-check:type = type_names::Enum1
// gdb-command:whatis simple_enum_3
// gdb-check:type = union Enum2
// gdbg-check:type = union Enum2
// gdbr-check:type = type_names::mod1::Enum2
// gdb-command:whatis generic_enum_1
// gdb-check:type = union Enum3<type_names::mod1::Struct2>
// gdbg-check:type = union Enum3<type_names::mod1::Struct2>
// gdbr-check:type = type_names::mod1::mod2::Enum3<type_names::mod1::Struct2>
// gdb-command:whatis generic_enum_2
// gdb-check:type = union Enum3<type_names::Struct1>
// gdbg-check:type = union Enum3<type_names::Struct1>
// gdbr-check:type = type_names::mod1::mod2::Enum3<type_names::Struct1>
// TUPLES
// gdb-command:whatis tuple1
// gdb-check:type = struct (u32, type_names::Struct1, type_names::mod1::mod2::Enum3<type_names::mod1::Struct2>)
// gdbg-check:type = struct (u32, type_names::Struct1, type_names::mod1::mod2::Enum3<type_names::mod1::Struct2>)
// gdbr-check:type = (u32, type_names::Struct1, type_names::mod1::mod2::Enum3<type_names::mod1::Struct2>)
// gdb-command:whatis tuple2
// gdb-check:type = struct ((type_names::Struct1, type_names::mod1::mod2::Struct3), type_names::mod1::Enum2, char)
// gdbg-check:type = struct ((type_names::Struct1, type_names::mod1::mod2::Struct3), type_names::mod1::Enum2, char)
// gdbr-check:type = ((type_names::Struct1, type_names::mod1::mod2::Struct3), type_names::mod1::Enum2, char)
// BOX
// gdb-command:whatis box1
// gdb-check:type = struct (Box<f32>, i32)
// gdbg-check:type = struct (Box<f32>, i32)
// gdbr-check:type = (Box<f32>, i32)
// gdb-command:whatis box2
// gdb-check:type = struct (Box<type_names::mod1::mod2::Enum3<f32>>, i32)
// gdbg-check:type = struct (Box<type_names::mod1::mod2::Enum3<f32>>, i32)
// gdbr-check:type = (Box<type_names::mod1::mod2::Enum3<f32>>, i32)
// REFERENCES
// gdb-command:whatis ref1
// gdb-check:type = struct (&type_names::Struct1, i32)
// gdbg-check:type = struct (&type_names::Struct1, i32)
// gdbr-check:type = (&type_names::Struct1, i32)
// gdb-command:whatis ref2
// gdb-check:type = struct (&type_names::GenericStruct<char, type_names::Struct1>, i32)
// gdbg-check:type = struct (&type_names::GenericStruct<char, type_names::Struct1>, i32)
// gdbr-check:type = (&type_names::GenericStruct<char, type_names::Struct1>, i32)
// gdb-command:whatis mut_ref1
// gdb-check:type = struct (&mut type_names::Struct1, i32)
// gdbg-check:type = struct (&mut type_names::Struct1, i32)
// gdbr-check:type = (&mut type_names::Struct1, i32)
// gdb-command:whatis mut_ref2
// gdb-check:type = struct (&mut type_names::GenericStruct<type_names::mod1::Enum2, f64>, i32)
// gdbg-check:type = struct (&mut type_names::GenericStruct<type_names::mod1::Enum2, f64>, i32)
// gdbr-check:type = (&mut type_names::GenericStruct<type_names::mod1::Enum2, f64>, i32)
// RAW POINTERS
// gdb-command:whatis mut_ptr1
// gdb-check:type = struct (*mut type_names::Struct1, isize)
// gdbg-check:type = struct (*mut type_names::Struct1, isize)
// gdbr-check:type = (*mut type_names::Struct1, isize)
// gdb-command:whatis mut_ptr2
// gdb-check:type = struct (*mut isize, isize)
// gdbg-check:type = struct (*mut isize, isize)
// gdbr-check:type = (*mut isize, isize)
// gdb-command:whatis mut_ptr3
// gdb-check:type = struct (*mut type_names::mod1::mod2::Enum3<type_names::Struct1>, isize)
// gdbg-check:type = struct (*mut type_names::mod1::mod2::Enum3<type_names::Struct1>, isize)
// gdbr-check:type = (*mut type_names::mod1::mod2::Enum3<type_names::Struct1>, isize)
// gdb-command:whatis const_ptr1
// gdb-check:type = struct (*const type_names::Struct1, isize)
// gdbg-check:type = struct (*const type_names::Struct1, isize)
// gdbr-check:type = (*const type_names::Struct1, isize)
// gdb-command:whatis const_ptr2
// gdb-check:type = struct (*const isize, isize)
// gdbg-check:type = struct (*const isize, isize)
// gdbr-check:type = (*const isize, isize)
// gdb-command:whatis const_ptr3
// gdb-check:type = struct (*const type_names::mod1::mod2::Enum3<type_names::Struct1>, isize)
// gdbg-check:type = struct (*const type_names::mod1::mod2::Enum3<type_names::Struct1>, isize)
// gdbr-check:type = (*const type_names::mod1::mod2::Enum3<type_names::Struct1>, isize)
// VECTORS
// gdb-command:whatis fixed_size_vec1
// gdb-check:type = struct ([type_names::Struct1; 3], i16)
// gdbg-check:type = struct ([type_names::Struct1; 3], i16)
// gdbr-check:type = ([type_names::Struct1; 3], i16)
// gdb-command:whatis fixed_size_vec2
// gdb-check:type = struct ([usize; 3], i16)
// gdbg-check:type = struct ([usize; 3], i16)
// gdbr-check:type = ([usize; 3], i16)
// gdb-command:whatis slice1
// gdb-check:type = struct &[usize]
// gdbg-check:type = struct &[usize]
// gdbr-check:type = &[usize]
// gdb-command:whatis slice2
// gdb-check:type = struct &[type_names::mod1::Enum2]
// gdbg-check:type = struct &[type_names::mod1::Enum2]
// gdbr-check:type = &[type_names::mod1::Enum2]
// TRAITS
// gdb-command:whatis box_trait
// gdb-check:type = struct Box<Trait1>
// gdbg-check:type = struct Box<Trait1>
// gdbr-check:type = type_names::Box<Trait1>
// gdb-command:whatis ref_trait
// gdb-check:type = struct &Trait1
// gdbg-check:type = struct &Trait1
// gdbr-check:type = type_names::&Trait1
// gdb-command:whatis mut_ref_trait
// gdb-check:type = struct &mut Trait1
// gdbg-check:type = struct &mut Trait1
// gdbr-check:type = type_names::&mut Trait1
// gdb-command:whatis generic_box_trait
// gdb-check:type = struct Box<Trait2<i32, type_names::mod1::Struct2>>
// gdbg-check:type = struct Box<Trait2<i32, type_names::mod1::Struct2>>
// gdbr-check:type = type_names::Box<Trait2<i32, type_names::mod1::Struct2>>
// gdb-command:whatis generic_ref_trait
// gdb-check:type = struct &Trait2<type_names::Struct1, type_names::Struct1>
// gdbg-check:type = struct &Trait2<type_names::Struct1, type_names::Struct1>
// gdbr-check:type = type_names::&Trait2<type_names::Struct1, type_names::Struct1>
// gdb-command:whatis generic_mut_ref_trait
// gdb-check:type = struct &mut Trait2<type_names::mod1::mod2::Struct3, type_names::GenericStruct<usize, isize>>
// gdbg-check:type = struct &mut Trait2<type_names::mod1::mod2::Struct3, type_names::GenericStruct<usize, isize>>
// gdbr-check:type = type_names::&mut Trait2<type_names::mod1::mod2::Struct3, type_names::GenericStruct<usize, isize>>
// BARE FUNCTIONS
// gdb-command:whatis rust_fn
// gdb-check:type = struct (fn(core::option::Option<isize>, core::option::Option<&type_names::mod1::Struct2>), usize)
// gdbg-check:type = struct (fn(core::option::Option<isize>, core::option::Option<&type_names::mod1::Struct2>), usize)
// gdbr-check:type = (fn(core::option::Option<isize>, core::option::Option<&type_names::mod1::Struct2>), usize)
// gdb-command:whatis extern_c_fn
// gdb-check:type = struct (extern "C" fn(isize), usize)
// gdbg-check:type = struct (extern "C" fn(isize), usize)
// gdbr-check:type = (extern "C" fn(isize), usize)
// gdb-command:whatis unsafe_fn
// gdb-check:type = struct (unsafe fn(core::result::Result<char, f64>), usize)
// gdbg-check:type = struct (unsafe fn(core::result::Result<char, f64>), usize)
// gdbr-check:type = (unsafe fn(core::result::Result<char, f64>), usize)
// gdb-command:whatis extern_stdcall_fn
// gdb-check:type = struct (extern "stdcall" fn(), usize)
// gdbg-check:type = struct (extern "stdcall" fn(), usize)
// gdbr-check:type = (extern "stdcall" fn(), usize)
// gdb-command:whatis rust_fn_with_return_value
// gdb-check:type = struct (fn(f64) -> usize, usize)
// gdbg-check:type = struct (fn(f64) -> usize, usize)
// gdbr-check:type = (fn(f64) -> usize, usize)
// gdb-command:whatis extern_c_fn_with_return_value
// gdb-check:type = struct (extern "C" fn() -> type_names::Struct1, usize)
// gdbg-check:type = struct (extern "C" fn() -> type_names::Struct1, usize)
// gdbr-check:type = (extern "C" fn() -> type_names::Struct1, usize)
// gdb-command:whatis unsafe_fn_with_return_value
// gdb-check:type = struct (unsafe fn(type_names::GenericStruct<u16, u8>) -> type_names::mod1::Struct2, usize)
// gdbg-check:type = struct (unsafe fn(type_names::GenericStruct<u16, u8>) -> type_names::mod1::Struct2, usize)
// gdbr-check:type = (unsafe fn(type_names::GenericStruct<u16, u8>) -> type_names::mod1::Struct2, usize)
// gdb-command:whatis extern_stdcall_fn_with_return_value
// gdb-check:type = struct (extern "stdcall" fn(Box<isize>) -> usize, usize)
// gdbg-check:type = struct (extern "stdcall" fn(Box<isize>) -> usize, usize)
// gdbr-check:type = (extern "stdcall" fn(Box<isize>) -> usize, usize)
// gdb-command:whatis generic_function_int
// gdb-check:type = struct (fn(isize) -> isize, usize)
// gdbg-check:type = struct (fn(isize) -> isize, usize)
// gdbr-check:type = (fn(isize) -> isize, usize)
// gdb-command:whatis generic_function_struct3
// gdb-check:type = struct (fn(type_names::mod1::mod2::Struct3) -> type_names::mod1::mod2::Struct3, usize)
// gdbg-check:type = struct (fn(type_names::mod1::mod2::Struct3) -> type_names::mod1::mod2::Struct3, usize)
// gdbr-check:type = (fn(type_names::mod1::mod2::Struct3) -> type_names::mod1::mod2::Struct3, usize)
// gdb-command:whatis variadic_function
// gdb-check:type = struct (unsafe extern "C" fn(*const u8, ...) -> isize, usize)
// gdbg-check:type = struct (unsafe extern "C" fn(*const u8, ...) -> isize, usize)
// gdbr-check:type = (unsafe extern "C" fn(*const u8, ...) -> isize, usize)
// CLOSURES
// gdb-command:whatis closure1
// gdb-check:type = struct (closure, usize)
// gdbg-check:type = struct (closure, usize)
// gdbr-check:type = (closure, usize)
// gdb-command:whatis closure2
// gdb-check:type = struct (closure, usize)
// gdbg-check:type = struct (closure, usize)
// gdbr-check:type = (closure, usize)
#![feature(box_syntax)]
#![allow(unused_variables)]

View File

@ -16,9 +16,11 @@
// gdb-command:run
// gdb-command:print u
// gdb-check:$1 = {a = {__0 = 2 '\002', __1 = 2 '\002'}, b = 514}
// gdbg-check:$1 = {a = {__0 = 2 '\002', __1 = 2 '\002'}, b = 514}
// gdbr-check:$1 = union_smoke::U {a: (2, 2), b: 514}
// gdb-command:print union_smoke::SU
// gdb-check:$2 = {a = {__0 = 1 '\001', __1 = 1 '\001'}, b = 257}
// gdbg-check:$2 = {a = {__0 = 1 '\001', __1 = 1 '\001'}, b = 257}
// gdbr-check:$2 = union_smoke::U {a: (1, 1), b: 257}
// === LLDB TESTS ==================================================================================

View File

@ -18,13 +18,16 @@
// gdb-command:run
// gdb-command:print *the_a
// gdb-check:$1 = {{RUST$ENUM$DISR = TheA, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = TheA, __0 = 0, __1 = 2088533116, __2 = 2088533116}}
// gdbg-check:$1 = {{RUST$ENUM$DISR = TheA, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = TheA, __0 = 0, __1 = 2088533116, __2 = 2088533116}}
// gdbr-check:$1 = unique_enum::ABC::TheA{x: 0, y: 8970181431921507452}
// gdb-command:print *the_b
// gdb-check:$2 = {{RUST$ENUM$DISR = TheB, x = 0, y = 1229782938247303441}, {RUST$ENUM$DISR = TheB, __0 = 0, __1 = 286331153, __2 = 286331153}}
// gdbg-check:$2 = {{RUST$ENUM$DISR = TheB, x = 0, y = 1229782938247303441}, {RUST$ENUM$DISR = TheB, __0 = 0, __1 = 286331153, __2 = 286331153}}
// gdbr-check:$2 = unique_enum::ABC::TheB(0, 286331153, 286331153)
// gdb-command:print *univariant
// gdb-check:$3 = {{__0 = 123234}}
// gdbg-check:$3 = {{__0 = 123234}}
// gdbr-check:$3 = unique_enum::Univariant::TheOnlyCase(123234)
// === LLDB TESTS ==================================================================================

View File

@ -21,9 +21,11 @@
// gdb-command:print constant
// gdb-check:$2 = 2
// gdb-command:print a_struct
// gdb-check:$3 = {a = -3, b = 4.5, c = 5}
// gdbg-check:$3 = {a = -3, b = 4.5, c = 5}
// gdbr-check:$3 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5}
// gdb-command:print *struct_ref
// gdb-check:$4 = {a = -3, b = 4.5, c = 5}
// gdbg-check:$4 = {a = -3, b = 4.5, c = 5}
// gdbr-check:$4 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5}
// gdb-command:print *owned
// gdb-check:$5 = 6
// gdb-command:print closure_local
@ -35,9 +37,11 @@
// gdb-command:print constant
// gdb-check:$8 = 2
// gdb-command:print a_struct
// gdb-check:$9 = {a = -3, b = 4.5, c = 5}
// gdbg-check:$9 = {a = -3, b = 4.5, c = 5}
// gdbr-check:$9 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5}
// gdb-command:print *struct_ref
// gdb-check:$10 = {a = -3, b = 4.5, c = 5}
// gdbg-check:$10 = {a = -3, b = 4.5, c = 5}
// gdbr-check:$10 = var_captured_in_nested_closure::Struct {a: -3, b: 4.5, c: 5}
// gdb-command:print *owned
// gdb-check:$11 = 6
// gdb-command:print closure_local

View File

@ -19,7 +19,8 @@
// gdb-command:print constant
// gdb-check:$1 = 1
// gdb-command:print a_struct
// gdb-check:$2 = {a = -2, b = 3.5, c = 4}
// gdbg-check:$2 = {a = -2, b = 3.5, c = 4}
// gdbr-check:$2 = var_captured_in_sendable_closure::Struct {a: -2, b: 3.5, c: 4}
// gdb-command:print *owned
// gdb-check:$3 = 5
// gdb-command:continue

View File

@ -21,9 +21,11 @@
// gdb-command:print constant
// gdb-check:$2 = 2
// gdb-command:print a_struct
// gdb-check:$3 = {a = -3, b = 4.5, c = 5}
// gdbg-check:$3 = {a = -3, b = 4.5, c = 5}
// gdbr-check:$3 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5}
// gdb-command:print *struct_ref
// gdb-check:$4 = {a = -3, b = 4.5, c = 5}
// gdbg-check:$4 = {a = -3, b = 4.5, c = 5}
// gdbr-check:$4 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5}
// gdb-command:print *owned
// gdb-check:$5 = 6
@ -34,9 +36,11 @@
// gdb-command:print constant
// gdb-check:$7 = 2
// gdb-command:print a_struct
// gdb-check:$8 = {a = -3, b = 4.5, c = 5}
// gdbg-check:$8 = {a = -3, b = 4.5, c = 5}
// gdbr-check:$8 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5}
// gdb-command:print *struct_ref
// gdb-check:$9 = {a = -3, b = 4.5, c = 5}
// gdbg-check:$9 = {a = -3, b = 4.5, c = 5}
// gdbr-check:$9 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5}
// gdb-command:print *owned
// gdb-check:$10 = 6

View File

@ -21,42 +21,57 @@
// gdb-command:print singleton.length
// gdb-check:$2 = 1
// gdb-command:print *((int64_t[1]*)(singleton.data_ptr))
// gdb-check:$3 = {1}
// gdbg-command:print *((int64_t[1]*)(singleton.data_ptr))
// gdbr-command:print *(singleton.data_ptr as &[i64; 1])
// gdbg-check:$3 = {1}
// gdbr-check:$3 = [1]
// gdb-command:print multiple.length
// gdb-check:$4 = 4
// gdb-command:print *((int64_t[4]*)(multiple.data_ptr))
// gdb-check:$5 = {2, 3, 4, 5}
// gdbg-command:print *((int64_t[4]*)(multiple.data_ptr))
// gdbr-command:print *(multiple.data_ptr as &[i64; 4])
// gdbg-check:$5 = {2, 3, 4, 5}
// gdbr-check:$5 = [2, 3, 4, 5]
// gdb-command:print slice_of_slice.length
// gdb-check:$6 = 2
// gdb-command:print *((int64_t[2]*)(slice_of_slice.data_ptr))
// gdb-check:$7 = {3, 4}
// gdbg-command:print *((int64_t[2]*)(slice_of_slice.data_ptr))
// gdbr-command:print *(slice_of_slice.data_ptr as &[i64; 2])
// gdbg-check:$7 = {3, 4}
// gdbr-check:$7 = [3, 4]
// gdb-command:print padded_tuple.length
// gdb-check:$8 = 2
// gdb-command:print padded_tuple.data_ptr[0]
// gdb-check:$9 = {__0 = 6, __1 = 7}
// gdbg-check:$9 = {__0 = 6, __1 = 7}
// gdbr-check:$9 = (6, 7)
// gdb-command:print padded_tuple.data_ptr[1]
// gdb-check:$10 = {__0 = 8, __1 = 9}
// gdbg-check:$10 = {__0 = 8, __1 = 9}
// gdbr-check:$10 = (8, 9)
// gdb-command:print padded_struct.length
// gdb-check:$11 = 2
// gdb-command:print padded_struct.data_ptr[0]
// gdb-check:$12 = {x = 10, y = 11, z = 12}
// gdbg-check:$12 = {x = 10, y = 11, z = 12}
// gdbr-check:$12 = vec_slices::AStruct {x: 10, y: 11, z: 12}
// gdb-command:print padded_struct.data_ptr[1]
// gdb-check:$13 = {x = 13, y = 14, z = 15}
// gdbg-check:$13 = {x = 13, y = 14, z = 15}
// gdbr-check:$13 = vec_slices::AStruct {x: 13, y: 14, z: 15}
// gdb-command:print 'vec_slices::MUT_VECT_SLICE'.length
// gdbg-command:print 'vec_slices::MUT_VECT_SLICE'.length
// gdbr-command:print MUT_VECT_SLICE.length
// gdb-check:$14 = 2
// gdb-command:print *((int64_t[2]*)('vec_slices::MUT_VECT_SLICE'.data_ptr))
// gdb-check:$15 = {64, 65}
// gdbg-command:print *((int64_t[2]*)('vec_slices::MUT_VECT_SLICE'.data_ptr))
// gdbr-command:print *(MUT_VECT_SLICE.data_ptr as &[i64; 2])
// gdbg-check:$15 = {64, 65}
// gdbr-check:$15 = [64, 65]
//gdb-command:print mut_slice.length
//gdb-check:$16 = 5
//gdb-command:print *((int64_t[5]*)(mut_slice.data_ptr))
//gdb-check:$17 = {1, 2, 3, 4, 5}
//gdbg-command:print *((int64_t[5]*)(mut_slice.data_ptr))
//gdbr-command:print *(mut_slice.data_ptr as &[i64; 5])
//gdbg-check:$17 = {1, 2, 3, 4, 5}
//gdbr-check:$17 = [1, 2, 3, 4, 5]
// === LLDB TESTS ==================================================================================

View File

@ -16,9 +16,11 @@
// gdb-command:run
// gdb-command:print a
// gdb-check:$1 = {1, 2, 3}
// gdbg-check:$1 = {1, 2, 3}
// gdbr-check:$1 = [1, 2, 3]
// gdb-command:print vec::VECT
// gdb-check:$2 = {4, 5, 6}
// gdbg-check:$2 = {4, 5, 6}
// gdbr-check:$2 = [4, 5, 6]
// === LLDB TESTS ==================================================================================

View File

@ -146,8 +146,14 @@ pub struct Config {
// Host triple for the compiler being invoked
pub host: String,
// Version of GDB
pub gdb_version: Option<String>,
// Path to / name of the GDB executable
pub gdb: Option<String>,
// 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<String>,

View File

@ -18,6 +18,8 @@ use common::Config;
use common;
use util;
use extract_gdb_version;
/// Properties which must be known very early, before actually running
/// the test.
pub struct EarlyProps {
@ -75,7 +77,7 @@ impl EarlyProps {
return true;
}
if let Some(ref actual_version) = config.gdb_version {
if let Some(actual_version) = config.gdb_version {
if line.contains("min-gdb-version") {
let min_version = line.trim()
.split(' ')
@ -83,7 +85,7 @@ impl EarlyProps {
.expect("Malformed GDB version directive");
// Ignore if actual version is smaller the minimum required
// version
gdb_version_to_int(actual_version) < gdb_version_to_int(min_version)
actual_version < extract_gdb_version(min_version).unwrap()
} else {
false
}
@ -464,23 +466,6 @@ pub fn parse_name_value_directive(line: &str, directive: &str) -> Option<String>
}
}
pub fn gdb_version_to_int(version_string: &str) -> isize {
let error_string = format!("Encountered GDB version string with unexpected format: {}",
version_string);
let error_string = error_string;
let components: Vec<&str> = version_string.trim().split('.').collect();
if components.len() != 2 {
panic!("{}", error_string);
}
let major: isize = components[0].parse().ok().expect(&error_string);
let minor: isize = components[1].parse().ok().expect(&error_string);
return major * 1000 + minor;
}
pub fn lldb_version_to_int(version_string: &str) -> isize {
let error_string = format!("Encountered LLDB version string with unexpected format: {}",
version_string);

View File

@ -12,6 +12,7 @@
#![feature(box_syntax)]
#![feature(rustc_private)]
#![feature(static_in_const)]
#![feature(test)]
#![feature(libc)]
@ -35,6 +36,7 @@ use std::ffi::OsString;
use std::fs;
use std::io;
use std::path::{Path, PathBuf};
use std::process::Command;
use getopts::{optopt, optflag, reqopt};
use common::Config;
use common::{Pretty, DebugInfoGdb, DebugInfoLldb, Mode};
@ -98,7 +100,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
optopt("", "logfile", "file to log test execution to", "FILE"),
optopt("", "target", "the target to build for", "TARGET"),
optopt("", "host", "the host to build for", "HOST"),
optopt("", "gdb-version", "the version of GDB used", "VERSION STRING"),
optopt("", "gdb", "path to GDB to use for GDB debuginfo tests", "PATH"),
optopt("", "lldb-version", "the version of LLDB used", "VERSION STRING"),
optopt("", "llvm-version", "the version of LLVM used", "VERSION STRING"),
optopt("", "android-cross-path", "Android NDK standalone path", "PATH"),
@ -149,6 +151,8 @@ pub fn parse_config(args: Vec<String> ) -> Config {
}
}
let (gdb, gdb_version, gdb_native_rust) = analyze_gdb(matches.opt_str("gdb"));
Config {
compile_lib_path: make_absolute(opt_path(matches, "compile-lib-path")),
run_lib_path: make_absolute(opt_path(matches, "run-lib-path")),
@ -171,7 +175,9 @@ pub fn parse_config(args: Vec<String> ) -> Config {
target_rustcflags: matches.opt_str("target-rustcflags"),
target: opt_str2(matches.opt_str("target")),
host: opt_str2(matches.opt_str("host")),
gdb_version: extract_gdb_version(matches.opt_str("gdb-version")),
gdb: gdb,
gdb_version: gdb_version,
gdb_native_rust: gdb_native_rust,
lldb_version: extract_lldb_version(matches.opt_str("lldb-version")),
llvm_version: matches.opt_str("llvm-version"),
android_cross_path: opt_path(matches, "android-cross-path"),
@ -470,44 +476,96 @@ pub fn make_test_closure(config: &Config, testpaths: &TestPaths) -> test::TestFn
}))
}
fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
match full_version_line {
Some(ref full_version_line)
if !full_version_line.trim().is_empty() => {
let full_version_line = full_version_line.trim();
/// Returns (Path to GDB, GDB Version, GDB has Rust Support)
fn analyze_gdb(gdb: Option<String>) -> (Option<String>, Option<u32>, bool) {
#[cfg(not(windows))]
const GDB_FALLBACK: &str = "gdb";
#[cfg(windows)]
const GDB_FALLBACK: &str = "gdb.exe";
// used to be a regex "(^|[^0-9])([0-9]\.[0-9]+)"
for (pos, c) in full_version_line.char_indices() {
if !c.is_digit(10) {
continue
}
if pos + 2 >= full_version_line.len() {
continue
}
if full_version_line[pos + 1..].chars().next().unwrap() != '.' {
continue
}
if !full_version_line[pos + 2..].chars().next().unwrap().is_digit(10) {
continue
}
if pos > 0 && full_version_line[..pos].chars().next_back()
.unwrap().is_digit(10) {
continue
}
let mut end = pos + 3;
while end < full_version_line.len() &&
full_version_line[end..].chars().next()
.unwrap().is_digit(10) {
end += 1;
}
return Some(full_version_line[pos..end].to_owned());
}
println!("Could not extract GDB version from line '{}'",
full_version_line);
None
},
_ => None
const MIN_GDB_WITH_RUST: u32 = 7011010;
let gdb = match gdb {
None => GDB_FALLBACK,
Some(ref s) if s.is_empty() => GDB_FALLBACK, // may be empty if configure found no gdb
Some(ref s) => s,
};
let version_line = Command::new(gdb).arg("--version").output().map(|output| {
String::from_utf8_lossy(&output.stdout).lines().next().unwrap().to_string()
}).ok();
let version = match version_line {
Some(line) => extract_gdb_version(&line),
None => return (None, None, false),
};
let gdb_native_rust = version.map_or(false, |v| v >= MIN_GDB_WITH_RUST);
return (Some(gdb.to_owned()), version, gdb_native_rust);
}
fn extract_gdb_version(full_version_line: &str) -> Option<u32> {
let full_version_line = full_version_line.trim();
// GDB versions look like this: "major.minor.patch?.yyyymmdd?", with both
// of the ? sections being optional
// We will parse up to 3 digits for minor and patch, ignoring the date
// We limit major to 1 digit, otherwise, on openSUSE, we parse the openSUSE version
// don't start parsing in the middle of a number
let mut prev_was_digit = false;
for (pos, c) in full_version_line.char_indices() {
if prev_was_digit || !c.is_digit(10) {
prev_was_digit = c.is_digit(10);
continue
}
prev_was_digit = true;
let line = &full_version_line[pos..];
let next_split = match line.find(|c: char| !c.is_digit(10)) {
Some(idx) => idx,
None => continue, // no minor version
};
if line.as_bytes()[next_split] != b'.' {
continue; // no minor version
}
let major = &line[..next_split];
let line = &line[next_split + 1..];
let (minor, patch) = match line.find(|c: char| !c.is_digit(10)) {
Some(idx) => if line.as_bytes()[idx] == b'.' {
let patch = &line[idx + 1..];
let patch_len = patch.find(|c: char| !c.is_digit(10)).unwrap_or(patch.len());
let patch = &patch[..patch_len];
let patch = if patch_len > 3 || patch_len == 0 { None } else { Some(patch) };
(&line[..idx], patch)
} else {
(&line[..idx], None)
},
None => (line, None),
};
if major.len() != 1 || minor.is_empty() {
continue;
}
let major: u32 = major.parse().unwrap();
let minor: u32 = minor.parse().unwrap();
let patch: u32 = patch.unwrap_or("0").parse().unwrap();
return Some(((major * 1000) + minor) * 1000 + patch);
}
println!("Could not extract GDB version from line '{}'", full_version_line);
None
}
fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
@ -553,3 +611,44 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
fn is_blacklisted_lldb_version(version: &str) -> bool {
version == "350"
}
#[test]
fn test_extract_gdb_version() {
macro_rules! test { ($($expectation:tt: $input:tt,)*) => {{$(
assert_eq!(extract_gdb_version($input), Some($expectation));
)*}}}
test! {
7000001: "GNU gdb (GDB) CentOS (7.0.1-45.el5.centos)",
7002000: "GNU gdb (GDB) Red Hat Enterprise Linux (7.2-90.el6)",
7004000: "GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04",
7004001: "GNU gdb (GDB) 7.4.1-debian",
7006001: "GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7",
7007001: "GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1",
7007001: "GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1",
7007001: "GNU gdb (GDB) Fedora 7.7.1-21.fc20",
7008000: "GNU gdb (GDB; openSUSE 13.2) 7.8",
7009001: "GNU gdb (GDB) Fedora 7.9.1-20.fc22",
7010001: "GNU gdb (GDB) Fedora 7.10.1-31.fc23",
7011000: "GNU gdb (Ubuntu 7.11-0ubuntu1) 7.11",
7011001: "GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1",
7011001: "GNU gdb (Debian 7.11.1-2) 7.11.1",
7011001: "GNU gdb (GDB) Fedora 7.11.1-86.fc24",
7011001: "GNU gdb (GDB; openSUSE Leap 42.1) 7.11.1",
7011001: "GNU gdb (GDB; openSUSE Tumbleweed) 7.11.1",
7011090: "7.11.90",
7011090: "GNU gdb (Ubuntu 7.11.90.20161005-0ubuntu1) 7.11.90.20161005-git",
7012000: "7.12",
7012000: "GNU gdb (GDB) 7.12",
7012000: "GNU gdb (GDB) 7.12.20161027-git",
7012050: "GNU gdb (GDB) 7.12.50.20161027-git",
}
}

View File

@ -32,6 +32,8 @@ use std::path::{Path, PathBuf};
use std::process::{Command, Output, ExitStatus};
use std::str;
use extract_gdb_version;
pub fn run(config: Config, testpaths: &TestPaths) {
match &*config.target {
@ -41,7 +43,12 @@ pub fn run(config: Config, testpaths: &TestPaths) {
}
}
_=> { }
_ => {
// android has it's own gdb handling
if config.mode == DebugInfoGdb && config.gdb.is_none() {
panic!("gdb not available but debuginfo gdb debuginfo test requested");
}
}
}
if config.verbose {
@ -430,11 +437,23 @@ actual:\n\
}
fn run_debuginfo_gdb_test_no_opt(&self) {
let prefixes = if self.config.gdb_native_rust {
// GDB with Rust
static PREFIXES: &'static [&'static str] = &["gdb", "gdbr"];
println!("NOTE: compiletest thinks it is using GDB with native rust support");
PREFIXES
} else {
// Generic GDB
static PREFIXES: &'static [&'static str] = &["gdb", "gdbg"];
println!("NOTE: compiletest thinks it is using GDB without native rust support");
PREFIXES
};
let DebuggerCommands {
commands,
check_lines,
breakpoint_lines
} = self.parse_debugger_commands("gdb");
} = self.parse_debugger_commands(prefixes);
let mut cmds = commands.join("\n");
// compile test file (it should have 'compile-flags:-g' in the header)
@ -586,19 +605,18 @@ actual:\n\
script_str.push_str("show version\n");
match self.config.gdb_version {
Some(ref version) => {
Some(version) => {
println!("NOTE: compiletest thinks it is using GDB version {}",
version);
if header::gdb_version_to_int(version) >
header::gdb_version_to_int("7.4") {
// Add the directory containing the pretty printers to
// GDB's script auto loading safe path
script_str.push_str(
&format!("add-auto-load-safe-path {}\n",
rust_pp_module_abs_path.replace(r"\", r"\\"))
);
}
if version > extract_gdb_version("7.4").unwrap() {
// Add the directory containing the pretty printers to
// GDB's script auto loading safe path
script_str.push_str(
&format!("add-auto-load-safe-path {}\n",
rust_pp_module_abs_path.replace(r"\", r"\\"))
);
}
}
_ => {
println!("NOTE: compiletest does not know which version of \
@ -633,11 +651,6 @@ actual:\n\
debug!("script_str = {}", script_str);
self.dump_output_file(&script_str, "debugger.script");
// run debugger script with gdb
fn debugger() -> &'static str {
if cfg!(windows) {"gdb.exe"} else {"gdb"}
}
let debugger_script = self.make_out_name("debugger.script");
// FIXME (#9639): This needs to handle non-utf8 paths
@ -648,7 +661,7 @@ actual:\n\
format!("-command={}", debugger_script.to_str().unwrap())];
let proc_args = ProcArgs {
prog: debugger().to_owned(),
prog: self.config.gdb.as_ref().unwrap().to_owned(),
args: debugger_opts,
};
@ -731,7 +744,7 @@ actual:\n\
check_lines,
breakpoint_lines,
..
} = self.parse_debugger_commands("lldb");
} = self.parse_debugger_commands(&["lldb"]);
// Write debugger script:
// We don't want to hang when calling `quit` while the process is still running
@ -826,9 +839,11 @@ actual:\n\
}
}
fn parse_debugger_commands(&self, debugger_prefix: &str) -> DebuggerCommands {
let command_directive = format!("{}-command", debugger_prefix);
let check_directive = format!("{}-check", debugger_prefix);
fn parse_debugger_commands(&self, debugger_prefixes: &[&str]) -> DebuggerCommands {
let directives = debugger_prefixes.iter().map(|prefix| (
format!("{}-command", prefix),
format!("{}-check", prefix),
)).collect::<Vec<_>>();
let mut breakpoint_lines = vec![];
let mut commands = vec![];
@ -842,17 +857,19 @@ actual:\n\
breakpoint_lines.push(counter);
}
header::parse_name_value_directive(
&line,
&command_directive).map(|cmd| {
commands.push(cmd)
});
for &(ref command_directive, ref check_directive) in &directives {
header::parse_name_value_directive(
&line,
&command_directive).map(|cmd| {
commands.push(cmd)
});
header::parse_name_value_directive(
&line,
&check_directive).map(|cmd| {
check_lines.push(cmd)
});
header::parse_name_value_directive(
&line,
&check_directive).map(|cmd| {
check_lines.push(cmd)
});
}
}
Err(e) => {
self.fatal(&format!("Error while parsing debugger commands: {}", e))