From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15710 invoked by alias); 14 Mar 2013 14:41:24 -0000 Received: (qmail 15446 invoked by uid 22791); 14 Mar 2013 14:41:18 -0000 X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Mar 2013 14:40:45 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2EEefkK030046 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Mar 2013 10:40:41 -0400 Received: from host2.jankratochvil.net (ovpn-116-42.ams2.redhat.com [10.36.116.42]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2EEeapG002441 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 14 Mar 2013 10:40:39 -0400 Date: Thu, 14 Mar 2013 14:41:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: Hui Zhu , gdb-patches ml , Joel Brobecker Subject: [commit+7.6] [patch+7.6] [TUI] Fix scrolling crash 7.6 regression [Re: [PATCH] Fix gdb crash with tui] Message-ID: <20130314144035.GA11439@host2.jankratochvil.net> References: <513F7592.2080902@redhat.com> <20130313185456.GA18563@host2.jankratochvil.net> <5141C38B.1080204@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5141C38B.1080204@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-03/txt/msg00632.txt.bz2 On Thu, 14 Mar 2013 13:33:15 +0100, Pedro Alves wrote: > On 03/13/2013 06:54 PM, Jan Kratochvil wrote: > > That's true but I expect there has to be output a lot of other garbage like > > "\tin " or "\n" so I did not consider "file" to be significant. I guess the > > same crash could happen before just after much more scrollings. > > Hmm, I'm not seeing how. tui_show_source does no other output > to gdb_stdout. When I investigate it I agree there is no accidental output, I thought it is: print_source_lines_base: ui_out_field_int (uiout, "line", line); ui_out_text (uiout, "\tin "); ui_out_field_string (uiout, "file", symtab_to_filename_for_display (s)); and TUI: tui_ui_out_impl.text = tui_text; tui_text: if (data->line > 0) { if (strchr (string, '\n') != 0) { data->line = -1; data->start_of_line = 0; } return; } That "\tin " is discarded thanks to that 'return' and 'data->line > 0'. This was the mistake I made in the patch... > > - /* TUI expects the "fullname" field. While it is > > - !ui_out_is_mi_like_p compared to CLI it is !ui_source_list. */ > > + /* CLI expects only the "file" field. TUI expects only the > > + "fullname" field (and TUI does break if "file" is printed). > > + MI expects both the fields. ui_source_list is set only for CLI, > > s/both the fields/both fields/ done > I'm wondering about whether this "fullname" handling gross-ness in the > TUI is really necessary. Probably not but I was fixing absolute pathnames across GDB, not fixing TUI. I am still not done with the absolute pathnames task. Checked in: http://sourceware.org/ml/gdb-cvs/2013-03/msg00133.html and for 7.6: http://sourceware.org/ml/gdb-cvs/2013-03/msg00134.html Thanks, Jan