public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/14363] New: Pretty-Printing of cyclic references produces infinite recursion
@ 2012-07-13 18:18 oliver.buchtala at googlemail dot com
  2012-07-13 18:45 ` [Bug python/14363] " oliver.buchtala at googlemail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: oliver.buchtala at googlemail dot com @ 2012-07-13 18:18 UTC (permalink / raw)
  To: gdb-prs

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

             Bug #: 14363
           Summary: Pretty-Printing of cyclic references produces infinite
                    recursion
           Product: gdb
           Version: 7.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
        AssignedTo: unassigned@sourceware.org
        ReportedBy: oliver.buchtala@googlemail.com
    Classification: Unclassified


I have a struct Hash which can contain Hashes as values.
This way one can produce a cyclic reference adding two hashes to each other.

Such a cyclic produces an infinite recursion during pretty-printing of
children.

-- 
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] 12+ messages in thread

* [Bug python/14363] Pretty-Printing of cyclic references produces infinite recursion
  2012-07-13 18:18 [Bug python/14363] New: Pretty-Printing of cyclic references produces infinite recursion oliver.buchtala at googlemail dot com
@ 2012-07-13 18:45 ` oliver.buchtala at googlemail dot com
  2012-07-13 18:46 ` oliver.buchtala at googlemail dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: oliver.buchtala at googlemail dot com @ 2012-07-13 18:45 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Oliver Buchtala <oliver.buchtala at googlemail dot com> 2012-07-13 18:45:05 UTC ---
Created attachment 6528
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6528
minimalistic c++ example sourcce

-- 
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] 12+ messages in thread

* [Bug python/14363] Pretty-Printing of cyclic references produces infinite recursion
  2012-07-13 18:18 [Bug python/14363] New: Pretty-Printing of cyclic references produces infinite recursion oliver.buchtala at googlemail dot com
  2012-07-13 18:45 ` [Bug python/14363] " oliver.buchtala at googlemail dot com
@ 2012-07-13 18:46 ` oliver.buchtala at googlemail dot com
  2012-07-15 12:56 ` jan.kratochvil at redhat dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: oliver.buchtala at googlemail dot com @ 2012-07-13 18:46 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Oliver Buchtala <oliver.buchtala at googlemail dot com> 2012-07-13 18:46:06 UTC ---
Created attachment 6529
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6529
pretty printer implementation

-- 
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] 12+ messages in thread

* [Bug python/14363] Pretty-Printing of cyclic references produces infinite recursion
  2012-07-13 18:18 [Bug python/14363] New: Pretty-Printing of cyclic references produces infinite recursion oliver.buchtala at googlemail dot com
  2012-07-13 18:45 ` [Bug python/14363] " oliver.buchtala at googlemail dot com
  2012-07-13 18:46 ` oliver.buchtala at googlemail dot com
@ 2012-07-15 12:56 ` jan.kratochvil at redhat dot com
  2012-07-19 13:28 ` robert.pollak at gmail dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jan.kratochvil at redhat dot com @ 2012-07-15 12:56 UTC (permalink / raw)
  To: gdb-prs

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

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pmuldoon at redhat dot com

-- 
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] 12+ messages in thread

* [Bug python/14363] Pretty-Printing of cyclic references produces infinite recursion
  2012-07-13 18:18 [Bug python/14363] New: Pretty-Printing of cyclic references produces infinite recursion oliver.buchtala at googlemail dot com
                   ` (2 preceding siblings ...)
  2012-07-15 12:56 ` jan.kratochvil at redhat dot com
@ 2012-07-19 13:28 ` robert.pollak at gmail dot com
  2012-08-01 18:22 ` oliver.buchtala at googlemail dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: robert.pollak at gmail dot com @ 2012-07-19 13:28 UTC (permalink / raw)
  To: gdb-prs

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

Robert Pollak <robert.pollak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |robert.pollak at gmail dot
                   |                            |com

-- 
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] 12+ messages in thread

* [Bug python/14363] Pretty-Printing of cyclic references produces infinite recursion
  2012-07-13 18:18 [Bug python/14363] New: Pretty-Printing of cyclic references produces infinite recursion oliver.buchtala at googlemail dot com
                   ` (3 preceding siblings ...)
  2012-07-19 13:28 ` robert.pollak at gmail dot com
@ 2012-08-01 18:22 ` oliver.buchtala at googlemail dot com
  2012-08-01 20:08 ` oliver.buchtala at googlemail dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: oliver.buchtala at googlemail dot com @ 2012-08-01 18:22 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Oliver Buchtala <oliver.buchtala at googlemail dot com> 2012-08-01 18:22:15 UTC ---
I have had a glance at the python api source and want to add some proposals:

py-prettyprint.c:
print_children (PyObject *printer, const char *hint,
        struct ui_file *stream, int recurse,
        const struct value_print_options *options,
        const struct language_defn *language,
        int is_py_none)

I. Let the pretty-printer know about the current recursion level

this would give the pretty-printer more control about how deep it provides
children.

II. Handle Visited information

A value has a location (struct) that contains the address which could be
collected in a set of visited addresses.
The set would be initialized on recurse==0.

A visited flag could be set in the gdb.Value, leaving handling this to the
pretty-printer, or recursion stopped based on this information, and maybe based
on gdb pretty-print options:
...
   common_val_print (value, stream, recurse + 1, options, language);
...

-- 
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] 12+ messages in thread

* [Bug python/14363] Pretty-Printing of cyclic references produces infinite recursion
  2012-07-13 18:18 [Bug python/14363] New: Pretty-Printing of cyclic references produces infinite recursion oliver.buchtala at googlemail dot com
                   ` (4 preceding siblings ...)
  2012-08-01 18:22 ` oliver.buchtala at googlemail dot com
@ 2012-08-01 20:08 ` oliver.buchtala at googlemail dot com
  2012-08-02  6:14 ` pmuldoon at redhat dot com
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: oliver.buchtala at googlemail dot com @ 2012-08-01 20:08 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Oliver Buchtala <oliver.buchtala at googlemail dot com> 2012-08-01 20:08:01 UTC ---
Created attachment 6564
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6564
this patch implements proposal I

-- 
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] 12+ messages in thread

* [Bug python/14363] Pretty-Printing of cyclic references produces infinite recursion
  2012-07-13 18:18 [Bug python/14363] New: Pretty-Printing of cyclic references produces infinite recursion oliver.buchtala at googlemail dot com
                   ` (5 preceding siblings ...)
  2012-08-01 20:08 ` oliver.buchtala at googlemail dot com
@ 2012-08-02  6:14 ` pmuldoon at redhat dot com
  2012-08-02  6:39 ` pmuldoon at redhat dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pmuldoon at redhat dot com @ 2012-08-02  6:14 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Phil Muldoon <pmuldoon at redhat dot com> 2012-08-02 06:14:00 UTC ---
Comment on attachment 6564
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6564
this patch implements proposal I

Thanks for the bug report, and the patch.  If you want to submit this as a
solution, it would be great if you could post it to gdb-patched@sourceware.org
for review.  It will receive the attention if deserves there.  

There is a brief guide to contributions formats and processes here

http://sourceware.org/gdb/contribute/

-- 
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] 12+ messages in thread

* [Bug python/14363] Pretty-Printing of cyclic references produces infinite recursion
  2012-07-13 18:18 [Bug python/14363] New: Pretty-Printing of cyclic references produces infinite recursion oliver.buchtala at googlemail dot com
                   ` (6 preceding siblings ...)
  2012-08-02  6:14 ` pmuldoon at redhat dot com
@ 2012-08-02  6:39 ` pmuldoon at redhat dot com
  2023-08-31 17:00 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pmuldoon at redhat dot com @ 2012-08-02  6:39 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from Phil Muldoon <pmuldoon at redhat dot com> 2012-08-02 06:39:13 UTC ---
Sorry, typo, that should be:

gdb-patches@sourceware.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] 12+ messages in thread

* [Bug python/14363] Pretty-Printing of cyclic references produces infinite recursion
  2012-07-13 18:18 [Bug python/14363] New: Pretty-Printing of cyclic references produces infinite recursion oliver.buchtala at googlemail dot com
                   ` (7 preceding siblings ...)
  2012-08-02  6:39 ` pmuldoon at redhat dot com
@ 2023-08-31 17:00 ` tromey at sourceware dot org
  2023-08-31 20:01 ` tromey at sourceware dot org
  2023-09-26 15:35 ` tromey at sourceware dot org
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-08-31 17:00 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #7 from Tom Tromey <tromey at sourceware dot org> ---
Giving printers better access to some gdb printing context
has been requested in a few contexts now.


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=30816
[Bug 30816] [meta] Pretty-printing v2
-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug python/14363] Pretty-Printing of cyclic references produces infinite recursion
  2012-07-13 18:18 [Bug python/14363] New: Pretty-Printing of cyclic references produces infinite recursion oliver.buchtala at googlemail dot com
                   ` (8 preceding siblings ...)
  2023-08-31 17:00 ` tromey at sourceware dot org
@ 2023-08-31 20:01 ` tromey at sourceware dot org
  2023-09-26 15:35 ` tromey at sourceware dot org
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-08-31 20:01 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|30816                       |
         Depends on|                            |30816


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=30816
[Bug 30816] [meta] Pretty-printing v2
-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug python/14363] Pretty-Printing of cyclic references produces infinite recursion
  2012-07-13 18:18 [Bug python/14363] New: Pretty-Printing of cyclic references produces infinite recursion oliver.buchtala at googlemail dot com
                   ` (9 preceding siblings ...)
  2023-08-31 20:01 ` tromey at sourceware dot org
@ 2023-09-26 15:35 ` tromey at sourceware dot org
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-09-26 15:35 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=14363
Bug 14363 depends on bug 30816, which changed state.

Bug 30816 Summary: [meta] Pretty-printing v2
https://sourceware.org/bugzilla/show_bug.cgi?id=30816

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

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

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

end of thread, other threads:[~2023-09-26 15:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-13 18:18 [Bug python/14363] New: Pretty-Printing of cyclic references produces infinite recursion oliver.buchtala at googlemail dot com
2012-07-13 18:45 ` [Bug python/14363] " oliver.buchtala at googlemail dot com
2012-07-13 18:46 ` oliver.buchtala at googlemail dot com
2012-07-15 12:56 ` jan.kratochvil at redhat dot com
2012-07-19 13:28 ` robert.pollak at gmail dot com
2012-08-01 18:22 ` oliver.buchtala at googlemail dot com
2012-08-01 20:08 ` oliver.buchtala at googlemail dot com
2012-08-02  6:14 ` pmuldoon at redhat dot com
2012-08-02  6:39 ` pmuldoon at redhat dot com
2023-08-31 17:00 ` tromey at sourceware dot org
2023-08-31 20:01 ` tromey at sourceware dot org
2023-09-26 15:35 ` 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).