Fix Python pretty-printing bug in Rust
authorTom Tromey <tom@tromey.com>
Sat, 15 May 2021 01:54:35 +0000 (19:54 -0600)
committerTom Tromey <tom@tromey.com>
Sat, 15 May 2021 02:01:12 +0000 (20:01 -0600)
commit887e71588b295a4d4f4bd7480b1a8c8507dfddb8
tree7a40b0b55efa561569dd468ca7a45453e1faadc8
parent2fbe9507bfba58a6a000d231fe735bad1f245b55
Fix Python pretty-printing bug in Rust

An upstream Rust bug notes notes that the Python pretty-printing
feature is broken for values that appear as members of certain types
in Rust.

The bug here is that some of the Rust value-printing code calls
value_print_inner, a method on rust_language.  This bypasses the
common code that calls into Python.

I'm checking this in.

gdb/ChangeLog
2021-05-14  Tom Tromey  <tom@tromey.com>

* rust-lang.c (rust_language::val_print_struct)
(rust_language::print_enum): Use common_val_print, not
value_print_inner.

gdb/testsuite/ChangeLog
2021-05-14  Tom Tromey  <tom@tromey.com>

* gdb.rust/pp.exp: New file.
* gdb.rust/pp.py: New file.
* gdb.rust/pp.rs: New file.
gdb/ChangeLog
gdb/rust-lang.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.rust/pp.exp [new file with mode: 0644]
gdb/testsuite/gdb.rust/pp.py [new file with mode: 0644]
gdb/testsuite/gdb.rust/pp.rs [new file with mode: 0644]