Support ptype/o in Rust
authorTom Tromey <tom@tromey.com>
Fri, 8 Jun 2018 19:18:25 +0000 (13:18 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 26 Jun 2018 20:53:17 +0000 (14:53 -0600)
commita33ccfc7afd9e32dd310f54d04719efeec8df342
tree66b30fdfb22c12b28d36bd7308b74ebec6a3e36c
parente0c547d14ae1d5c06b59178f4b1dd1f5e08b3feb
Support ptype/o in Rust

This adds support for ptype/o to the Rust language code.

By default, the Rust compiler reorders fields to reduce padding.  So,
the Rust language code sorts the fields by offset before printing.
This may yield somewhat odd-looking results, but it is faithful to
"what really happens", and might be useful when doing lower-level
debugging.

The reordering can be disabled using #[repr(c)]; ptype/o might be more
useful in this case.

gdb/ChangeLog
2018-06-26  Tom Tromey  <tom@tromey.com>

PR rust/22574:
* typeprint.c (whatis_exp): Allow ptype/o for Rust.
* rust-lang.c (rust_print_struct_def): Add podata parameter.
Update.
(rust_internal_print_type): Add podata parameter.
(rust_print_type): Update.

gdb/testsuite/ChangeLog
2018-06-26  Tom Tromey  <tom@tromey.com>

PR rust/22574:
* gdb.rust/simple.exp (test_one_slice): Add ptype/o tests.
* gdb.rust/simple.rs (struct SimpleLayout): New.
gdb/ChangeLog
gdb/rust-lang.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.rust/simple.exp
gdb/testsuite/gdb.rust/simple.rs
gdb/typeprint.c
This page took 0.031901 seconds and 4 git commands to generate.