diff options
| author | bors <bors@rust-lang.org> | 2016-10-22 10:02:19 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-22 10:02:19 -0700 |
| commit | 0eb4d46d03ce486a98c3ed24f9aa0406ff0b2a43 (patch) | |
| tree | a5b2e8c35e9876e4855d5fb177f3954cde1250f5 /src/test/debuginfo | |
| parent | b5f6d7ec2d4e231b9ef0c8a9e8e7ec8a7f67d2ae (diff) | |
| parent | 209fe0df24292a69ab4f34d10a5a8c417f64e2e9 (diff) | |
| download | rust-0eb4d46d03ce486a98c3ed24f9aa0406ff0b2a43.tar.gz rust-0eb4d46d03ce486a98c3ed24f9aa0406ff0b2a43.zip | |
Auto merge of #37310 - vadimcn:drop-spans, r=michaelwoerister
Fix line stepping in debugger. Attribute drop code to block's closing brace, instead of the line where the allocation was done. Attribute function epilogues to function body's closing brace, rather than the function header. Fixes #37032 r? @michaelwoerister
Diffstat (limited to 'src/test/debuginfo')
| -rw-r--r-- | src/test/debuginfo/drop-locations.rs | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/src/test/debuginfo/drop-locations.rs b/src/test/debuginfo/drop-locations.rs new file mode 100644 index 00000000000..3a7c534c139 --- /dev/null +++ b/src/test/debuginfo/drop-locations.rs @@ -0,0 +1,91 @@ +// Copyright 2013-2016 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-windows +// ignore-android +// min-lldb-version: 310 + +#![allow(unused)] + +// compile-flags:-g + +// This test checks that drop glue code gets attributed to scope's closing brace, +// and function epilogues - to function's closing brace. + +// === GDB TESTS =================================================================================== + +// gdb-command:run +// gdb-command:next +// gdb-command:frame +// gdb-check:[...]#loc1[...] +// gdb-command:next +// gdb-command:frame +// gdb-check:[...]#loc2[...] +// gdb-command:next +// gdb-command:frame +// gdb-check:[...]#loc3[...] +// gdb-command:next +// gdb-command:frame +// gdb-check:[...]#loc4[...] +// gdb-command:next +// gdb-command:frame +// gdb-check:[...]#loc5[...] +// gdb-command:next +// gdb-command:frame +// gdb-check:[...]#loc6[...] + +// === LLDB TESTS ================================================================================== + +// lldb-command:set set stop-line-count-before 0 +// lldb-command:set set stop-line-count-after 1 +// Can't set both to zero or lldb will stop printing source at all. So it will output the current +// line and the next. We deal with this by having at least 2 lines between the #loc's + +// lldb-command:run +// lldb-command:next +// lldb-command:frame select +// lldb-check:[...]#loc1[...] +// lldb-command:next +// lldb-command:frame select +// lldb-check:[...]#loc2[...] +// lldb-command:next +// lldb-command:frame select +// lldb-check:[...]#loc3[...] +// lldb-command:next +// lldb-command:frame select +// lldb-check:[...]#loc4[...] +// lldb-command:next +// lldb-command:frame select +// lldb-check:[...]#loc5[...] +// lldb-command:next +// lldb-command:frame select +// lldb-check:[...]#loc6[...] + +fn main() { + + foo(); + + zzz(); // #loc5 + +} // #loc6 + +fn foo() { + { + let s = String::from("s"); // #break + + zzz(); // #loc1 + + } // #loc2 + + zzz(); // #loc3 + +} // #loc4 + +fn zzz() {()} |
