Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

auto merge of #15573 : michaelwoerister/rust/lldb-tests-rebased-09-Ju…

…l, r=alexcrichton

This PR adds the LLDB autotests to the debuginfo test suite so I don't have to keep rebasing them locally. They are still disabled by default in `tests.mk`. One of the commits also contains a Python pretty printer which can make LLDB print values with Rust syntax. This was mainly added to deal with output format differences between LLDB versions but you can also use it for your normal LLDB debugging sessions.
```
// The following LLDB commands will load and activate the Rust printers
command script import ./src/etc/lldb_rust_formatters.py
type summary add --no-value --python-function lldb_rust_formatters.print_val -x .* --category Rust
type category enable Rust
```
Expect some rough edges with these, they have not been tested apart from there use in the autotests...
  • Loading branch information...
commit 175f113cba6304f2b99052225435da5cc622e926 2 parents 316719e + 3b336b2
@bors bors authored
Showing with 3,569 additions and 265 deletions.
  1. +11 −1 src/compiletest/compiletest.rs
  2. +10 −0 src/compiletest/runtest.rs
  3. +0 −3  src/etc/lldb_batchmode.py
  4. +232 −0 src/etc/lldb_rust_formatters.py
  5. +40 −1 src/test/debuginfo/basic-types.rs
  6. +52 −1 src/test/debuginfo/borrowed-basic.rs
  7. +18 −1 src/test/debuginfo/borrowed-c-style-enum.rs
  8. +16 −1 src/test/debuginfo/borrowed-enum.rs
  9. +55 −1 src/test/debuginfo/borrowed-managed-basic.rs
  10. +39 −2 src/test/debuginfo/borrowed-struct.rs
  11. +22 −1 src/test/debuginfo/borrowed-tuple.rs
  12. +54 −1 src/test/debuginfo/borrowed-unique-basic.rs
  13. +19 −2 src/test/debuginfo/box.rs
  14. +22 −2 src/test/debuginfo/boxed-struct.rs
  15. +38 −6 src/test/debuginfo/by-value-non-immediate-argument.rs
  16. +29 −5 src/test/debuginfo/by-value-self-argument-in-trait-impl.rs
  17. +31 −2 src/test/debuginfo/c-style-enum-in-composite.rs
  18. +31 −2 src/test/debuginfo/c-style-enum.rs
  19. +22 −2 src/test/debuginfo/closure-in-generic-function.rs
  20. +175 −25 src/test/debuginfo/destructured-fn-argument.rs
  21. +121 −2 src/test/debuginfo/destructured-local.rs
  22. +24 −2 src/test/debuginfo/evec-in-struct.rs
  23. +128 −24 src/test/debuginfo/function-arg-initialization.rs
  24. +23 −3 src/test/debuginfo/function-arguments.rs
  25. +118 −1 src/test/debuginfo/function-prologue-stepping-no-split-stack.rs
  26. +232 −0 src/test/debuginfo/function-prologue-stepping-regular.rs
  27. +34 −1 src/test/debuginfo/generic-function.rs
  28. +34 −2 src/test/debuginfo/generic-functions-nested.rs
  29. +60 −6 src/test/debuginfo/generic-method-on-generic-struct.rs
  30. +20 −2 src/test/debuginfo/generic-struct.rs
  31. +22 −2 src/test/debuginfo/generic-tuple-style-enum.rs
  32. +18 −3 src/test/debuginfo/include_string.rs
  33. +43 −3 src/test/debuginfo/lexical-scope-in-for-loop.rs
  34. +73 −8 src/test/debuginfo/lexical-scope-in-if.rs
  35. +69 −8 src/test/debuginfo/lexical-scope-in-match.rs
  36. +38 −6 src/test/debuginfo/lexical-scope-in-stack-closure.rs
  37. +70 −7 src/test/debuginfo/lexical-scope-in-unconditional-loop.rs
  38. +38 −6 src/test/debuginfo/lexical-scope-in-unique-closure.rs
  39. +71 −7 src/test/debuginfo/lexical-scope-in-while.rs
  40. +60 −7 src/test/debuginfo/lexical-scope-with-macro.rs
  41. +185 −24 src/test/debuginfo/lexical-scopes-in-block-expression.rs
  42. +2 −0  src/test/debuginfo/limited-debuginfo.rs
  43. +18 −1 src/test/debuginfo/managed-enum.rs
  44. +22 −1 src/test/debuginfo/managed-pointer-within-unique-vec.rs
  45. +17 −1 src/test/debuginfo/managed-pointer-within-unique.rs
  46. +56 −3 src/test/debuginfo/method-on-enum.rs
  47. +57 −3 src/test/debuginfo/method-on-generic-struct.rs
  48. +56 −3 src/test/debuginfo/method-on-struct.rs
  49. +56 −3 src/test/debuginfo/method-on-trait.rs
  50. +56 −3 src/test/debuginfo/method-on-tuple-struct.rs
  51. +22 −3 src/test/debuginfo/multiple-functions-equal-var-names.rs
  52. +22 −3 src/test/debuginfo/multiple-functions.rs
  53. +50 −6 src/test/debuginfo/name-shadowing-and-scope-nesting.rs
  54. +3 −0  src/test/debuginfo/nil-enum.rs
  55. +34 −6 src/test/debuginfo/option-like-enum.rs
  56. +34 −1 src/test/debuginfo/packed-struct-with-destructor.rs
  57. +27 −1 src/test/debuginfo/packed-struct.rs
  58. +2 −0  src/test/debuginfo/recursive-enum.rs
  59. +1 −0  src/test/debuginfo/recursive-struct.rs
  60. +57 −3 src/test/debuginfo/self-in-default-method.rs
  61. +60 −6 src/test/debuginfo/self-in-generic-default-method.rs
  62. +29 −3 src/test/debuginfo/shadowed-argument.rs
  63. +29 −3 src/test/debuginfo/shadowed-variable.rs
  64. +3 −0  src/test/debuginfo/simd.rs
  65. +42 −7 src/test/debuginfo/simple-lexical-scope.rs
  66. +26 −1 src/test/debuginfo/simple-struct.rs
  67. +26 −1 src/test/debuginfo/simple-tuple.rs
  68. +26 −2 src/test/debuginfo/static-method-on-struct-and-enum.rs
  69. +17 −1 src/test/debuginfo/struct-in-enum.rs
  70. +34 −1 src/test/debuginfo/struct-in-struct.rs
  71. +21 −1 src/test/debuginfo/struct-style-enum.rs
  72. +20 −1 src/test/debuginfo/struct-with-destructor.rs
  73. +1 −1  src/test/debuginfo/text-to-include-1.txt
  74. +1 −1  src/test/debuginfo/text-to-include-2.txt
  75. +1 −1  src/test/debuginfo/text-to-include-3.txt
  76. +33 −1 src/test/debuginfo/trait-generic-static-default-method.rs
  77. +2 −0  src/test/debuginfo/trait-pointers.rs
  78. +26 −1 src/test/debuginfo/tuple-in-tuple.rs
  79. +26 −1 src/test/debuginfo/tuple-struct.rs
  80. +21 −1 src/test/debuginfo/tuple-style-enum.rs
  81. +18 −1 src/test/debuginfo/unique-enum.rs
  82. +42 −2 src/test/debuginfo/var-captured-in-nested-closure.rs
  83. +16 −1 src/test/debuginfo/var-captured-in-sendable-closure.rs
  84. +22 −1 src/test/debuginfo/var-captured-in-stack-closure.rs
  85. +27 −1 src/test/debuginfo/vec-slices.rs
  86. +11 −1 src/test/debuginfo/vec.rs
View
12 src/compiletest/compiletest.rs
@@ -30,7 +30,7 @@ use std::io::fs;
use std::from_str::FromStr;
use getopts::{optopt, optflag, reqopt};
use common::Config;
-use common::{Pretty, DebugInfoGdb, Codegen};
+use common::{Pretty, DebugInfoGdb, DebugInfoLldb, Codegen};
use util::logv;
use regex::Regex;
@@ -241,6 +241,16 @@ pub fn run_tests(config: &Config) {
os::setenv("RUST_TEST_TASKS","1");
}
+ match config.mode {
+ DebugInfoLldb => {
+ // Some older versions of LLDB seem to have problems with multiple
+ // instances running in parallel, so only run one test task at a
+ // time.
+ os::setenv("RUST_TEST_TASKS", "1");
+ }
+ _ => { /* proceed */ }
+ }
+
let opts = test_opts(config);
let tests = make_tests(config);
// sadly osx needs some file descriptor limits raised for running tests in
View
10 src/compiletest/runtest.rs
@@ -536,6 +536,16 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
// We don't want to hang when calling `quit` while the process is still running
let mut script_str = String::from_str("settings set auto-confirm true\n");
+ // Make LLDB emit its version, so we have it documented in the test output
+ script_str.push_str("version\n");
+
+ // Switch LLDB into "Rust mode"
+ script_str.push_str("command script import ./src/etc/lldb_rust_formatters.py\n");
+ script_str.push_str("type summary add --no-value ");
+ script_str.push_str("--python-function lldb_rust_formatters.print_val ");
+ script_str.push_str("-x \".*\" --category Rust\n");
+ script_str.push_str("type category enable Rust\n");
+
// Set breakpoints on every line that contains the string "#break"
for line in breakpoint_lines.iter() {
script_str.push_str(format!("breakpoint set --line {}\n",
View
3  src/etc/lldb_batchmode.py
@@ -31,9 +31,6 @@
import re
import atexit
-# Terminate the debugger
-atexit.register(lambda: lldb.SBDebugger.Terminate())
-
# Set this to True for additional output
DEBUG_OUTPUT = False
View
232 src/etc/lldb_rust_formatters.py
@@ -0,0 +1,232 @@
+# Copyright 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.
+
+import lldb
+
+def print_val(val, internal_dict):
+ '''Prints the given value with Rust syntax'''
+ type_class = val.GetType().GetTypeClass()
+
+ if type_class == lldb.eTypeClassStruct:
+ return print_struct_val(val, internal_dict)
+
+ if type_class == lldb.eTypeClassUnion:
+ return print_enum_val(val, internal_dict)
+
+ if type_class == lldb.eTypeClassPointer:
+ return print_pointer_val(val, internal_dict)
+
+ if type_class == lldb.eTypeClassArray:
+ return print_fixed_size_vec_val(val, internal_dict)
+
+ return val.GetValue()
+
+
+#=--------------------------------------------------------------------------------------------------
+# Type-Specialized Printing Functions
+#=--------------------------------------------------------------------------------------------------
+
+def print_struct_val(val, internal_dict):
+ '''Prints a struct, tuple, or tuple struct value with Rust syntax'''
+ assert val.GetType().GetTypeClass() == lldb.eTypeClassStruct
+
+ if is_vec_slice(val):
+ return print_vec_slice_val(val, internal_dict)
+ else:
+ return print_struct_val_starting_from(0, val, internal_dict)
+
+def print_vec_slice_val(val, internal_dict):
+ output = "&["
+
+ length = val.GetChildAtIndex(1).GetValueAsUnsigned()
+
+ data_ptr_val = val.GetChildAtIndex(0)
+ data_ptr_type = data_ptr_val.GetType()
+ assert data_ptr_type.IsPointerType()
+
+ element_type = data_ptr_type.GetPointeeType()
+ element_type_size = element_type.GetByteSize()
+
+ start_address = data_ptr_val.GetValueAsUnsigned()
+
+ for i in range(length):
+ address = start_address + i * element_type_size
+ element_val = val.CreateValueFromAddress( val.GetName() + ("[%s]" % i), address, element_type )
+ output += print_val(element_val, internal_dict)
+
+ if i != length - 1:
+ output += ", "
+
+ output += "]"
+ return output
+
+def print_struct_val_starting_from(field_start_index, val, internal_dict):
+ '''
+ Prints a struct, tuple, or tuple struct value with Rust syntax.
+ Ignores any fields before field_start_index.
+ '''
+ assert val.GetType().GetTypeClass() == lldb.eTypeClassStruct
+
+ t = val.GetType()
+ has_field_names = type_has_field_names(t)
+ type_name = extract_type_name(t.GetName())
+ output = ""
+
+ if not type_name.startswith("("):
+ # this is a tuple, so don't print the type name
+ output += type_name
+
+ if has_field_names:
+ output += " { \n"
+ else:
+ output += "("
+
+ num_children = val.num_children
+
+ for child_index in range(field_start_index, num_children):
+ if has_field_names:
+ field_name = t.GetFieldAtIndex(child_index).GetName()
+ output += field_name + ": "
+
+ field_val = val.GetChildAtIndex(child_index)
+ output += print_val(field_val, internal_dict)
+
+ if child_index != num_children - 1:
+ output += ", "
+
+ if has_field_names:
+ output += "\n"
+
+ if has_field_names:
+ output += "}"
+ else:
+ output += ")"
+
+ return output
+
+
+def print_enum_val(val, internal_dict):
+ '''Prints an enum value with Rust syntax'''
+
+ assert val.GetType().GetTypeClass() == lldb.eTypeClassUnion
+
+ if val.num_children == 1:
+ first_variant_name = val.GetChildAtIndex(0).GetName()
+ if first_variant_name and first_variant_name.startswith("RUST$ENCODED$ENUM$"):
+ # Try to extract the
+
+ last_separator_index = first_variant_name.rfind("$")
+ if last_separator_index == -1:
+ return "<invalid enum encoding: %s>" % first_variant_name
+
+ second_last_separator_index = first_variant_name.rfind("$", 0, last_separator_index)
+ if second_last_separator_index == -1:
+ return "<invalid enum encoding: %s>" % first_variant_name
+
+ try:
+ disr_field_index = first_variant_name[second_last_separator_index + 1 :
+ last_separator_index]
+ disr_field_index = int(disr_field_index)
+ except:
+ return "<invalid enum encoding: %s>" % first_variant_name
+
+ disr_val = val.GetChildAtIndex(0).GetChildAtIndex(disr_field_index).GetValueAsUnsigned()
+
+ if disr_val == 0:
+ null_variant_name = first_variant_name[last_separator_index + 1:]
+ return null_variant_name
+ else:
+ return print_struct_val_starting_from(0, val.GetChildAtIndex(0), internal_dict)
+ else:
+ return print_struct_val_starting_from(0, val.GetChildAtIndex(0), internal_dict)
+
+ # extract the discriminator value by
+ disr_val = val.GetChildAtIndex(0).GetChildAtIndex(0)
+ disr_type = disr_val.GetType()
+
+ if disr_type.GetTypeClass() != lldb.eTypeClassEnumeration:
+ return "<Invalid enum value encountered: Discriminator is not an enum>"
+
+ variant_index = disr_val.GetValueAsUnsigned()
+ return print_struct_val_starting_from(1, val.GetChildAtIndex(variant_index), internal_dict)
+
+
+def print_pointer_val(val, internal_dict):
+ '''Prints a pointer value with Rust syntax'''
+ assert val.GetType().IsPointerType()
+ sigil = "&"
+ type_name = extract_type_name(val.GetType().GetName())
+ if type_name and type_name[0:1] in ["&", "~", "*"]:
+ sigil = type_name[0:1]
+
+ return sigil + hex(val.GetValueAsUnsigned()) #print_val(val.Dereference(), internal_dict)
+
+
+def print_fixed_size_vec_val(val, internal_dict):
+ assert val.GetType().GetTypeClass() == lldb.eTypeClassArray
+
+ output = "["
+
+ for i in range(val.num_children):
+ output += print_val(val.GetChildAtIndex(i), internal_dict)
+ if i != val.num_children - 1:
+ output += ", "
+
+ output += "]"
+ return output
+
+
+#=--------------------------------------------------------------------------------------------------
+# Helper Functions
+#=--------------------------------------------------------------------------------------------------
+
+unqualified_type_markers = frozenset(["(", "[", "&", "*"])
+
+def extract_type_name(qualified_type_name):
+ '''Extracts the type name from a fully qualified path'''
+ if qualified_type_name[0] in unqualified_type_markers:
+ return qualified_type_name
+
+ end_of_search = qualified_type_name.find("<")
+ if end_of_search < 0:
+ end_of_search = len(qualified_type_name)
+
+ index = qualified_type_name.rfind("::", 0, end_of_search)
+ if index < 0:
+ return qualified_type_name
+ else:
+ return qualified_type_name[index + 2:]
+
+
+def type_has_field_names(ty):
+ '''Returns true of this is a type with field names (struct, struct-like enum variant)'''
+ # This may also be an enum variant where the first field doesn't have a name but the rest has
+ if ty.GetNumberOfFields() > 1:
+ return ty.GetFieldAtIndex(1).GetName() != None
+ else:
+ return ty.GetFieldAtIndex(0).GetName() != None
+
+
+def is_vec_slice(val):
+ ty = val.GetType()
+ if ty.GetTypeClass() != lldb.eTypeClassStruct:
+ return False
+
+ if ty.GetNumberOfFields() != 2:
+ return False
+
+ if ty.GetFieldAtIndex(0).GetName() != "data_ptr":
+ return False
+
+ if ty.GetFieldAtIndex(1).GetName() != "length":
+ return False
+
+ type_name = extract_type_name(ty.GetName()).replace("&'static", "&").replace(" ", "")
+ return type_name.startswith("&[") and type_name.endswith("]")
View
41 src/test/debuginfo/basic-types.rs
@@ -17,6 +17,9 @@
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
@@ -49,6 +52,42 @@
// gdb-command:print f64
// gdb-check:$14 = 3.5
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+// lldb-command:print b
+// lldb-check:[...]$0 = false
+// lldb-command:print i
+// lldb-check:[...]$1 = -1
+
+// NOTE: LLDB does not support 32bit chars
+// d ebugger:print (uint)(c)
+// c heck:$3 = 97
+
+// lldb-command:print i8
+// lldb-check:[...]$2 = 'D'
+// lldb-command:print i16
+// lldb-check:[...]$3 = -16
+// lldb-command:print i32
+// lldb-check:[...]$4 = -32
+// lldb-command:print i64
+// lldb-check:[...]$5 = -64
+// lldb-command:print u
+// lldb-check:[...]$6 = 1
+// lldb-command:print u8
+// lldb-check:[...]$7 = 'd'
+// lldb-command:print u16
+// lldb-check:[...]$8 = 16
+// lldb-command:print u32
+// lldb-check:[...]$9 = 32
+// lldb-command:print u64
+// lldb-check:[...]$10 = 64
+// lldb-command:print f32
+// lldb-check:[...]$11 = 2.5
+// lldb-command:print f64
+// lldb-check:[...]$12 = 3.5
+
#![allow(unused_variable)]
fn main() {
@@ -66,7 +105,7 @@ fn main() {
let u64: u64 = 64;
let f32: f32 = 2.5;
let f64: f64 = 3.5;
- _zzz();
+ _zzz(); // #break
}
fn _zzz() {()}
View
53 src/test/debuginfo/borrowed-basic.rs
@@ -14,6 +14,9 @@
// its numerical value.
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
@@ -59,6 +62,53 @@
// gdb-command:print *f64_ref
// gdb-check:$14 = 3.5
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+// lldb-command:print *bool_ref
+// lldb-check:[...]$0 = true
+
+// lldb-command:print *int_ref
+// lldb-check:[...]$1 = -1
+
+// NOTE: lldb doesn't support 32bit chars at the moment
+// d ebugger:print *char_ref
+// c heck:[...]$x = 97
+
+// lldb-command:print *i8_ref
+// lldb-check:[...]$2 = 'D'
+
+// lldb-command:print *i16_ref
+// lldb-check:[...]$3 = -16
+
+// lldb-command:print *i32_ref
+// lldb-check:[...]$4 = -32
+
+// lldb-command:print *i64_ref
+// lldb-check:[...]$5 = -64
+
+// lldb-command:print *uint_ref
+// lldb-check:[...]$6 = 1
+
+// lldb-command:print *u8_ref
+// lldb-check:[...]$7 = 'd'
+
+// lldb-command:print *u16_ref
+// lldb-check:[...]$8 = 16
+
+// lldb-command:print *u32_ref
+// lldb-check:[...]$9 = 32
+
+// lldb-command:print *u64_ref
+// lldb-check:[...]$10 = 64
+
+// lldb-command:print *f32_ref
+// lldb-check:[...]$11 = 2.5
+
+// lldb-command:print *f64_ref
+// lldb-check:[...]$12 = 3.5
+
#![allow(unused_variable)]
fn main() {
@@ -103,7 +153,8 @@ fn main() {
let f64_val: f64 = 3.5;
let f64_ref: &f64 = &f64_val;
- zzz();
+
+ zzz(); // #break
}
fn zzz() {()}
View
19 src/test/debuginfo/borrowed-c-style-enum.rs
@@ -11,6 +11,9 @@
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
@@ -24,6 +27,20 @@
// gdb-command:print *the_c_ref
// gdb-check:$3 = TheC
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print *the_a_ref
+// lldb-check:[...]$0 = TheA
+
+// lldb-command:print *the_b_ref
+// lldb-check:[...]$1 = TheB
+
+// lldb-command:print *the_c_ref
+// lldb-check:[...]$2 = TheC
+
#![allow(unused_variable)]
enum ABC { TheA, TheB, TheC }
@@ -38,7 +55,7 @@ fn main() {
let the_c = TheC;
let the_c_ref: &ABC = &the_c;
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
View
17 src/test/debuginfo/borrowed-enum.rs
@@ -11,6 +11,9 @@
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
@@ -24,6 +27,18 @@
// gdb-command:print *univariant_ref
// gdb-check:$3 = {{4820353753753434}}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print *the_a_ref
+// lldb-check:[...]$0 = TheA { x: 0, y: 8970181431921507452 }
+// lldb-command:print *the_b_ref
+// lldb-check:[...]$1 = TheB(0, 286331153, 286331153)
+// lldb-command:print *univariant_ref
+// lldb-check:[...]$2 = TheOnlyCase(4820353753753434)
+
#![allow(unused_variable)]
#![feature(struct_variant)]
@@ -59,7 +74,7 @@ fn main() {
let univariant = TheOnlyCase(4820353753753434);
let univariant_ref: &Univariant = &univariant;
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
View
56 src/test/debuginfo/borrowed-managed-basic.rs
@@ -16,6 +16,9 @@
// its numerical value.
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
@@ -61,6 +64,56 @@
// gdb-command:print *f64_ref
// gdb-check:$14 = 3.5
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:type format add -f decimal char
+// lldb-command:type format add -f decimal 'unsigned char'
+// lldb-command:run
+
+// lldb-command:print *bool_ref
+// lldb-check:[...]$0 = true
+
+// lldb-command:print *int_ref
+// lldb-check:[...]$1 = -1
+
+// LLDB can't handle 32bit chars yet
+// d ebugger:print *char_ref
+// c heck:[...]$x = 97
+
+// lldb-command:print *i8_ref
+// lldb-check:[...]$2 = 68
+
+// lldb-command:print *i16_ref
+// lldb-check:[...]$3 = -16
+
+// lldb-command:print *i32_ref
+// lldb-check:[...]$4 = -32
+
+// lldb-command:print *i64_ref
+// lldb-check:[...]$5 = -64
+
+// lldb-command:print *uint_ref
+// lldb-check:[...]$6 = 1
+
+// lldb-command:print *u8_ref
+// lldb-check:[...]$7 = 100
+
+// lldb-command:print *u16_ref
+// lldb-check:[...]$8 = 16
+
+// lldb-command:print *u32_ref
+// lldb-check:[...]$9 = 32
+
+// lldb-command:print *u64_ref
+// lldb-check:[...]$10 = 64
+
+// lldb-command:print *f32_ref
+// lldb-check:[...]$11 = 2.5
+
+// lldb-command:print *f64_ref
+// lldb-check:[...]$12 = 3.5
+
#![allow(unused_variable)]
use std::gc::{Gc, GC};
@@ -107,7 +160,8 @@ fn main() {
let f64_box: Gc<f64> = box(GC) 3.5;
let f64_ref: &f64 = f64_box;
- zzz();
+
+ zzz(); // #break
}
fn zzz() {()}
View
41 src/test/debuginfo/borrowed-struct.rs
@@ -9,8 +9,10 @@
// except according to those terms.
// ignore-android: FIXME(#10381)
-
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
@@ -45,6 +47,41 @@
// gdb-command:print *unique_val_interior_ref_2
// gdb-check:$10 = 26.5
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print *stack_val_ref
+// lldb-check:[...]$0 = SomeStruct { x: 10, y: 23.5 }
+
+// lldb-command:print *stack_val_interior_ref_1
+// lldb-check:[...]$1 = 10
+
+// lldb-command:print *stack_val_interior_ref_2
+// lldb-check:[...]$2 = 23.5
+
+// lldb-command:print *ref_to_unnamed
+// lldb-check:[...]$3 = SomeStruct { x: 11, y: 24.5 }
+
+// lldb-command:print *managed_val_ref
+// lldb-check:[...]$4 = SomeStruct { x: 12, y: 25.5 }
+
+// lldb-command:print *managed_val_interior_ref_1
+// lldb-check:[...]$5 = 12
+
+// lldb-command:print *managed_val_interior_ref_2
+// lldb-check:[...]$6 = 25.5
+
+// lldb-command:print *unique_val_ref
+// lldb-check:[...]$7 = SomeStruct { x: 13, y: 26.5 }
+
+// lldb-command:print *unique_val_interior_ref_1
+// lldb-check:[...]$8 = 13
+
+// lldb-command:print *unique_val_interior_ref_2
+// lldb-check:[...]$9 = 26.5
+
#![feature(managed_boxes)]
#![allow(unused_variable)]
@@ -72,7 +109,7 @@ fn main() {
let unique_val_interior_ref_1: &int = &unique_val.x;
let unique_val_interior_ref_2: &f64 = &unique_val.y;
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
View
23 src/test/debuginfo/borrowed-tuple.rs
@@ -13,6 +13,9 @@
#![feature(managed_boxes)]
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
@@ -29,6 +32,24 @@
// gdb-command:print *unique_val_ref
// gdb-check:$4 = {-17, -22}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print *stack_val_ref
+// lldb-check:[...]$0 = (-14, -19)
+
+// lldb-command:print *ref_to_unnamed
+// lldb-check:[...]$1 = (-15, -20)
+
+// lldb-command:print *managed_val_ref
+// lldb-check:[...]$2 = (-16, -21)
+
+// lldb-command:print *unique_val_ref
+// lldb-check:[...]$3 = (-17, -22)
+
+
#![allow(unused_variable)]
use std::gc::{Gc, GC};
@@ -44,7 +65,7 @@ fn main() {
let unique_val: Box<(i16, f32)> = box() (-17, -22f32);
let unique_val_ref: &(i16, f32) = unique_val;
- zzz();
+ zzz(); // #break
}
fn zzz() {()}
View
55 src/test/debuginfo/borrowed-unique-basic.rs
@@ -14,6 +14,9 @@
// its numerical value.
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
@@ -59,6 +62,55 @@
// gdb-command:print *f64_ref
// gdb-check:$14 = 3.5
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:type format add -f decimal char
+// lldb-command:type format add -f decimal 'unsigned char'
+// lldb-command:run
+
+// lldb-command:print *bool_ref
+// lldb-check:[...]$0 = true
+
+// lldb-command:print *int_ref
+// lldb-check:[...]$1 = -1
+
+// d ebugger:print *char_ref
+// c heck:[...]$3 = 97
+
+// lldb-command:print *i8_ref
+// lldb-check:[...]$2 = 68
+
+// lldb-command:print *i16_ref
+// lldb-check:[...]$3 = -16
+
+// lldb-command:print *i32_ref
+// lldb-check:[...]$4 = -32
+
+// lldb-command:print *i64_ref
+// lldb-check:[...]$5 = -64
+
+// lldb-command:print *uint_ref
+// lldb-check:[...]$6 = 1
+
+// lldb-command:print *u8_ref
+// lldb-check:[...]$7 = 100
+
+// lldb-command:print *u16_ref
+// lldb-check:[...]$8 = 16
+
+// lldb-command:print *u32_ref
+// lldb-check:[...]$9 = 32
+
+// lldb-command:print *u64_ref
+// lldb-check:[...]$10 = 64
+
+// lldb-command:print *f32_ref
+// lldb-check:[...]$11 = 2.5
+
+// lldb-command:print *f64_ref
+// lldb-check:[...]$12 = 3.5
+
#![allow(unused_variable)]
@@ -104,7 +156,8 @@ fn main() {
let f64_box: Box<f64> = box 3.5;
let f64_ref: &f64 = f64_box;
- zzz();
+
+ zzz(); // #break
}
fn zzz() {()}
View
21 src/test/debuginfo/box.rs
@@ -11,6 +11,9 @@
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak zzz
// gdb-command:run
@@ -24,6 +27,19 @@
// gdb-command:print d->val
// gdb-check:$4 = false
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+// lldb-command:print *a
+// lldb-check:[...]$0 = 1
+// lldb-command:print *b
+// lldb-check:[...]$1 = (2, 3.5)
+// lldb-command:print c->val
+// lldb-check:[...]$2 = 4
+// lldb-command:print d->val
+// lldb-check:[...]$3 = false
+
#![feature(managed_boxes)]
#![allow(unused_variable)]
@@ -34,7 +50,8 @@ fn main() {
let b = box() (2i, 3.5f64);
let c = box(GC) 4i;
let d = box(GC) false;
- _zzz();
+
+ zzz(); // #break
}
-fn _zzz() {()}
+fn zzz() { () }
View
24 src/test/debuginfo/boxed-struct.rs
@@ -11,6 +11,9 @@
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
@@ -27,6 +30,23 @@
// gdb-command:print managed_dtor->val
// gdb-check:$4 = {x = 33, y = 333, z = 3333, w = 33333}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print *unique
+// lldb-check:[...]$0 = StructWithSomePadding { x: 99, y: 999, z: 9999, w: 99999 }
+
+// lldb-command:print managed->val
+// lldb-check:[...]$1 = StructWithSomePadding { x: 88, y: 888, z: 8888, w: 88888 }
+
+// lldb-command:print *unique_dtor
+// lldb-check:[...]$2 = StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 }
+
+// lldb-command:print managed_dtor->val
+// lldb-check:[...]$3 = StructWithDestructor { x: 33, y: 333, z: 3333, w: 33333 }
+
#![feature(managed_boxes)]
#![allow(unused_variable)]
@@ -58,7 +78,7 @@ fn main() {
let unique_dtor = box StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 };
let managed_dtor = box(GC) StructWithDestructor { x: 33, y: 333, z: 3333, w: 33333 };
- zzz();
+ zzz(); // #break
}
-fn zzz() {()}
+fn zzz() { () }
View
44 src/test/debuginfo/by-value-non-immediate-argument.rs
@@ -11,6 +11,9 @@
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
@@ -43,6 +46,35 @@
// gdb-check:$7 = {{Case1, x = 0, y = 8970181431921507452}, {Case1, 0, 2088533116, 2088533116}}
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print s
+// lldb-check:[...]$0 = Struct { a: 1, b: 2.5 }
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$1 = Struct { a: 3, b: 4.5 }
+// lldb-command:print y
+// lldb-check:[...]$2 = 5
+// lldb-command:print z
+// lldb-check:[...]$3 = 6.5
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$4 = (7, 8, 9.5, 10.5)
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$5 = Newtype(11.5, 12.5, 13, 14)
+// lldb-command:continue
+
+// lldb-command:print x
+// lldb-check:[...]$6 = Case1 { x: 0, y: 8970181431921507452 }
+// lldb-command:continue
+
#![feature(struct_variant)]
#[deriving(Clone)]
@@ -58,21 +90,21 @@ struct StructStruct {
}
fn fun(s: Struct) {
- zzz();
+ zzz(); // #break
}
fn fun_fun(StructStruct { a: x, b: Struct { a: y, b: z } }: StructStruct) {
- zzz();
+ zzz(); // #break
}
fn tup(a: (int, uint, f64, f64)) {
- zzz();
+ zzz(); // #break
}
struct Newtype(f64, f64, int, uint);
fn new_type(a: Newtype) {
- zzz();
+ zzz(); // #break
}
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
@@ -84,7 +116,7 @@ enum Enum {
}
fn by_val_enum(x: Enum) {
- zzz();
+ zzz(); // #break
}
fn main() {
@@ -100,4 +132,4 @@ fn main() {
by_val_enum(Case1 { x: 0, y: 8970181431921507452 });
}
-fn zzz() {()}
+fn zzz() { () }
View
34 src/test/debuginfo/by-value-self-argument-in-trait-impl.rs
@@ -13,6 +13,9 @@
#![feature(managed_boxes)]
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
@@ -36,6 +39,27 @@
// gdb-check:$4 = 8888
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print self
+// lldb-check:[...]$0 = 1111
+// lldb-command:continue
+
+// lldb-command:print self
+// lldb-check:[...]$1 = Struct { x: 2222, y: 3333 }
+// lldb-command:continue
+
+// lldb-command:print self
+// lldb-check:[...]$2 = (4444.5, 5555, 6666, 7777.5)
+// lldb-command:continue
+
+// lldb-command:print self->val
+// lldb-check:[...]$3 = 8888
+// lldb-command:continue
+
use std::gc::{Gc, GC};
trait Trait {
@@ -44,7 +68,7 @@ trait Trait {
impl Trait for int {
fn method(self) -> int {
- zzz();
+ zzz(); // #break
self
}
}
@@ -56,21 +80,21 @@ struct Struct {
impl Trait for Struct {
fn method(self) -> Struct {
- zzz();
+ zzz(); // #break
self
}
}
impl Trait for (f64, int, int, f64) {
fn method(self) -> (f64, int, int, f64) {
- zzz();
+ zzz(); // #break
self
}
}
impl Trait for Gc<int> {
fn method(self) -> Gc<int> {
- zzz();
+ zzz(); // #break
self
}
}
@@ -82,4 +106,4 @@ fn main() {
let _ = (box(GC) 8888).method();
}
-fn zzz() {()}
+fn zzz() { () }
View
33 src/test/debuginfo/c-style-enum-in-composite.rs
@@ -8,9 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+// ignore-tidy-linelength
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
@@ -36,6 +40,31 @@
// gdb-command:print struct_with_drop
// gdb-check:$7 = {{a = OneHundred, b = Vienna}, 9}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print tuple_interior_padding
+// lldb-check:[...]$0 = (0, OneHundred)
+
+// lldb-command:print tuple_padding_at_end
+// lldb-check:[...]$1 = ((1, OneThousand), 2)
+// lldb-command:print tuple_different_enums
+// lldb-check:[...]$2 = (OneThousand, MountainView, OneMillion, Vienna)
+
+// lldb-command:print padded_struct
+// lldb-check:[...]$3 = PaddedStruct { a: 3, b: OneMillion, c: 4, d: Toronto, e: 5 }
+
+// lldb-command:print packed_struct
+// lldb-check:[...]$4 = PackedStruct { a: 6, b: OneHundred, c: 7, d: Vienna, e: 8 }
+
+// lldb-command:print non_padded_struct
+// lldb-check:[...]$5 = NonPaddedStruct { a: OneMillion, b: MountainView, c: OneThousand, d: Toronto }
+
+// lldb-command:print struct_with_drop
+// lldb-check:[...]$6 = (StructWithDrop { a: OneHundred, b: Vienna }, 9)
+
#![allow(unused_variable)]
enum AnEnum {
@@ -115,7 +144,7 @@ fn main() {
let struct_with_drop = (StructWithDrop { a: OneHundred, b: Vienna }, 9_i64);
- zzz();
+ zzz(); // #break
}
-fn zzz() {()}
+fn zzz() { () }
View
33 src/test/debuginfo/c-style-enum.rs
@@ -12,6 +12,9 @@
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:print 'c-style-enum::SINGLE_VARIANT'
@@ -71,6 +74,32 @@
// gdb-command:print 'c-style-enum::MANUAL_THREE'
// gdb-check:$18 = OneMillion
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print auto_one
+// lldb-check:[...]$0 = One
+
+// lldb-command:print auto_two
+// lldb-check:[...]$1 = Two
+
+// lldb-command:print auto_three
+// lldb-check:[...]$2 = Three
+
+// lldb-command:print manual_one_hundred
+// lldb-check:[...]$3 = OneHundred
+
+// lldb-command:print manual_one_thousand
+// lldb-check:[...]$4 = OneThousand
+
+// lldb-command:print manual_one_million
+// lldb-check:[...]$5 = OneMillion
+
+// lldb-command:print single_variant
+// lldb-check:[...]$6 = TheOnlyVariant
+
#![allow(unused_variable)]
#![allow(dead_code)]
@@ -120,11 +149,11 @@ fn main() {
MANUAL_THREE = OneMillion;
};
- zzz();
+ zzz(); // #break
let a = SINGLE_VARIANT;
let a = unsafe { AUTO_ONE };
let a = unsafe { MANUAL_ONE };
}
-fn zzz() {()}
+fn zzz() { () }
View
24 src/test/debuginfo/closure-in-generic-function.rs
@@ -11,6 +11,9 @@
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
@@ -28,10 +31,27 @@
// gdb-check:$4 = 110
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print x
+// lldb-check:[...]$0 = 0.5
+// lldb-command:print y
+// lldb-check:[...]$1 = 10
+// lldb-command:continue
+
+// lldb-command:print *x
+// lldb-check:[...]$2 = 29
+// lldb-command:print *y
+// lldb-check:[...]$3 = 110
+// lldb-command:continue
+
fn some_generic_fun<T1, T2>(a: T1, b: T2) -> (T2, T1) {
let closure = |x, y| {
- zzz();
+ zzz(); // #break
(y, x)
};
@@ -43,4 +63,4 @@ fn main() {
some_generic_fun(&29i, box 110i);
}
-fn zzz() {()}
+fn zzz() { () }
View
200 src/test/debuginfo/destructured-fn-argument.rs
@@ -11,6 +11,9 @@
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
@@ -181,6 +184,154 @@
// gdb-check:$49 = 62
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+// lldb-command:run
+
+// lldb-command:print a
+// lldb-check:[...]$0 = 1
+// lldb-command:print b
+// lldb-check:[...]$1 = false
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$2 = 2
+// lldb-command:print b
+// lldb-check:[...]$3 = 3
+// lldb-command:print c
+// lldb-check:[...]$4 = 4
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$5 = 5
+// lldb-command:print b
+// lldb-check:[...]$6 = (6, 7)
+// lldb-command:continue
+
+// lldb-command:print h
+// lldb-check:[...]$7 = 8
+// lldb-command:print i
+// lldb-check:[...]$8 = Struct { a: 9, b: 10 }
+// lldb-command:print j
+// lldb-check:[...]$9 = 11
+// lldb-command:continue
+
+// lldb-command:print k
+// lldb-check:[...]$10 = 12
+// lldb-command:print l
+// lldb-check:[...]$11 = 13
+// lldb-command:continue
+
+// lldb-command:print m
+// lldb-check:[...]$12 = 14
+// lldb-command:print n
+// lldb-check:[...]$13 = 16
+// lldb-command:continue
+
+// lldb-command:print o
+// lldb-check:[...]$14 = 18
+// lldb-command:continue
+
+// lldb-command:print p
+// lldb-check:[...]$15 = 19
+// lldb-command:print q
+// lldb-check:[...]$16 = 20
+// lldb-command:print r
+// lldb-check:[...]$17 = Struct { a: 21, b: 22 }
+// lldb-command:continue
+
+// lldb-command:print s
+// lldb-check:[...]$18 = 24
+// lldb-command:print t
+// lldb-check:[...]$19 = 23
+// lldb-command:continue
+
+// lldb-command:print u
+// lldb-check:[...]$20 = 25
+// lldb-command:print v
+// lldb-check:[...]$21 = 26
+// lldb-command:print w
+// lldb-check:[...]$22 = 27
+// lldb-command:print x
+// lldb-check:[...]$23 = 28
+// lldb-command:print y
+// lldb-check:[...]$24 = 29
+// lldb-command:print z
+// lldb-check:[...]$25 = 30
+// lldb-command:print ae
+// lldb-check:[...]$26 = 31
+// lldb-command:print oe
+// lldb-check:[...]$27 = 32
+// lldb-command:print ue
+// lldb-check:[...]$28 = 33
+// lldb-command:continue
+
+// lldb-command:print aa
+// lldb-check:[...]$29 = (34, 35)
+// lldb-command:continue
+
+// lldb-command:print bb
+// lldb-check:[...]$30 = (36, 37)
+// lldb-command:continue
+
+// lldb-command:print cc
+// lldb-check:[...]$31 = 38
+// lldb-command:continue
+
+// lldb-command:print dd
+// lldb-check:[...]$32 = (40, 41, 42)
+// lldb-command:continue
+
+// lldb-command:print *ee
+// lldb-check:[...]$33 = (43, 44, 45)
+// lldb-command:continue
+
+// lldb-command:print *ff
+// lldb-check:[...]$34 = 46
+// lldb-command:print gg
+// lldb-check:[...]$35 = (47, 48)
+// lldb-command:continue
+
+// lldb-command:print *hh
+// lldb-check:[...]$36 = 50
+// lldb-command:continue
+
+// lldb-command:print ii
+// lldb-check:[...]$37 = 51
+// lldb-command:continue
+
+// lldb-command:print *jj
+// lldb-check:[...]$38 = 52
+// lldb-command:continue
+
+// lldb-command:print kk
+// lldb-check:[...]$39 = 53
+// lldb-command:print ll
+// lldb-check:[...]$40 = 54
+// lldb-command:continue
+
+// lldb-command:print mm
+// lldb-check:[...]$41 = 55
+// lldb-command:print *nn
+// lldb-check:[...]$42 = 56
+// lldb-command:continue
+
+// lldb-command:print oo
+// lldb-check:[...]$43 = 57
+// lldb-command:print pp
+// lldb-check:[...]$44 = 58
+// lldb-command:print qq
+// lldb-check:[...]$45 = 59
+// lldb-command:continue
+
+// lldb-command:print rr
+// lldb-check:[...]$46 = 60
+// lldb-command:print ss
+// lldb-check:[...]$47 = 61
+// lldb-command:print tt
+// lldb-check:[...]$48 = 62
+// lldb-command:continue
+
#![allow(unused_variable)]
@@ -197,93 +348,93 @@ struct TupleStruct (f64, int);
fn simple_tuple((a, b): (int, bool)) {
- zzz();
+ zzz(); // #break
}
fn nested_tuple((a, (b, c)): (int, (u16, u16))) {
- zzz();
+ zzz(); // #break
}
fn destructure_only_first_level((a, b): (int, (u32, u32))) {
- zzz();
+ zzz(); // #break
}
fn struct_as_tuple_element((h, i, j): (i16, Struct, i16)) {
- zzz();
+ zzz(); // #break
}
fn struct_pattern(Struct { a: k, b: l }: Struct) {
- zzz();
+ zzz(); // #break
}
fn ignored_tuple_element((m, _, n): (int, u16, i32)) {
- zzz();
+ zzz(); // #break
}
fn ignored_struct_field(Struct { b: o, .. }: Struct) {
- zzz();
+ zzz(); // #break
}
fn one_struct_destructured_one_not((Struct { a: p, b: q }, r): (Struct, Struct)) {
- zzz();
+ zzz(); // #break
}
fn different_order_of_struct_fields(Struct { b: s, a: t }: Struct ) {
- zzz();
+ zzz(); // #break
}
fn complex_nesting(((u, v ), ((w, (x, Struct { a: y, b: z})), Struct { a: ae, b: oe }), ue ):
((i16, i32), ((i64, (i32, Struct, )), Struct ), u16))
{
- zzz();
+ zzz(); // #break
}
fn managed_box(&aa: &(int, int)) {
- zzz();
+ zzz(); // #break
}
fn borrowed_pointer(&bb: &(int, int)) {
- zzz();
+ zzz(); // #break
}
fn contained_borrowed_pointer((&cc, _): (&int, int)) {
- zzz();
+ zzz(); // #break
}
fn unique_pointer(box dd: Box<(int, int, int)>) {
- zzz();
+ zzz(); // #break
}
fn ref_binding(ref ee: (int, int, int)) {
- zzz();
+ zzz(); // #break
}
fn ref_binding_in_tuple((ref ff, gg): (int, (int, int))) {
- zzz();
+ zzz(); // #break
}
fn ref_binding_in_struct(Struct { b: ref hh, .. }: Struct) {
- zzz();
+ zzz(); // #break
}
fn univariant_enum(Unit(ii): Univariant) {
- zzz();
+ zzz(); // #break
}
fn univariant_enum_with_ref_binding(Unit(ref jj): Univariant) {
- zzz();
+ zzz(); // #break
}
fn tuple_struct(TupleStruct(kk, ll): TupleStruct) {
- zzz();
+ zzz(); // #break
}
fn tuple_struct_with_ref_binding(TupleStruct(mm, ref nn): TupleStruct) {
- zzz();
+ zzz(); // #break
}
fn multiple_arguments((oo, pp): (int, int), qq : int) {
- zzz();
+ zzz(); // #break
}
fn main() {
@@ -311,11 +462,10 @@ fn main() {
multiple_arguments((57, 58), 59);
fn nested_function(rr: int, (ss, tt): (int, int)) {
- zzz();
+ zzz(); // #break
}
nested_function(60, (61, 62));
}
-
-fn zzz() {()}
+fn zzz() { () }
View
123 src/test/debuginfo/destructured-local.rs
@@ -11,6 +11,9 @@
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
@@ -125,6 +128,122 @@
// gdb-command:print *nn
// gdb-check:$43 = 56
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print a
+// lldb-check:[...]$0 = 1
+// lldb-command:print b
+// lldb-check:[...]$1 = false
+
+// lldb-command:print c
+// lldb-check:[...]$2 = 2
+// lldb-command:print d
+// lldb-check:[...]$3 = 3
+// lldb-command:print e
+// lldb-check:[...]$4 = 4
+
+// lldb-command:print f
+// lldb-check:[...]$5 = 5
+// lldb-command:print g
+// lldb-check:[...]$6 = (6, 7)
+
+// lldb-command:print h
+// lldb-check:[...]$7 = 8
+// lldb-command:print i
+// lldb-check:[...]$8 = Struct { a: 9, b: 10 }
+// lldb-command:print j
+// lldb-check:[...]$9 = 11
+
+// lldb-command:print k
+// lldb-check:[...]$10 = 12
+// lldb-command:print l
+// lldb-check:[...]$11 = 13
+
+// lldb-command:print m
+// lldb-check:[...]$12 = 14
+// lldb-command:print n
+// lldb-check:[...]$13 = 16
+
+// lldb-command:print o
+// lldb-check:[...]$14 = 18
+
+// lldb-command:print p
+// lldb-check:[...]$15 = 19
+// lldb-command:print q
+// lldb-check:[...]$16 = 20
+// lldb-command:print r
+// lldb-check:[...]$17 = Struct { a: 21, b: 22 }
+
+// lldb-command:print s
+// lldb-check:[...]$18 = 24
+// lldb-command:print t
+// lldb-check:[...]$19 = 23
+
+// lldb-command:print u
+// lldb-check:[...]$20 = 25
+// lldb-command:print v
+// lldb-check:[...]$21 = 26
+// lldb-command:print w
+// lldb-check:[...]$22 = 27
+// lldb-command:print x
+// lldb-check:[...]$23 = 28
+// lldb-command:print y
+// lldb-check:[...]$24 = 29
+// lldb-command:print z
+// lldb-check:[...]$25 = 30
+// lldb-command:print ae
+// lldb-check:[...]$26 = 31
+// lldb-command:print oe
+// lldb-check:[...]$27 = 32
+// lldb-command:print ue
+// lldb-check:[...]$28 = 33
+
+// lldb-command:print aa
+// lldb-check:[...]$29 = (34, 35)
+
+// lldb-command:print bb
+// lldb-check:[...]$30 = (36, 37)
+
+// lldb-command:print cc
+// lldb-check:[...]$31 = 38
+
+// lldb-command:print dd
+// lldb-check:[...]$32 = (40, 41, 42)
+
+// lldb-command:print *ee
+// lldb-check:[...]$33 = (43, 44, 45)
+
+// lldb-command:print *ff
+// lldb-check:[...]$34 = 46
+
+// lldb-command:print gg
+// lldb-check:[...]$35 = (47, 48)
+
+// lldb-command:print *hh
+// lldb-check:[...]$36 = 50
+
+// lldb-command:print ii
+// lldb-check:[...]$37 = 51
+
+// lldb-command:print *jj
+// lldb-check:[...]$38 = 52
+
+// lldb-command:print kk
+// lldb-check:[...]$39 = 53
+
+// lldb-command:print ll
+// lldb-check:[...]$40 = 54
+
+// lldb-command:print mm
+// lldb-check:[...]$41 = 55
+
+// lldb-command:print *nn
+// lldb-check:[...]$42 = 56
+
+
#![allow(unused_variable)]
struct Struct {
@@ -204,7 +323,7 @@ fn main() {
// tuple struct with ref binding
let &TupleStruct(mm, ref nn) = &TupleStruct(55.0, 56);
- zzz();
+ zzz(); // #break
}
-fn zzz() {()}
+fn zzz() { () }
View
26 src/test/debuginfo/evec-in-struct.rs
@@ -11,6 +11,9 @@
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak zzz
// gdb-command:run
@@ -30,6 +33,25 @@
// gdb-command:print struct_padded_at_end
// gdb-check:$5 = {x = {22, 23}, y = {24, 25}}
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print no_padding1
+// lldb-check:[...]$0 = NoPadding1 { x: [0, 1, 2], y: -3, z: [4.5, 5.5] }
+// lldb-command:print no_padding2
+// lldb-check:[...]$1 = NoPadding2 { x: [6, 7, 8], y: [[9, 10], [11, 12]] }
+
+// lldb-command:print struct_internal_padding
+// lldb-check:[...]$2 = StructInternalPadding { x: [13, 14], y: [15, 16] }
+
+// lldb-command:print single_vec
+// lldb-check:[...]$3 = SingleVec { x: [17, 18, 19, 20, 21] }
+
+// lldb-command:print struct_padded_at_end
+// lldb-check:[...]$4 = StructPaddedAtEnd { x: [22, 23], y: [24, 25] }
+
#![allow(unused_variable)]
struct NoPadding1 {
@@ -84,7 +106,7 @@ fn main() {
y: [24, 25]
};
- zzz();
+ zzz(); // #break
}
-fn zzz() {()}
+fn zzz() { () }
View
152 src/test/debuginfo/function-arg-initialization.rs
@@ -18,18 +18,19 @@
// compile-flags:-g
// gdb-command:set print pretty off
-// gdb-command:break function-arg-initialization.rs:139
-// gdb-command:break function-arg-initialization.rs:154
-// gdb-command:break function-arg-initialization.rs:158
-// gdb-command:break function-arg-initialization.rs:162
-// gdb-command:break function-arg-initialization.rs:166
-// gdb-command:break function-arg-initialization.rs:170
-// gdb-command:break function-arg-initialization.rs:174
-// gdb-command:break function-arg-initialization.rs:178
-// gdb-command:break function-arg-initialization.rs:182
-// gdb-command:break function-arg-initialization.rs:190
-// gdb-command:break function-arg-initialization.rs:197
-
+// gdb-command:break function-arg-initialization.rs:243
+// gdb-command:break function-arg-initialization.rs:258
+// gdb-command:break function-arg-initialization.rs:262
+// gdb-command:break function-arg-initialization.rs:266
+// gdb-command:break function-arg-initialization.rs:270
+// gdb-command:break function-arg-initialization.rs:274
+// gdb-command:break function-arg-initialization.rs:278
+// gdb-command:break function-arg-initialization.rs:282
+// gdb-command:break function-arg-initialization.rs:286
+// gdb-command:break function-arg-initialization.rs:294
+// gdb-command:break function-arg-initialization.rs:301
+
+// === GDB TESTS ===================================================================================
// gdb-command:run
@@ -130,13 +131,116 @@
// gdb-check:$32 = 45
// gdb-command:continue
-#![allow(unused_variable)]
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// IMMEDIATE ARGS
+// lldb-command:print a
+// lldb-check:[...]$0 = 1
+// lldb-command:print b
+// lldb-check:[...]$1 = true
+// lldb-command:print c
+// lldb-check:[...]$2 = 2.5
+// lldb-command:continue
+
+// NON IMMEDIATE ARGS
+// lldb-command:print a
+// lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 }
+// lldb-command:print b
+// lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 }
+// lldb-command:continue
+
+// BINDING
+// lldb-command:print a
+// lldb-check:[...]$5 = 19
+// lldb-command:print b
+// lldb-check:[...]$6 = 20
+// lldb-command:print c
+// lldb-check:[...]$7 = 21.5
+// lldb-command:continue
+
+// ASSIGNMENT
+// lldb-command:print a
+// lldb-check:[...]$8 = 22
+// lldb-command:print b
+// lldb-check:[...]$9 = 23
+// lldb-command:print c
+// lldb-check:[...]$10 = 24.5
+// lldb-command:continue
+
+// FUNCTION CALL
+// lldb-command:print x
+// lldb-check:[...]$11 = 25
+// lldb-command:print y
+// lldb-check:[...]$12 = 26
+// lldb-command:print z
+// lldb-check:[...]$13 = 27.5
+// lldb-command:continue
+
+// EXPR
+// lldb-command:print x
+// lldb-check:[...]$14 = 28
+// lldb-command:print y
+// lldb-check:[...]$15 = 29
+// lldb-command:print z
+// lldb-check:[...]$16 = 30.5
+// lldb-command:continue
+
+// RETURN EXPR
+// lldb-command:print x
+// lldb-check:[...]$17 = 31
+// lldb-command:print y
+// lldb-check:[...]$18 = 32
+// lldb-command:print z
+// lldb-check:[...]$19 = 33.5
+// lldb-command:continue
+
+// ARITHMETIC EXPR
+// lldb-command:print x
+// lldb-check:[...]$20 = 34
+// lldb-command:print y
+// lldb-check:[...]$21 = 35
+// lldb-command:print z
+// lldb-check:[...]$22 = 36.5
+// lldb-command:continue
+
+// IF EXPR
+// lldb-command:print x
+// lldb-check:[...]$23 = 37
+// lldb-command:print y
+// lldb-check:[...]$24 = 38
+// lldb-command:print z
+// lldb-check:[...]$25 = 39.5
+// lldb-command:continue
+
+// WHILE EXPR
+// lldb-command:print x
+// lldb-check:[...]$26 = 40
+// lldb-command:print y
+// lldb-check:[...]$27 = 41
+// lldb-command:print z
+// lldb-check:[...]$28 = 42
+// lldb-command:continue
+
+// LOOP EXPR
+// lldb-command:print x
+// lldb-check:[...]$29 = 43
+// lldb-command:print y
+// lldb-check:[...]$30 = 44
+// lldb-command:print z
+// lldb-check:[...]$31 = 45
+// lldb-command:continue
+
+
+
+#![allow(unused_variable)]
fn immediate_args(a: int, b: bool, c: f64) {
- ()
+ () // #break
}
struct BigStruct {
@@ -151,35 +255,35 @@ struct BigStruct {
}
fn non_immediate_args(a: BigStruct, b: BigStruct) {
- ()
+ () // #break
}
fn binding(a: i64, b: u64, c: f64) {
- let x = 0i;
+ let x = 0i; // #break
}
fn assignment(mut a: u64, b: u64, c: f64) {
- a = b;
+ a = b; // #break
}
fn function_call(x: u64, y: u64, z: f64) {
- std::io::stdio::print("Hi!")
+ std::io::stdio::print("Hi!") // #break
}
fn identifier(x: u64, y: u64, z: f64) -> u64 {
- x
+ x // #break
}
fn return_expr(x: u64, y: u64, z: f64) -> u64 {
- return x;
+ return x; // #break
}
fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 {
- x + y
+ x + y // #break
}
fn if_expr(x: u64, y: u64, z: f64) -> u64 {
- if x + y < 1000 {
+ if x + y < 1000 { // #break
x
} else {
y
@@ -187,14 +291,14 @@ fn if_expr(x: u64, y: u64, z: f64) -> u64 {
}
fn while_expr(mut x: u64, y: u64, z: u64) -> u64 {
- while x + y < 1000 {
+ while x + y > 1000 { // #break
x += z
}
return x;
}
fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 {
- loop {
+ loop { // #break
x += z;
if x + y > 1000 {
View
26 src/test/debuginfo/function-arguments.rs
@@ -11,6 +11,9 @@
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
// gdb-command:finish
@@ -28,21 +31,38 @@
// gdb-command:print b
// gdb-check:$4 = 3000
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print x
+// lldb-check:[...]$0 = 111102
+// lldb-command:print y
+// lldb-check:[...]$1 = true
+// lldb-command:continue
+
+// lldb-command:print a
+// lldb-check:[...]$2 = 2000
+// lldb-command:print b
+// lldb-check:[...]$3 = 3000
+// lldb-command:continue
+
fn main() {
fun(111102, true);
nested(2000, 3000);
fn nested(a: i32, b: i64) -> (i32, i64) {
- zzz();
+ zzz(); // #break
(a, b)
}
}
fn fun(x: int, y: bool) -> (int, bool) {
- zzz();
+ zzz(); // #break
(x, y)
}
-fn zzz() {()}
+fn zzz() { () }
View
119 src/test/debuginfo/function-prologue-stepping-no-split-stack.rs
@@ -14,9 +14,13 @@
// beginning of a function. Functions with the #[no_split_stack] attribute have the same prologue as
// regular C functions compiled with GCC or Clang and therefore are better handled by GDB. As a
// consequence, and as opposed to regular Rust functions, we can set the breakpoints via the
-// function name (and don't have to fall back on using line numbers).
+// function name (and don't have to fall back on using line numbers). For LLDB this shouldn't make
+// a difference because it can handle both cases.
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:set print pretty off
// gdb-command:rbreak immediate_args
// gdb-command:rbreak binding
@@ -127,6 +131,119 @@
// gdb-check:$32 = 45
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:breakpoint set --name immediate_args
+// lldb-command:breakpoint set --name non_immediate_args
+// lldb-command:breakpoint set --name binding
+// lldb-command:breakpoint set --name assignment
+// lldb-command:breakpoint set --name function_call
+// lldb-command:breakpoint set --name identifier
+// lldb-command:breakpoint set --name return_expr
+// lldb-command:breakpoint set --name arithmetic_expr
+// lldb-command:breakpoint set --name if_expr
+// lldb-command:breakpoint set --name while_expr
+// lldb-command:breakpoint set --name loop_expr
+// lldb-command:run
+
+// IMMEDIATE ARGS
+// lldb-command:print a
+// lldb-check:[...]$0 = 1
+// lldb-command:print b
+// lldb-check:[...]$1 = true
+// lldb-command:print c
+// lldb-check:[...]$2 = 2.5
+// lldb-command:continue
+
+// NON IMMEDIATE ARGS
+// lldb-command:print a
+// lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 }
+// lldb-command:print b
+// lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 }
+// lldb-command:continue
+
+// BINDING
+// lldb-command:print a
+// lldb-check:[...]$5 = 19
+// lldb-command:print b
+// lldb-check:[...]$6 = 20
+// lldb-command:print c
+// lldb-check:[...]$7 = 21.5
+// lldb-command:continue
+
+// ASSIGNMENT
+// lldb-command:print a
+// lldb-check:[...]$8 = 22
+// lldb-command:print b
+// lldb-check:[...]$9 = 23
+// lldb-command:print c
+// lldb-check:[...]$10 = 24.5
+// lldb-command:continue
+
+// FUNCTION CALL
+// lldb-command:print x
+// lldb-check:[...]$11 = 25
+// lldb-command:print y
+// lldb-check:[...]$12 = 26
+// lldb-command:print z
+// lldb-check:[...]$13 = 27.5
+// lldb-command:continue
+
+// EXPR
+// lldb-command:print x
+// lldb-check:[...]$14 = 28
+// lldb-command:print y
+// lldb-check:[...]$15 = 29
+// lldb-command:print z
+// lldb-check:[...]$16 = 30.5
+// lldb-command:continue
+
+// RETURN EXPR
+// lldb-command:print x
+// lldb-check:[...]$17 = 31
+// lldb-command:print y
+// lldb-check:[...]$18 = 32
+// lldb-command:print z
+// lldb-check:[...]$19 = 33.5
+// lldb-command:continue
+
+// ARITHMETIC EXPR
+// lldb-command:print x
+// lldb-check:[...]$20 = 34
+// lldb-command:print y
+// lldb-check:[...]$21 = 35
+// lldb-command:print z
+// lldb-check:[...]$22 = 36.5
+// lldb-command:continue
+
+// IF EXPR
+// lldb-command:print x
+// lldb-check:[...]$23 = 37
+// lldb-command:print y
+// lldb-check:[...]$24 = 38
+// lldb-command:print z
+// lldb-check:[...]$25 = 39.5
+// lldb-command:continue
+
+// WHILE EXPR
+// lldb-command:print x
+// lldb-check:[...]$26 = 40
+// lldb-command:print y
+// lldb-check:[...]$27 = 41
+// lldb-command:print z
+// lldb-check:[...]$28 = 42
+// lldb-command:continue
+
+// LOOP EXPR
+// lldb-command:print x
+// lldb-check:[...]$29 = 43
+// lldb-command:print y
+// lldb-check:[...]$30 = 44
+// lldb-command:print z
+// lldb-check:[...]$31 = 45
+// lldb-command:continue
+
#![allow(unused_variable)]
#[no_split_stack]
View
232 src/test/debuginfo/function-prologue-stepping-regular.rs
@@ -0,0 +1,232 @@
+// 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.
+
+// This test case checks if function arguments already have the correct value when breaking at the
+// beginning of a function.
+
+// ignore-gdb
+// compile-flags:-g
+
+// lldb-command:breakpoint set --name immediate_args
+// lldb-command:breakpoint set --name non_immediate_args
+// lldb-command:breakpoint set --name binding
+// lldb-command:breakpoint set --name assignment
+// lldb-command:breakpoint set --name function_call
+// lldb-command:breakpoint set --name identifier
+// lldb-command:breakpoint set --name return_expr
+// lldb-command:breakpoint set --name arithmetic_expr
+// lldb-command:breakpoint set --name if_expr
+// lldb-command:breakpoint set --name while_expr
+// lldb-command:breakpoint set --name loop_expr
+// lldb-command:run
+
+// IMMEDIATE ARGS
+// lldb-command:print a
+// lldb-check:[...]$0 = 1
+// lldb-command:print b
+// lldb-check:[...]$1 = true
+// lldb-command:print c
+// lldb-check:[...]$2 = 2.5
+// lldb-command:continue
+
+// NON IMMEDIATE ARGS
+// lldb-command:print a
+// lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 }
+// lldb-command:print b
+// lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 }
+// lldb-command:continue
+
+// BINDING
+// lldb-command:print a
+// lldb-check:[...]$5 = 19
+// lldb-command:print b
+// lldb-check:[...]$6 = 20
+// lldb-command:print c
+// lldb-check:[...]$7 = 21.5
+// lldb-command:continue
+
+// ASSIGNMENT
+// lldb-command:print a
+// lldb-check:[...]$8 = 22
+// lldb-command:print b
+// lldb-check:[...]$9 = 23
+// lldb-command:print c
+// lldb-check:[...]$10 = 24.5
+// lldb-command:continue
+
+// FUNCTION CALL
+// lldb-command:print x
+// lldb-check:[...]$11 = 25
+// lldb-command:print y
+// lldb-check:[...]$12 = 26
+// lldb-command:print z
+// lldb-check:[...]$13 = 27.5
+// lldb-command:continue
+
+// EXPR
+// lldb-command:print x
+// lldb-check:[...]$14 = 28
+// lldb-command:print y
+// lldb-check:[...]$15 = 29
+// lldb-command:print z
+// lldb-check:[...]$16 = 30.5
+// lldb-command:continue
+
+// RETURN EXPR
+// lldb-command:print x
+// lldb-check:[...]$17 = 31
+// lldb-command:print y
+// lldb-check:[...]$18 = 32
+// lldb-command:print z
+// lldb-check:[...]$19 = 33.5
+// lldb-command:continue
+
+// ARITHMETIC EXPR
+// lldb-command:print x
+// lldb-check:[...]$20 = 34
+// lldb-command:print y
+// lldb-check:[...]$21 = 35
+// lldb-command:print z
+// lldb-check:[...]$22 = 36.5
+// lldb-command:continue
+
+// IF EXPR
+// lldb-command:print x
+// lldb-check:[...]$23 = 37
+// lldb-command:print y
+// lldb-check:[...]$24 = 38
+// lldb-command:print z
+// lldb-check:[...]$25 = 39.5
+// lldb-command:continue
+
+// WHILE EXPR
+// lldb-command:print x
+// lldb-check:[...]$26 = 40
+// lldb-command:print y
+// lldb-check:[...]$27 = 41
+// lldb-command:print z
+// lldb-check:[...]$28 = 42
+// lldb-command:continue
+
+// LOOP EXPR
+// lldb-command:print x
+// lldb-check:[...]$29 = 43
+// lldb-command:print y
+// lldb-check:[...]$30 = 44
+// lldb-command:print z
+// lldb-check:[...]$31 = 45
+// lldb-command:continue
+
+#![allow(unused_variable)]
+
+fn immediate_args(a: int, b: bool, c: f64) {
+ ()
+}
+
+struct BigStruct {
+ a: u64,
+ b: u64,
+ c: u64,
+ d: u64,
+ e: u64,
+ f: u64,
+ g: u64,
+ h: u64
+}
+
+fn non_immediate_args(a: BigStruct, b: BigStruct) {
+ ()
+}
+
+fn binding(a: i64, b: u64, c: f64) {
+ let x = 0i;
+}
+
+fn assignment(mut a: u64, b: u64, c: f64) {
+ a = b;
+}
+
+fn function_call(x: u64, y: u64, z: f64) {
+ std::io::stdio::print("Hi!")
+}
+
+fn identifier(x: u64, y: u64, z: f64) -> u64 {
+ x
+}
+
+fn return_expr(x: u64, y: u64, z: f64) -> u64 {
+ return x;
+}
+
+fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 {
+ x + y
+}
+
+fn if_expr(x: u64, y: u64, z: f64) -> u64 {
+ if x + y < 1000 {
+ x
+ } else {
+ y
+ }
+}
+
+fn while_expr(mut x: u64, y: u64, z: u64) -> u64 {
+ while x + y < 1000 {
+ x += z
+ }
+ return x;
+}
+
+fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 {
+ loop {
+ x += z;
+
+ if x + y > 1000 {
+ return x;
+ }
+ }
+}
+
+fn main() {
+ immediate_args(1, true, 2.5);
+
+ non_immediate_args(
+ BigStruct {
+ a: 3,
+ b: 4,
+ c: 5,
+ d: 6,
+ e: 7,
+ f: 8,
+ g: 9,
+ h: 10
+ },
+ BigStruct {
+ a: 11,
+ b: 12,
+ c: 13,
+ d: 14,
+ e: 15,
+ f: 16,
+ g: 17,
+ h: 18
+ }
+ );
+
+ binding(19, 20, 21.5);
+ assignment(22, 23, 24.5);
+ function_call(25, 26, 27.5);
+ identifier(28, 29, 30.5);
+ return_expr(31, 32, 33.5);
+ arithmetic_expr(34, 35, 36.5);
+ if_expr(37, 38, 39.5);
+ while_expr(40, 41, 42);
+ loop_expr(43, 44, 45);
+}
View
35 src/test/debuginfo/generic-function.rs
@@ -11,6 +11,9 @@
// ignore-android: FIXME(#10381)
// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
// gdb-command:rbreak zzz
// gdb-command:run
@@ -41,6 +44,36 @@
// gdb-check:$9 = {{5, {a = 6, b = 7.5}}, {{a = 6, b = 7.5}, 5}}
// gdb-command:continue
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print *t0
+// lldb-check:[...]$0 = 1
+// lldb-command:print *t1
+// lldb-check:[...]$1 = 2.5
+// lldb-command:print ret
+// lldb-check:[...]$2 = ((1, 2.5), (2.5, 1))
+// lldb-command:continue
+
+// lldb-command:print *t0
+// lldb-check:[...]$3 = 3.5
+// lldb-command:print *t1
+// lldb-check:[...]$4 = 4