Summary: | Regression since 8.0 printing has changed format for decimal/octal/others | ||
---|---|---|---|
Product: | gdb | Reporter: | Jonah Graham <jonah> |
Component: | gdb | Assignee: | Tom Tromey <tromey> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | pedro, tromey |
Priority: | P2 | ||
Version: | HEAD | ||
Target Milestone: | 8.1 | ||
Host: | Target: | ||
Build: | Last reconfirmed: | 2017-07-11 00:00:00 |
Description
Jonah Graham
2017-06-26 13:07:16 UTC
Here is another example, demonstrating the problem is not just octal printing: $ gdb/gdb -q -ex 'print/d 1.5' -ex quit $1 = 1.5 $ gdb.8.0 -q -ex 'print/d 1.5' -ex quit $1 = 1 and $ gdb/gdb -q -ex 'print/u 1.5' -ex quit $1 = 4609434218613702656 $ gdb.8.0 -q -ex 'print/u 1.5' -ex quit $1 = 1 (In reply to Jonah Graham from comment #1) > Here is another example, demonstrating the problem is not just octal > printing: > $ gdb.8.0 -q -ex 'print/d 1.5' -ex quit > $1 = 1 > $ gdb.8.0 -q -ex 'print/u 1.5' -ex quit > $1 = 1 These still seem weird to me but I think we agreed to try to preserve this in: https://sourceware.org/ml/gdb-patches/2017-06/msg00314.html (In reply to Jonah Graham from comment #0) > For example on current HEAD: > $ gdb/gdb -q -ex 'print/o -5' -ex quit > $1 = 037773777773 This bug is that one of the constants in print_octals_chars is wrong. I guess it's been wrong for years and years and nobody noticed before... (In reply to Tom Tromey from comment #2) > (In reply to Jonah Graham from comment #1) > > Here is another example, demonstrating the problem is not just octal > > printing: > > > $ gdb.8.0 -q -ex 'print/d 1.5' -ex quit > > $1 = 1 > > > $ gdb.8.0 -q -ex 'print/u 1.5' -ex quit > > $1 = 1 > > These still seem weird to me OOC, how would you see them ideally be printed? > but I think we agreed to try to preserve this in: > https://sourceware.org/ml/gdb-patches/2017-06/msg00314.html (In reply to Pedro Alves from comment #4) > > https://sourceware.org/ml/gdb-patches/2017-06/msg00314.html For floating point types, I think /d and /u should work just like not having a flag; /o should probably just be an error or ignored, and /x should print in hex float. I'm not sure what /t should do. Given structs with mixed types, it seems to me that erroring wouldn't be desirable. E.g.: struct { int i; float f; } var; (gdb) p /o var (In reply to Pedro Alves from comment #6) > Given structs with mixed types, it seems to me that erroring wouldn't be > desirable. E.g.: > > struct { int i; float f; } var; > (gdb) p /o var Good point. Maybe /o and /t could be ignored for floating point. My main concern there would be possible confusion (like, "p/t 1.1" could be weird) -- though on the other hand I think the current behavior is already very confusing. Thanks for fixing this, the test failures in Eclipse CDT are now resolved. PS due to https://sourceware.org/ml/overseers/2017-q3/msg00065.html some comments are missing in this bug: https://sourceware.org/ml/gdb-prs/2017-q3/msg00203.html https://sourceware.org/ml/gdb-prs/2017-q3/msg00204.html Thanks for posting those links. The bug is fixed, I'm closing this. |