Bug 30469 - Implement ValueFormat
Summary: Implement ValueFormat
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: dap (show other bugs)
Version: HEAD
: P2 enhancement
Target Milestone: 14.1
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-19 14:47 UTC by Tom Tromey
Modified: 2023-08-01 19:07 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2023-05-19 14:47:17 UTC
Some DAP requests, like "evaluate", support a 'format' parameter
of type 'ValueFormat'.  This isn't supported in gdb, but maybe could be.
This may require an extension to the pretty-printer API.
Comment 1 Tom Tromey 2023-07-25 15:15:49 UTC
I suspect all that is needed is to wrap the calls in:

with output-radix 16 ...
Comment 2 Tom Tromey 2023-07-25 16:07:39 UTC
I have a patch to do this, but I haven't written tests yet.
Also, my patch does not handle StackFrameFormat.
It's not entirely clear how this is supposed to be done.
Comment 4 Joel Brobecker 2023-07-30 22:53:32 UTC
I think I may have accidentally removed the target milestone from the wrong PR (looks like bugzilla is automatically getting me to my next PR as soon as I hit "save", rather than staying on the same PR). Sorry about that! putting it back.
Comment 5 Sourceware Commits 2023-08-01 19:05:47 UTC
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e13769988480865662e8347ed9f131ce0b8f5afc

commit e13769988480865662e8347ed9f131ce0b8f5afc
Author: Tom Tromey <tromey@adacore.com>
Date:   Tue Jul 25 10:13:52 2023 -0600

    Implement ValueFormat for DAP
    
    This patch implements ValueFormat for DAP.  Currently this only means
    supporting "hex".
    
    Note that StackFrameFormat is defined to have many more options, but
    none are currently recognized.  It isn't entirely clear how these
    should be handled.  I'll file a new gdb bug for this, and perhaps an
    upstream DAP bug as well.
    
    New in v2:
    - I realized that the "hover" context was broken, and furthermore
      that we only had tests for "hover" failing, not for it succeeding.
      This version fixes the oversight and adds a test.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30469
Comment 6 Tom Tromey 2023-08-01 19:07:25 UTC
Fixed.