Skip to content

Commit dce081c

Browse files
committed
---
yaml --- r: 130269 b: refs/heads/auto c: 968b128 h: refs/heads/master i: 130267: 09f9396 v: v3
1 parent 3644004 commit dce081c

File tree

258 files changed

+3117
-5008
lines changed

Some content is hidden

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

258 files changed

+3117
-5008
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: b7d456dfea5487c13ff0389c905693aad85f775f
16+
refs/heads/auto: 968b1280e34848f7cf37358c9fd76af18cac2ec7
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/configure

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -515,13 +515,6 @@ 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-
525518
if [ ! -z "$CFG_LLDB" ]
526519
then
527520
# If CFG_LLDB_PYTHON_DIR is not already set from the outside and valid, try to read it from

branches/auto/mk/tests.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,6 @@ 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)" \
627626
--android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
628627
--adb-path=$(CFG_ADB) \
629628
--adb-test-dir=$(CFG_ADB_TEST_DIR) \

branches/auto/src/compiletest/common.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,6 @@ 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-
136133
// Path to the android tools
137134
pub android_cross_path: Path,
138135

branches/auto/src/compiletest/compiletest.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ 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"),
8584
optopt("", "android-cross-path", "Android NDK standalone path", "PATH"),
8685
optopt("", "adb-path", "path to the android debugger", "PATH"),
8786
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
@@ -158,7 +157,6 @@ pub fn parse_config(args: Vec<String> ) -> Config {
158157
jit: matches.opt_present("jit"),
159158
target: opt_str2(matches.opt_str("target")),
160159
host: opt_str2(matches.opt_str("host")),
161-
gdb_version: extract_gdb_version(matches.opt_str("gdb-version")),
162160
android_cross_path: opt_path(matches, "android-cross-path"),
163161
adb_path: opt_str2(matches.opt_str("adb-path")),
164162
adb_test_dir: opt_str2(matches.opt_str("adb-test-dir")),
@@ -378,26 +376,3 @@ pub fn make_metrics_test_closure(config: &Config, testfile: &Path) -> test::Test
378376
runtest::run_metrics(config, testfile, mm)
379377
})
380378
}
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/auto/src/compiletest/header.rs

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

15-
use std::from_str::FromStr;
16-
1715
pub struct TestProps {
1816
// Lines that should be expected, in order, on standard out
1917
pub error_patterns: Vec<String> ,
@@ -144,42 +142,23 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
144142
format!("ignore-{}",
145143
config.stage_id.as_slice().split('-').next().unwrap())
146144
}
147-
fn ignore_gdb(config: &Config, line: &str) -> bool {
148-
if config.mode != common::DebugInfoGdb {
149-
return false;
150-
}
151-
152-
if parse_name_directive(line, "ignore-gdb") {
153-
return true;
154-
}
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-
}
174145

175146
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"))
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
161+
}
183162
});
184163

185164
!val
@@ -299,21 +278,3 @@ pub fn parse_name_value_directive(line: &str, directive: &str)
299278
None => None
300279
}
301280
}
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/auto/src/compiletest/runtest.rs

Lines changed: 13 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
323323
};
324324

325325
let config = &mut config;
326-
let DebuggerCommands {
327-
commands,
328-
check_lines,
329-
use_gdb_pretty_printer,
330-
..
331-
} = parse_debugger_commands(testfile, "gdb");
326+
let DebuggerCommands { commands, check_lines, .. } = parse_debugger_commands(testfile, "gdb");
332327
let mut cmds = commands.connect("\n");
333328

334329
// compile test file (it should have 'compile-flags:-g' in the header)
@@ -339,6 +334,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
339334

340335
let exe_file = make_exe_name(config, testfile);
341336

337+
let mut proc_args;
342338
let debugger_run_result;
343339
match config.target.as_slice() {
344340
"arm-linux-androideabi" => {
@@ -458,65 +454,18 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
458454
}
459455

460456
_=> {
461-
let rust_src_root = find_rust_src_root(config)
462-
.expect("Could not find Rust source root");
463-
let rust_pp_module_rel_path = Path::new("./src/etc");
464-
let rust_pp_module_abs_path = rust_src_root.join(rust_pp_module_rel_path)
465-
.as_str()
466-
.unwrap()
467-
.to_string();
468457
// write debugger script
469-
let mut script_str = String::with_capacity(2048);
470-
471-
script_str.push_str("set charset UTF-8\n");
472-
script_str.push_str("show version\n");
473-
474-
match config.gdb_version {
475-
Some(ref version) => {
476-
println!("NOTE: compiletest thinks it is using GDB version {}",
477-
version.as_slice());
478-
479-
if header::gdb_version_to_int(version.as_slice()) >
480-
header::gdb_version_to_int("7.4") {
481-
// Add the directory containing the pretty printers to
482-
// GDB's script auto loading safe path ...
483-
script_str.push_str(
484-
format!("add-auto-load-safe-path {}\n",
485-
rust_pp_module_abs_path.as_slice())
486-
.as_slice());
487-
// ... and also the test directory
488-
script_str.push_str(
489-
format!("add-auto-load-safe-path {}\n",
490-
config.build_base.as_str().unwrap())
491-
.as_slice());
492-
}
493-
}
494-
_ => {
495-
println!("NOTE: compiletest does not know which version of \
496-
GDB it is using");
497-
}
498-
}
499-
500-
// Load the target executable
501-
script_str.push_str(format!("file {}\n",
502-
exe_file.as_str().unwrap())
503-
.as_slice());
504-
505-
script_str.push_str(cmds.as_slice());
506-
script_str.push_str("quit\n");
507-
458+
let script_str = [
459+
"set charset UTF-8".to_string(),
460+
cmds,
461+
"quit\n".to_string()
462+
].connect("\n");
508463
debug!("script_str = {}", script_str);
509464
dump_output_file(config,
510465
testfile,
511466
script_str.as_slice(),
512467
"debugger.script");
513468

514-
if use_gdb_pretty_printer {
515-
// Only emit the gdb auto-loading script if pretty printers
516-
// should actually be loaded
517-
dump_gdb_autoload_script(config, testfile);
518-
}
519-
520469
// run debugger script with gdb
521470
#[cfg(windows)]
522471
fn debugger() -> String {
@@ -534,19 +483,16 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
534483
vec!("-quiet".to_string(),
535484
"-batch".to_string(),
536485
"-nx".to_string(),
537-
format!("-command={}", debugger_script.as_str().unwrap()));
538-
539-
let proc_args = ProcArgs {
486+
format!("-command={}", debugger_script.as_str().unwrap()),
487+
exe_file.as_str().unwrap().to_string());
488+
proc_args = ProcArgs {
540489
prog: debugger(),
541490
args: debugger_opts,
542491
};
543-
544-
let environment = vec![("PYTHONPATH".to_string(), rust_pp_module_abs_path)];
545-
546492
debugger_run_result = compose_and_run(config,
547493
testfile,
548494
proc_args,
549-
environment,
495+
Vec::new(),
550496
config.run_lib_path.as_slice(),
551497
None,
552498
None);
@@ -558,32 +504,6 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
558504
}
559505

560506
check_debugger_output(&debugger_run_result, check_lines.as_slice());
561-
562-
fn dump_gdb_autoload_script(config: &Config, testfile: &Path) {
563-
let mut script_path = output_base_name(config, testfile);
564-
let mut script_file_name = script_path.filename().unwrap().to_vec();
565-
script_file_name.push_all("-gdb.py".as_bytes());
566-
script_path.set_filename(script_file_name.as_slice());
567-
568-
let script_content = "import gdb_rust_pretty_printing\n\
569-
gdb_rust_pretty_printing.register_printers(gdb.current_objfile())\n"
570-
.as_bytes();
571-
572-
File::create(&script_path).write(script_content).unwrap();
573-
}
574-
}
575-
576-
fn find_rust_src_root(config: &Config) -> Option<Path> {
577-
let mut path = config.src_base.clone();
578-
let path_postfix = Path::new("src/etc/lldb_batchmode.py");
579-
580-
while path.pop() {
581-
if path.join(path_postfix.clone()).is_file() {
582-
return Some(path);
583-
}
584-
}
585-
586-
return None;
587507
}
588508

589509
fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path) {
@@ -613,8 +533,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
613533
let DebuggerCommands {
614534
commands,
615535
check_lines,
616-
breakpoint_lines,
617-
..
536+
breakpoint_lines
618537
} = parse_debugger_commands(testfile, "lldb");
619538

620539
// Write debugger script:
@@ -700,7 +619,6 @@ struct DebuggerCommands {
700619
commands: Vec<String>,
701620
check_lines: Vec<String>,
702621
breakpoint_lines: Vec<uint>,
703-
use_gdb_pretty_printer: bool
704622
}
705623

706624
fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str)
@@ -713,7 +631,6 @@ fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str)
713631
let mut breakpoint_lines = vec!();
714632
let mut commands = vec!();
715633
let mut check_lines = vec!();
716-
let mut use_gdb_pretty_printer = false;
717634
let mut counter = 1;
718635
let mut reader = BufferedReader::new(File::open(file_path).unwrap());
719636
for line in reader.lines() {
@@ -723,10 +640,6 @@ fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str)
723640
breakpoint_lines.push(counter);
724641
}
725642

726-
if line.as_slice().contains("gdb-use-pretty-printer") {
727-
use_gdb_pretty_printer = true;
728-
}
729-
730643
header::parse_name_value_directive(
731644
line.as_slice(),
732645
command_directive.as_slice()).map(|cmd| {
@@ -750,8 +663,7 @@ fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str)
750663
DebuggerCommands {
751664
commands: commands,
752665
check_lines: check_lines,
753-
breakpoint_lines: breakpoint_lines,
754-
use_gdb_pretty_printer: use_gdb_pretty_printer,
666+
breakpoint_lines: breakpoint_lines
755667
}
756668
}
757669

branches/auto/src/doc/complement-lang-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ We want to maintain the option to parametrize at runtime. We may eventually chan
8383

8484
## Why aren't values type-parametric? Why only items?
8585

86-
Doing so would make type inference much more complex, and require the implementation strategy of runtime parameterization.
86+
Doing so would make type inference much more complex, and require the implementation strategy of runtime parametrization.
8787

8888
## Why are enumerations nominal and closed?
8989

branches/auto/src/doc/guide-ffi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ extern crate libc;
477477

478478
#[cfg(target_os = "win32", target_arch = "x86")]
479479
#[link(name = "kernel32")]
480-
#[allow(non_snake_case)]
480+
#[allow(non_snake_case_functions)]
481481
extern "stdcall" {
482482
fn SetEnvironmentVariableA(n: *const u8, v: *const u8) -> libc::c_int;
483483
}
@@ -528,8 +528,8 @@ the `libc` module, and Rust links against `libc` and `libm` by default.
528528
# The "nullable pointer optimization"
529529
530530
Certain types are defined to not be `null`. This includes references (`&T`,
531-
`&mut T`), boxes (`Box<T>`), and function pointers (`extern "abi" fn()`).
532-
When interfacing with C, pointers that might be null are often used.
531+
`&mut T`), owning pointers (`~T`), and function pointers (`extern "abi"
532+
fn()`). When interfacing with C, pointers that might be null are often used.
533533
As a special case, a generic `enum` that contains exactly two variants, one of
534534
which contains no data and the other containing a single field, is eligible
535535
for the "nullable pointer optimization". When such an enum is instantiated

0 commit comments

Comments
 (0)