Bug 21208 - Inspecting std::set causes gdb to hang when using gdb/mi interface and pretty printing
Summary: Inspecting std::set causes gdb to hang when using gdb/mi interface and pretty...
Status: RESOLVED DUPLICATE of bug 11868
Alias: None
Product: gdb
Classification: Unclassified
Component: mi (show other bugs)
Version: 7.12.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-01 09:47 UTC by Jan Pohanka
Modified: 2023-08-31 17:19 UTC (History)
1 user (show)

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


Attachments
gdb log (1.50 KB, text/plain)
2017-03-01 09:47 UTC, Jan Pohanka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Pohanka 2017-03-01 09:47:22 UTC
Created attachment 9865 [details]
gdb log

Following code causes problem to mi interpreter with pretty printing enabled

#include <set>
#include <string>

using namespace std;

int main()
{
    set<string> foo; // non POD type needed here
    foo.insert("bar");

    return 0;
}


Following commands can be used to reproduce the issue
gdb --interpreter=mi ./test

br main
-enable-pretty-printing
-exec-run
-var-create - * foo
-var-list-children var1

Listing children of foo causes very long loop that sometimes never finishes. Detailed log is attached.
Comment 1 Tom Tromey 2022-05-25 18:47:43 UTC
I see this in the log: numchild="72752"

What's probably going on is that this is printing the
uninitialized set.  Normally a front end should use
the output-limiting features of MI to avoid getting
tons of garbage in this case.  gdb has no way to know
whether a variable is initialized or not...
Comment 2 Tom Tromey 2023-08-31 17:19:39 UTC
Duping to the general bug about uninitialized handling.

*** This bug has been marked as a duplicate of bug 11868 ***