public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Regression or undocumented behavior change in Rust value printing in gdb 10.1
@ 2021-05-14  0:07 Russell Mull
  2021-05-14 13:52 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Russell Mull @ 2021-05-14  0:07 UTC (permalink / raw)
  To: gdb

Hello,

I've been trying to track down an issue with Rust's pretty printing
extensions for gdb. They take effect when printing a value of one of the
supported special types directly, but they are not used if the value is a
member of a struct. For example, if I print a value of type "Vec<u8>", then
the pretty printers are used. However, if I print a value of type "struct
TrivialNewtype(Vec<u8>)", then they are not.

This behavior changed in gdb 10.1; in version 9.2 and earlier, the extended
pretty printer was invoked for struct members as expected. I've bisected
the commit history and found that the change occurred at commit
5f56f7cbd22219e84df3caece06f469c5063e5fb ("Convert Rust printing to
value-based API"). I can't easily piece together how this code is intended
to work in combination with python-based pretty printers like those
provided with Rust, so I thought I'd ask about it here.

Is this a bug, or possibly the new intended behavior? If it's the latter,
is there something that can be done on the python extension side to get the
old behavior back?

I'm tracking this on the Rust side at
https://github.com/rust-lang/rust/issues/85267, and have a small repro
available at https://github.com/mullr/gdb-pretty-test.

Thanks,

Russell Mull

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Regression or undocumented behavior change in Rust value printing in gdb 10.1
  2021-05-14  0:07 Regression or undocumented behavior change in Rust value printing in gdb 10.1 Russell Mull
@ 2021-05-14 13:52 ` Tom Tromey
  2021-05-17 18:21   ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2021-05-14 13:52 UTC (permalink / raw)
  To: Russell Mull; +Cc: gdb

>>>>> "Russell" == Russell Mull <russell@digitalartificer.com> writes:

Russell> Is this a bug, or possibly the new intended behavior? If it's the latter,
Russell> is there something that can be done on the python extension side to get the
Russell> old behavior back?

It's a bug.  The changes to remove the val_print code weren't supposed
to (greatly) affect user-visible behavior.

Russell> I'm tracking this on the Rust side at
Russell> https://github.com/rust-lang/rust/issues/85267, and have a small repro
Russell> available at https://github.com/mullr/gdb-pretty-test.

Thanks.  I'll take a look.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Regression or undocumented behavior change in Rust value printing in gdb 10.1
  2021-05-14 13:52 ` Tom Tromey
@ 2021-05-17 18:21   ` Tom Tromey
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2021-05-17 18:21 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Russell Mull, gdb

Russell> I'm tracking this on the Rust side at
Russell> https://github.com/rust-lang/rust/issues/85267, and have a small repro
Russell> available at https://github.com/mullr/gdb-pretty-test.

Tom> Thanks.  I'll take a look.

I pushed a fix for this the other day.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-17 18:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14  0:07 Regression or undocumented behavior change in Rust value printing in gdb 10.1 Russell Mull
2021-05-14 13:52 ` Tom Tromey
2021-05-17 18:21   ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).