From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20001 invoked by alias); 14 Mar 2013 01:46:54 -0000 Received: (qmail 19991 invoked by uid 22791); 14 Mar 2013 01:46:52 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_CP X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Mar 2013 01:46:46 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UFxFk-0004Ak-6q from Hui_Zhu@mentor.com ; Wed, 13 Mar 2013 18:46:44 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 13 Mar 2013 18:46:43 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Wed, 13 Mar 2013 18:46:41 -0700 Message-ID: <51412BF7.70405@mentor.com> Date: Thu, 14 Mar 2013 01:46:00 -0000 From: Hui Zhu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20130126 Thunderbird/19.0 MIME-Version: 1.0 To: Jan Kratochvil , Pedro Alves CC: Hui Zhu , gdb-patches ml , Joel Brobecker Subject: Re: [patch+7.6] [TUI] Fix scrolling missing '>' 7.6 regression [Re: [PATCH] Fix gdb crash with tui] References: <513F7592.2080902@redhat.com> <20130313185507.GB18563@host2.jankratochvil.net> In-Reply-To: <20130313185507.GB18563@host2.jankratochvil.net> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit 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/msg00614.txt.bz2 Hi Jan, After patch this patch. My issue is fixed. Thanks. Best, Hui On 03/14/13 02:55, Jan Kratochvil wrote: > On Tue, 12 Mar 2013 19:36:02 +0100, Pedro Alves wrote: >> Just doing any of these does fix the issue with the highlighted >> current line disappearing, so there's something else that needs >> fixing in addition. > > That is the second patch for a regression by me. > > #0 __memset_sse2 () at ../sysdeps/x86_64/memset.S:360 > #1 in freehook (ptr=0x3a61ba0, caller=0x879de9 ) at mcheck.c:193 > #2 in xfree (ptr=0x3a61ba0) at ./common/common-utils.c:108 > #3 in find_and_open_source (filename=0x23c2010 "gdb.c", dirname=0x289cec0 "/home/jkratoch/redhat/gdb-clean/gdb", fullname=0x289cde0) at source.c:1008 > #4 in open_source_file (s=0x289cd80) at source.c:1088 > #5 in tui_set_source_content (s=0x289cd80, line_no=16, noerror=0) at ./tui/tui-source.c:61 > #6 in tui_update_source_window_as_is (win_info=0x3a51a80, gdbarch=0x22d0000, s=0x289cd80, line_or_addr=..., noerror=0) at ./tui/tui-winsource.c:99 > #7 in tui_show_symtab_source (gdbarch=0x22d0000, s=0x289cd80, line=..., noerror=0) at ./tui/tui-source.c:339 > #8 in tui_update_source_windows_with_line (s=0x289cd80, line=16) at ./tui/tui-winsource.c:201 > #9 in tui_show_source (fullname=0x3a61ba0 "\225\225\225\225\225\225\225\225ratoch/redhat/gdb-clean/gdb/gdb.c", line=16) at ./tui/tui.c:542 > #10 in tui_field_string (uiout=0x2296dc0, fldno=3, width=0, align=ui_noalign, fldname=0xfa09d9 "fullname", string=0x3a61ba0 "\225\225\225\225\225\225\225\225ratoch/redhat/gdb-clean/gdb/gdb.c") at ./tui/tui-out.c:92 > #11 in uo_field_string (uiout=0x2296dc0, fldno=3, width=0, align=ui_noalign, fldname=0xfa09d9 "fullname", string=0x3a61ba0 "\225\225\225\225\225\225\225\225ratoch/redhat/gdb-clean/gdb/gdb.c") at ui-out.c:854 > #12 in ui_out_field_string (uiout=0x2296dc0, fldname=0xfa09d9 "fullname", string=0x3a61ba0 "\225\225\225\225\225\225\225\225ratoch/redhat/gdb-clean/gdb/gdb.c") at ui-out.c:544 > #13 in print_source_lines_base (s=0x289cd80, line=16, stopline=17, flags=PRINT_SOURCE_LINES_NOERROR) at source.c:1357 > #14 in print_source_lines (s=0x289cd80, line=16, stopline=17, flags=(unknown: 0)) at source.c:1442 > #15 in tui_vertical_source_scroll (scroll_direction=BACKWARD_SCROLL, num_to_scroll=1) at ./tui/tui-source.c:393 > #16 in tui_scroll_backward (win_to_scroll=0x3a51a80, num_to_scroll=1) at ./tui/tui-win.c:538 > #17 in tui_dispatch_ctrl_char (ch=259) at ./tui/tui-command.c:118 > #18 in tui_getc (fp=0x7ffff663b660 <_IO_2_1_stdin_>) at ./tui/tui-io.c:692 > #19 in rl_read_key () at input.c:448 > > > I did not expect this may happen... > > No regressions on {x86_64,x86_64-m32,i686}-fedora19pre-linux-gnu but it does > not say much for TUI. > > > Thanks, > Jan > > > 2013-03-13 Jan Kratochvil > > * source.c (print_source_lines_base): Make a local copy of > symtab_to_fullname. > > diff --git a/gdb/source.c b/gdb/source.c > index 828d953..201e848 100644 > --- a/gdb/source.c > +++ b/gdb/source.c > @@ -1355,11 +1355,17 @@ print_source_lines_base (struct symtab *s, int line, int stopline, > symtab_to_filename_for_display (s)); > if (ui_out_is_mi_like_p (uiout) > || !ui_out_test_flags (uiout, ui_source_list)) > - { > - const char *fullname = symtab_to_fullname (s); > + { > + const char *s_fullname = symtab_to_fullname (s); > + char *local_fullname; > > - ui_out_field_string (uiout, "fullname", fullname); > - } > + /* ui_out_field_string may free S_FULLNAME by calling > + open_source_file for it again. */ > + local_fullname = alloca (strlen (s_fullname) + 1); > + strcpy (local_fullname, s_fullname); > + > + ui_out_field_string (uiout, "fullname", local_fullname); > + } > > ui_out_text (uiout, "\n"); > } >