Skip to content

Commit 71b99d4

Browse files
committed
---
yaml --- r: 130413 b: refs/heads/try c: 27e8d5b h: refs/heads/master i: 130411: 68dc07e v: v3
1 parent 16b1d24 commit 71b99d4

File tree

517 files changed

+11352
-6576
lines changed

Some content is hidden

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

517 files changed

+11352
-6576
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: c964cb229bd342bdeb0b4506c3a6d32b03e575f6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 67b97ab6d2b7de9b69fd97dc171fcf8feec932ff
5-
refs/heads/try: 2b312eca89c4da41403f594d9a8887dfed55d54c
5+
refs/heads/try: 27e8d5bca79c09258c757e9be6e13aaa24086d84
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/configure

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,13 @@ probe CFG_LUALATEX lualatex
515515
probe CFG_GDB gdb
516516
probe CFG_LLDB lldb
517517

518+
if [ ! -z "$CFG_GDB" ]
519+
then
520+
# Extract the version
521+
CFG_GDB_VERSION=$($CFG_GDB --version 2>/dev/null | head -1)
522+
putvar CFG_GDB_VERSION
523+
fi
524+
518525
if [ ! -z "$CFG_LLDB" ]
519526
then
520527
# If CFG_LLDB_PYTHON_DIR is not already set from the outside and valid, try to read it from

branches/try/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ DEPS_test := std getopts serialize rbml term time regex native:rust_test_helpers
9696
DEPS_time := std serialize
9797
DEPS_rand := core
9898
DEPS_url := std
99-
DEPS_log := std
99+
DEPS_log := std regex
100100
DEPS_regex := std
101101
DEPS_regex_macros = rustc syntax std regex
102102
DEPS_fmt_macros = std

branches/try/mk/tests.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
623623
--stage-id stage$(1)-$(2) \
624624
--target $(2) \
625625
--host $(3) \
626+
--gdb-version="$(CFG_GDB_VERSION)" \
626627
--android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
627628
--adb-path=$(CFG_ADB) \
628629
--adb-test-dir=$(CFG_ADB_TEST_DIR) \

branches/try/src/compiletest/common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ pub struct Config {
130130
// Host triple for the compiler being invoked
131131
pub host: String,
132132

133+
// Version of GDB
134+
pub gdb_version: Option<String>,
135+
133136
// Path to the android tools
134137
pub android_cross_path: Path,
135138

branches/try/src/compiletest/compiletest.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
8181
optflag("", "jit", "run tests under the JIT"),
8282
optopt("", "target", "the target to build for", "TARGET"),
8383
optopt("", "host", "the host to build for", "HOST"),
84+
optopt("", "gdb-version", "the version of GDB used", "MAJOR.MINOR"),
8485
optopt("", "android-cross-path", "Android NDK standalone path", "PATH"),
8586
optopt("", "adb-path", "path to the android debugger", "PATH"),
8687
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
@@ -157,6 +158,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
157158
jit: matches.opt_present("jit"),
158159
target: opt_str2(matches.opt_str("target")),
159160
host: opt_str2(matches.opt_str("host")),
161+
gdb_version: extract_gdb_version(matches.opt_str("gdb-version")),
160162
android_cross_path: opt_path(matches, "android-cross-path"),
161163
adb_path: opt_str2(matches.opt_str("adb-path")),
162164
adb_test_dir: opt_str2(matches.opt_str("adb-test-dir")),
@@ -376,3 +378,26 @@ pub fn make_metrics_test_closure(config: &Config, testfile: &Path) -> test::Test
376378
runtest::run_metrics(config, testfile, mm)
377379
})
378380
}
381+
382+
fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
383+
match full_version_line {
384+
Some(ref full_version_line)
385+
if full_version_line.as_slice().trim().len() > 0 => {
386+
let full_version_line = full_version_line.as_slice().trim();
387+
388+
let re = Regex::new(r"(^|[^0-9])([0-9]\.[0-9])([^0-9]|$)").unwrap();
389+
390+
match re.captures(full_version_line) {
391+
Some(captures) => {
392+
Some(captures.at(2).to_string())
393+
}
394+
None => {
395+
println!("Could not extract GDB version from line '{}'",
396+
full_version_line);
397+
None
398+
}
399+
}
400+
},
401+
_ => None
402+
}
403+
}

branches/try/src/compiletest/header.rs

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ use common::Config;
1212
use common;
1313
use util;
1414

15+
use std::from_str::FromStr;
16+
1517
pub struct TestProps {
1618
// Lines that should be expected, in order, on standard out
1719
pub error_patterns: Vec<String> ,
@@ -142,23 +144,42 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
142144
format!("ignore-{}",
143145
config.stage_id.as_slice().split('-').next().unwrap())
144146
}
147+
fn ignore_gdb(config: &Config, line: &str) -> bool {
148+
if config.mode != common::DebugInfoGdb {
149+
return false;
150+
}
145151

146-
let val = iter_header(testfile, |ln| {
147-
if parse_name_directive(ln, "ignore-test") {
148-
false
149-
} else if parse_name_directive(ln, ignore_target(config).as_slice()) {
150-
false
151-
} else if parse_name_directive(ln, ignore_stage(config).as_slice()) {
152-
false
153-
} else if config.mode == common::Pretty &&
154-
parse_name_directive(ln, "ignore-pretty") {
155-
false
156-
} else if config.target != config.host &&
157-
parse_name_directive(ln, "ignore-cross-compile") {
158-
false
159-
} else {
160-
true
152+
if parse_name_directive(line, "ignore-gdb") {
153+
return true;
161154
}
155+
156+
match config.gdb_version {
157+
Some(ref actual_version) => {
158+
if line.contains("min-gdb-version") {
159+
let min_version = line.trim()
160+
.split(' ')
161+
.last()
162+
.expect("Malformed GDB version directive");
163+
// Ignore if actual version is smaller the minimum required
164+
// version
165+
gdb_version_to_int(actual_version.as_slice()) <
166+
gdb_version_to_int(min_version.as_slice())
167+
} else {
168+
false
169+
}
170+
}
171+
None => false
172+
}
173+
}
174+
175+
let val = iter_header(testfile, |ln| {
176+
!parse_name_directive(ln, "ignore-test") &&
177+
!parse_name_directive(ln, ignore_target(config).as_slice()) &&
178+
!parse_name_directive(ln, ignore_stage(config).as_slice()) &&
179+
!(config.mode == common::Pretty && parse_name_directive(ln, "ignore-pretty")) &&
180+
!(config.target != config.host && parse_name_directive(ln, "ignore-cross-compile")) &&
181+
!ignore_gdb(config, ln) &&
182+
!(config.mode == common::DebugInfoLldb && parse_name_directive(ln, "ignore-lldb"))
162183
});
163184

164185
!val
@@ -278,3 +299,21 @@ pub fn parse_name_value_directive(line: &str, directive: &str)
278299
None => None
279300
}
280301
}
302+
303+
pub fn gdb_version_to_int(version_string: &str) -> int {
304+
let error_string = format!(
305+
"Encountered GDB version string with unexpected format: {}",
306+
version_string);
307+
let error_string = error_string.as_slice();
308+
309+
let components: Vec<&str> = version_string.trim().split('.').collect();
310+
311+
if components.len() != 2 {
312+
fail!("{}", error_string);
313+
}
314+
315+
let major: int = FromStr::from_str(components[0]).expect(error_string);
316+
let minor: int = FromStr::from_str(components[1]).expect(error_string);
317+
318+
return major * 1000 + minor;
319+
}

branches/try/src/compiletest/procsrv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn run(lib_path: &str,
4747
match cmd.spawn() {
4848
Ok(mut process) => {
4949
for input in input.iter() {
50-
process.stdin.get_mut_ref().write(input.as_bytes()).unwrap();
50+
process.stdin.as_mut().unwrap().write(input.as_bytes()).unwrap();
5151
}
5252
let ProcessOutput { status, output, error } =
5353
process.wait_with_output().unwrap();
@@ -79,7 +79,7 @@ pub fn run_background(lib_path: &str,
7979
match cmd.spawn() {
8080
Ok(mut process) => {
8181
for input in input.iter() {
82-
process.stdin.get_mut_ref().write(input.as_bytes()).unwrap();
82+
process.stdin.as_mut().unwrap().write(input.as_bytes()).unwrap();
8383
}
8484

8585
Some(process)

0 commit comments

Comments
 (0)