Bug 33533

Summary: GCC's libstdc++-prettyprinters/chrono.cc hms and hms_nano fail after commit g:86ac8c546235a67d6a6bb29476a3a9ac8f7a620a
Product: gdb Reporter: Christophe Lyon <clyon>
Component: c++Assignee: Tom Tromey <tromey>
Status: NEW ---    
Severity: normal CC: sam, ssbssa, tromey
Priority: P2    
Version: HEAD   
Target Milestone: ---   
See Also: https://sourceware.org/bugzilla/show_bug.cgi?id=33557
Host: Target:
Build: Last reconfirmed:
Project(s) to access: ssh public key:
Bug Depends on:    
Bug Blocks: 32726    

Description Christophe Lyon 2025-10-10 14:11:09 UTC
After commit https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=86ac8c546235a67d6a6bb29476a3a9ac8f7a620a our CI has noticed 2 regressions on arm and aarch64:
Running libstdc++:libstdc++-prettyprinters/prettyprinters.exp ...
FAIL: libstdc++-prettyprinters/chrono.cc print hms
FAIL: libstdc++-prettyprinters/chrono.cc print hms_nano

(these are from the GCC testsuite, using up-to-date trunk)

In libstdc++.log, I can see:
got: $24 = 8 is not a valid weekday\r\nPASS: libstdc++-prettyprinters/chrono.cc print nawd
$25 = Traceback (most recent call last):
  File "/home/tcwg-buildslave/workspace/tcwg_gnu_1/abe/snapshots/gcc.git~master/libstdc++-v3/testsuite/../python/libstdcxx/v6/printers.py", line 2196, in to_string
got: $25 = Traceback (most recent call last):\r\nFAIL: libstdc++-prettyprinters/chrono.cc print hms
skipping:   File "/home/tcwg-buildslave/workspace/tcwg_gnu_1/abe/snapshots/gcc.git~master/libstdc++-v3/testsuite/../python/libstdcxx/v6/printers.py", line 2196, in to_string\r\n    if val['fractional_width'] != 0:
skipping:     if val['fractional_width'] != 0:\r\n       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gdb.error: value has been optimized out
skipping:        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\nskipping: gdb.error: value has been optimized out\r\n
skipping: \r\n$26 = Traceback (most recent call last):
got: $26 = Traceback (most recent call last):\r\nFAIL: libstdc++-prettyprinters/chrono.cc print hms_nano
Comment 1 Tom Tromey 2025-11-12 15:01:17 UTC
I suspect this is a dup of bug#33557.
There's a patch pending for that.

Anyway can confirm this bug.
Comment 2 Tom Tromey 2025-11-12 16:53:27 UTC
The patch for that bug didn't seem to fix this one.