-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto merge of #13143 : gentlefolk/rust/issue-9227, r=michaelwoerister
Only supports crate level statics. No debug info is generated for function level statics. Closes #9227. As discussed at the end of the comments for #9227, I took an initial stab at adding support for function level statics and decided it would be enough work to warrant being split into a separate issue. See #13144 for the new issue describing the need to add support for function level static variables.
- Loading branch information
Showing
15 changed files
with
711 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// ignore-android: FIXME(#10381) | ||
|
||
// compile-flags:-g | ||
// debugger:rbreak zzz | ||
// debugger:run | ||
// debugger:finish | ||
// debugger:whatis 'basic-types-globals-metadata::B' | ||
// check:type = bool | ||
// debugger:whatis 'basic-types-globals-metadata::I' | ||
// check:type = int | ||
// debugger:whatis 'basic-types-globals-metadata::C' | ||
// check:type = char | ||
// debugger:whatis 'basic-types-globals-metadata::I8' | ||
// check:type = i8 | ||
// debugger:whatis 'basic-types-globals-metadata::I16' | ||
// check:type = i16 | ||
// debugger:whatis 'basic-types-globals-metadata::I32' | ||
// check:type = i32 | ||
// debugger:whatis 'basic-types-globals-metadata::I64' | ||
// check:type = i64 | ||
// debugger:whatis 'basic-types-globals-metadata::U' | ||
// check:type = uint | ||
// debugger:whatis 'basic-types-globals-metadata::U8' | ||
// check:type = u8 | ||
// debugger:whatis 'basic-types-globals-metadata::U16' | ||
// check:type = u16 | ||
// debugger:whatis 'basic-types-globals-metadata::U32' | ||
// check:type = u32 | ||
// debugger:whatis 'basic-types-globals-metadata::U64' | ||
// check:type = u64 | ||
// debugger:whatis 'basic-types-globals-metadata::F32' | ||
// check:type = f32 | ||
// debugger:whatis 'basic-types-globals-metadata::F64' | ||
// check:type = f64 | ||
// debugger:continue | ||
|
||
#[allow(unused_variable)]; | ||
|
||
static B: bool = false; | ||
static I: int = -1; | ||
static C: char = 'a'; | ||
static I8: i8 = 68; | ||
static I16: i16 = -16; | ||
static I32: i32 = -32; | ||
static I64: i64 = -64; | ||
static U: uint = 1; | ||
static U8: u8 = 100; | ||
static U16: u16 = 16; | ||
static U32: u32 = 32; | ||
static U64: u64 = 64; | ||
static F32: f32 = 2.5; | ||
static F64: f64 = 3.5; | ||
|
||
fn main() { | ||
_zzz(); | ||
} | ||
|
||
fn _zzz() {()} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// Caveats - gdb prints any 8-bit value (meaning rust I8 and u8 values) | ||
// as its numerical value along with its associated ASCII char, there | ||
// doesn't seem to be any way around this. Also, gdb doesn't know | ||
// about UTF-32 character encoding and will print a rust char as only | ||
// its numerical value. | ||
|
||
// ignore-android: FIXME(#10381) | ||
|
||
// compile-flags:-g | ||
// debugger:rbreak zzz | ||
// debugger:run | ||
// debugger:finish | ||
// debugger:print 'basic-types-globals::B' | ||
// check:$1 = false | ||
// debugger:print 'basic-types-globals::I' | ||
// check:$2 = -1 | ||
// debugger:print 'basic-types-globals::C' | ||
// check:$3 = 97 | ||
// debugger:print/d 'basic-types-globals::I8' | ||
// check:$4 = 68 | ||
// debugger:print 'basic-types-globals::I16' | ||
// check:$5 = -16 | ||
// debugger:print 'basic-types-globals::I32' | ||
// check:$6 = -32 | ||
// debugger:print 'basic-types-globals::I64' | ||
// check:$7 = -64 | ||
// debugger:print 'basic-types-globals::U' | ||
// check:$8 = 1 | ||
// debugger:print/d 'basic-types-globals::U8' | ||
// check:$9 = 100 | ||
// debugger:print 'basic-types-globals::U16' | ||
// check:$10 = 16 | ||
// debugger:print 'basic-types-globals::U32' | ||
// check:$11 = 32 | ||
// debugger:print 'basic-types-globals::U64' | ||
// check:$12 = 64 | ||
// debugger:print 'basic-types-globals::F32' | ||
// check:$13 = 2.5 | ||
// debugger:print 'basic-types-globals::F64' | ||
// check:$14 = 3.5 | ||
// debugger:continue | ||
|
||
#[allow(unused_variable)]; | ||
|
||
static B: bool = false; | ||
static I: int = -1; | ||
static C: char = 'a'; | ||
static I8: i8 = 68; | ||
static I16: i16 = -16; | ||
static I32: i32 = -32; | ||
static I64: i64 = -64; | ||
static U: uint = 1; | ||
static U8: u8 = 100; | ||
static U16: u16 = 16; | ||
static U32: u32 = 32; | ||
static U64: u64 = 64; | ||
static F32: f32 = 2.5; | ||
static F64: f64 = 3.5; | ||
|
||
fn main() { | ||
_zzz(); | ||
} | ||
|
||
fn _zzz() {()} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.