DAP lets the client request some stack frame formatting via the StackFrameFormat type and the supportsValueFormattingOptions capability. This isn't implemented in gdb, but should be.
I have a patch, but still haven't written the test.
https://sourceware.org/pipermail/gdb-patches/2023-November/203729.html
The master branch has been updated by Tom Tromey <tromey@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1920148904fe5ca0035c1addf2376f9ab13ffd3d commit 1920148904fe5ca0035c1addf2376f9ab13ffd3d Author: Tom Tromey <tromey@adacore.com> Date: Fri Oct 6 13:40:39 2023 -0600 Handle StackFrameFormat in DAP DAP specifies a StackFrameFormat object that can be used to change how the "name" part of a stack frame is constructed. While this output can already be done in a nicer way (and also letting the client choose the formatting), nevertheless it is in the spec, so I figured I'd implement it. While implementing this, I discovered that the current code does not correctly preserve frame IDs across requests. I rewrote frame iteration to preserve this, and it turned out to be simpler to combine these patches. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30475
The gdb-14-branch branch has been updated by Tom Tromey <tromey@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=45b2be661868f7e2b3628285362e699cb6e09266 commit 45b2be661868f7e2b3628285362e699cb6e09266 Author: Tom Tromey <tromey@adacore.com> Date: Fri Oct 6 13:40:39 2023 -0600 Handle StackFrameFormat in DAP DAP specifies a StackFrameFormat object that can be used to change how the "name" part of a stack frame is constructed. While this output can already be done in a nicer way (and also letting the client choose the formatting), nevertheless it is in the spec, so I figured I'd implement it. While implementing this, I discovered that the current code does not correctly preserve frame IDs across requests. I rewrote frame iteration to preserve this, and it turned out to be simpler to combine these patches. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30475 (cherry picked from commit 1920148904fe5ca0035c1addf2376f9ab13ffd3d)
Fixed.