From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D00D4385841F; Fri, 17 Dec 2021 16:53:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D00D4385841F From: "aburgess at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug mi/28711] gdb closes when displaying structs with long field names in eclipse Date: Fri, 17 Dec 2021 16:53:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: mi X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aburgess at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc cf_reconfirmed_on everconfirmed bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2021 16:53:17 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28711 Andrew Burgess changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aburgess at redhat dot com Last reconfirmed| |2021-12-17 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #1 from Andrew Burgess --- Was able to reproduce this without using Eclipse, with current HEAD. First, I had to patch GDB to slow it down a little. I observed, that when = this bug triggers in Eclipse the complete command is now read in the fist "read" call. When GDB issues the second "read" call, it gets, not only the remain= der of the first command, including the trailing \n, but it also gets the start= of the next command sent from eclipse. When I tried to reproduce this in GDB without eclipse, I couldn't reproduce this read pattern, even bulk pasting in the commands, at least for me, GDB seemed to process things too quickly. So I added this patch to GDB: ### START #### diff --git a/gdb/event-top.c b/gdb/event-top.c index 530ea298247..e12a87a7910 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -854,6 +874,7 @@ gdb_readline_no_editing_callback (gdb_client_data client_data) buffer_grow_char (&line_buffer, '\0'); result =3D buffer_finish (&line_buffer); + sleep (1); ui->input_handler (gdb::unique_xmalloc_ptr (result)); } ### END ### And now I am able to reproduce the failure. (1) Create a pseudo terminal to use as the MI terminal - in another shell I= do `tty ; tail -f /dev/null`, and copy the path to the pseudo terminal that is printed, then (2) Compile the test.c program from the original bug report, (3) Start GDB: ./gdb/gdb --data-directory ./gdb/data-directory/ --interpret= er mi2 --nx -q --interpreter console -ex "new-ui mi /dev/pts/13" -ex "set pagination off" -ex "show version" -ex "start" ./test.x Replace "/dev/pts/13" with the path copied in step #1. (4) Now switch back to the terminal used in step #1, this should have start= ed up as an MI terminal. Paste in the following commands. These need to be pasted in a single paste action, NOT one at a time: ### START ###=20 -var-create --thread 1 --frame 0 - * var -var-list-children var1 -var-info-path-expression var1.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa= aaaaaaaaaaaaaaaaaaaaaaaa ### END ### For me, GDB will then exit every time. What I observe is that the call to `fgetc` in gdb_readline_no_editing_callback returns EOF after it has read t= he 1024 long command - this is the first command where the \n appears in the n= ext read block. I still don't understand why that call is returning EOF.... --=20 You are receiving this mail because: You are on the CC list for the bug.=