public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/12530] New: pretty-printing can't be easily toggled
@ 2011-03-02  8:17 dodji at seketeli dot org
  2011-03-02  8:32 ` [Bug varobj/12530] " dodji at seketeli dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dodji at seketeli dot org @ 2011-03-02  8:17 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12530

           Summary: pretty-printing can't be easily toggled
           Product: gdb
           Version: archer
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned@sourceware.org
        ReportedBy: dodji@seketeli.org


Background
==========

In a graphical debugger, suppose the user is looking at the local
variables of the current frame.  If the user enables pretty
printing, those variables have to dynamically be re-rendered
using the pretty printers.  Likewise, whenever the user disables
pretty printing, those variable have to dynamically be
re-rendered without the pretty printing visualizers.  It should
not be required to re-start the graphical debugger just to toggle
pretty printing.

There are several things that make it hard for front-ends using
the GDB MI API to achieve this goal.

Issue description
=================

The current MI API doesn't allow clients to globally disable
pretty printing.  Rather, every single variable object needs to
see its visualizer set to 'None', using -var-set-visualizer.
>From the point of view of the client, this is suboptimal.  There
could be an MI command that would cause all current variable
objects to be re-rendered.  Clients would then be notified and
would update their side of the graphical representation of the
re-rendered variables.

In case doing this would be too hard, the current scheme could be
kept.  But then there are other point that would need to be
addressed.

Currently, whenever a variable object (named var1) has been
created and rendered using pretty printers, it's quite hard to
make its sub-objects be recursively be re-rendered using
the "None" pretty printer, at least.  That is, -var-set-visualizer
None var, followed by -var-list-children --all-values yields
sub-objects rendered with the *previous* pretty printing visualizer.
In other words, sub-objects currently don't inherit the pretty
printing visualizer of their parent object.

Possible solution
=================

I am proposing to maybe have a -var-list-children
--with-visualizer <Name>, and similarly a -var-create
--with-visualizer <Name> to disable/enable pretty printing per
variable object, including their sub objects.

Below is a small gdb session that should hopefully illustrate my
point.

[dodji@adjoa test]$ cat test.cc
#include <string>

using std::string;

class person
{
    string m_name;

public:
    person (const string& name = ""):
        m_name (name)
    {
    }
};

int
main()
{
    person p ("Toto");
    return 0;
}


[dodji@adjoa test]$ gdb --interpreter=mi2 ./test

(gdb)
b main

~"b main\n"
~"Breakpoint 1 at 0x4007af: file test.cc, line 19.\n"
^done

(gdb)
run

~"Breakpoint 1, main () at test.cc:19\n"
~"19\t    person p (\"Toto\");\n"
*stopped,frame={addr="0x00000000004007af",func="main",args=[],file="test.cc",fullname="/home/dodji/test/test.cc",line="19"},thread-id="1",stopped-threads="all",core="1"
(gdb)
next

~"n\n"
^running
*running,thread-id="1"
(gdb) 
~"20\t    return 0;\n"
*stopped,frame={addr="0x0000000000400850",func="main",args=[],file="test.cc",fullname="/home/dodji/test/test.cc",line="20"},thread-id="1",stopped-threads="all",core="1"
(gdb) 
-enable-pretty-printing
^done
(gdb) 
-var-create - * p
^done,name="var1",numchild="1",value="{...}",type="person",thread-id="1",has_more="0"
(gdb) 
-var-list-children --all-values var1
^done,numchild="1",children=[child={name="var1.private",exp="private",numchild="1",value="",thread-id="1"}],has_more="0"
(gdb) 
-var-list-children --all-values var1.private
^done,numchild="1",children=[child={name="var1.private.m_name",exp="m_name",numchild="0",value="\"Toto\"",type="std::string",thread-id="1",displayhint="string",dynamic="1"}],has_more="0"
(gdb) 
-var-set-visualizer var1 None
^done
(gdb)
-var-list-children --all-values var1
^done,numchild="1",children=[child={name="var1.private",exp="private",numchild="1",value="",thread-id="1"}],has_more="0"
(gdb) 
-var-list-children --all-values var1.private
^done,numchild="1",children=[child={name="var1.private.m_name",exp="m_name",numchild="0",value="\"Toto\"",type="std::string",thread-id="1",displayhint="string",dynamic="1"}],has_more="0"
(gdb)
-var-set-visualizer var1.private None
^done
(gdb) 
-var-list-children --all-values var1.private
^done,numchild="1",children=[child={name="var1.private.m_name",exp="m_name",numchild="0",value="\"Toto\"",type="std::string",thread-id="1",displayhint="string",dynamic="1"}],has_more="0"
(gdb)
-var-set-visualizer var1.private.m_name None
^done
(gdb)
-var-list-children --all-values var1.private
^done,numchild="1",children=[child={name="var1.private.m_name",exp="m_name",numchild="2",value="{...}",type="std::string",thread-id="1"}],has_more="0"


The exact GDB version I am using is:

GNU gdb (GDB) Fedora (7.1-34.fc13)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug varobj/12530] pretty-printing can't be easily toggled
  2011-03-02  8:17 [Bug ada/12530] New: pretty-printing can't be easily toggled dodji at seketeli dot org
@ 2011-03-02  8:32 ` dodji at seketeli dot org
  2011-03-02  8:42 ` dodji at seketeli dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dodji at seketeli dot org @ 2011-03-02  8:32 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12530

dodji at seketeli dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|ada                         |varobj

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug varobj/12530] pretty-printing can't be easily toggled
  2011-03-02  8:17 [Bug ada/12530] New: pretty-printing can't be easily toggled dodji at seketeli dot org
  2011-03-02  8:32 ` [Bug varobj/12530] " dodji at seketeli dot org
@ 2011-03-02  8:42 ` dodji at seketeli dot org
  2011-09-02 10:10 ` pmuldoon at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dodji at seketeli dot org @ 2011-03-02  8:42 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12530

--- Comment #1 from dodji at seketeli dot org 2011-03-02 08:41:50 UTC ---
Another possible proposal could also be to have something like
-var-set-visualizer --recursive <Name>, to allow setting a given
visualizer to not only a variable object, but also to its sub-objects.
I guess this might be even better than having the -var-list-children
--with-visualizer I was proposing earlier.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug varobj/12530] pretty-printing can't be easily toggled
  2011-03-02  8:17 [Bug ada/12530] New: pretty-printing can't be easily toggled dodji at seketeli dot org
  2011-03-02  8:32 ` [Bug varobj/12530] " dodji at seketeli dot org
  2011-03-02  8:42 ` dodji at seketeli dot org
@ 2011-09-02 10:10 ` pmuldoon at redhat dot com
  2023-08-31 16:35 ` tromey at sourceware dot org
  2023-08-31 16:36 ` tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pmuldoon at redhat dot com @ 2011-09-02 10:10 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12530

Phil Muldoon <pmuldoon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pmuldoon at redhat dot com
         AssignedTo|unassigned at sourceware    |pmuldoon at redhat dot com
                   |dot org                     |

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug varobj/12530] pretty-printing can't be easily toggled
  2011-03-02  8:17 [Bug ada/12530] New: pretty-printing can't be easily toggled dodji at seketeli dot org
                   ` (2 preceding siblings ...)
  2011-09-02 10:10 ` pmuldoon at redhat dot com
@ 2023-08-31 16:35 ` tromey at sourceware dot org
  2023-08-31 16:36 ` tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at sourceware dot org @ 2023-08-31 16:35 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=12530

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
If you change a visualizer, the children may all change.
So I tend to think there's no way to really satisfy this
request.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug varobj/12530] pretty-printing can't be easily toggled
  2011-03-02  8:17 [Bug ada/12530] New: pretty-printing can't be easily toggled dodji at seketeli dot org
                   ` (3 preceding siblings ...)
  2023-08-31 16:35 ` tromey at sourceware dot org
@ 2023-08-31 16:36 ` tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at sourceware dot org @ 2023-08-31 16:36 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=12530

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
             Status|NEW                         |RESOLVED

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
What I mean is, even the names or number of children may change.
A pretty-printer can synthesize or omit children.
I think I'm going to close this, please reopen if I'm in error.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2023-08-31 16:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-02  8:17 [Bug ada/12530] New: pretty-printing can't be easily toggled dodji at seketeli dot org
2011-03-02  8:32 ` [Bug varobj/12530] " dodji at seketeli dot org
2011-03-02  8:42 ` dodji at seketeli dot org
2011-09-02 10:10 ` pmuldoon at redhat dot com
2023-08-31 16:35 ` tromey at sourceware dot org
2023-08-31 16:36 ` tromey at sourceware dot org

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).