diff options
author | Manish Goregaokar <manish@mozilla.com> | 2016-10-29 05:55:58 -0700 |
---|---|---|
committer | Manish Goregaokar <manish@mozilla.com> | 2016-11-03 15:45:14 -0700 |
commit | cdf5a07c75b47481da1e99ee91ee860c2a6bb5f6 (patch) | |
tree | 057640bee6175b7afea74966d85f931736b1522b /gdb/testsuite/gdb.rust | |
parent | b96645f1a1e6084ed6a20ddf615bdc4d2487a9c9 (diff) | |
download | gdb-cdf5a07c75b47481da1e99ee91ee860c2a6bb5f6.zip gdb-cdf5a07c75b47481da1e99ee91ee860c2a6bb5f6.tar.gz gdb-cdf5a07c75b47481da1e99ee91ee860c2a6bb5f6.tar.bz2 |
Add support for the sizeof function in Rust
2016-10-29 Manish Goregaokar <manish@mozilla.com>
gdb/ChangeLog:
* rust-exp.y: Parse `sizeof(exp)` as `UNOP_SIZEOF`
gdb/testsuite/ChangeLog:
* gdb.rust/simple.exp: Add tests for `sizeof(expr)`
Diffstat (limited to 'gdb/testsuite/gdb.rust')
-rw-r--r-- | gdb/testsuite/gdb.rust/simple.exp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp index 8e84daa..4b9a979 100644 --- a/gdb/testsuite/gdb.rust/simple.exp +++ b/gdb/testsuite/gdb.rust/simple.exp @@ -33,6 +33,7 @@ if {![runto ${srcfile}:$line]} { gdb_test "print a" " = \\(\\)" gdb_test "ptype a" " = \\(\\)" +gdb_test "print sizeof(a)" " = 0" gdb_test "print b" " = \\\[\\\]" gdb_test "ptype b" " = \\\[i32; 0\\\]" @@ -41,6 +42,7 @@ gdb_test "print *(&b as *const \[i32; 0_0\])" " = \\\[\\\]" gdb_test "print c" " = 99" gdb_test "ptype c" " = i32" +gdb_test "print sizeof(c)" " = 4" gdb_test "print c = 87" " = \\(\\)" gdb_test "print c" " = 87" @@ -127,7 +129,7 @@ gdb_test "print nosuchsymbol" \ gdb_test "print e" " = simple::MoreComplicated::Two\\(73\\)" gdb_test "print e2" \ " = simple::MoreComplicated::Four\\{this: true, is: 8, a: 109 'm', struct_: 100, variant: 10\\}" - +gdb_test "print sizeof(e)" " = 24" gdb_test_sequence "ptype e" "" { " = enum simple::MoreComplicated \\{" " One," |