From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29400 invoked by alias); 11 Dec 2002 23:28:15 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 29393 invoked from network); 11 Dec 2002 23:28:15 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 11 Dec 2002 23:28:15 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id gBBN2XP23269 for ; Wed, 11 Dec 2002 18:02:33 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gBBNS5s12956; Wed, 11 Dec 2002 18:28:10 -0500 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id gBBNRx707246; Wed, 11 Dec 2002 15:27:59 -0800 Message-ID: <3DF7C9FF.63429C4D@redhat.com> Date: Wed, 11 Dec 2002 15:38:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Per Bothner CC: gdb-patches@sources.redhat.com Subject: Re: gdb patch to suppress empty lines, re-visited References: <3DF6CDC2.5050105@bothner.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-12/txt/msg00384.txt.bz2 Per Bothner wrote: > > This is a revision of a patch originally from 1999: > http://sources.redhat.com/ml/gdb-patches/1999-q2/msg00093.html > > I'm not sure if the patch in top.c does anything, since I don't > know when/if readline is called from command_line_input. > > OK to check in? With or without the top.c change? > -- > --Per Bothner For posterity, this changes the console output when you are repeating a command a bunch of times by hitting return. It changes, eg. 1038 : call 0x138818 (gdb) 0xe103c : st %i1, [ %fp + 0x48 ] (gdb) 0xe1040 : st %o0, [ %fp + -464 ] (gdb) to (gdb) x/i $pc 0xe1038 : call 0x138818 0xe103c : st %i1, [ %fp + 0x48 ] 0xe1040 : st %o0, [ %fp + -464 ] (gdb) Per, I think the first discussion needs to be, do we agree that we want this change? This changes visible behavior, quite broadly. Michael > per@bothner.com http://www.bothner.com/per/ > > ------------------------------------------------------------------------------- > Index: top.c > =================================================================== > RCS file: /cvs/src/src/gdb/top.c,v > retrieving revision 1.68 > diff -u -p -r1.68 top.c > --- top.c 26 Sep 2002 17:46:04 -0000 1.68 > +++ top.c 7 Dec 2002 06:21:11 -0000 > @@ -1211,7 +1211,12 @@ command_line_input (char *prompt_arg, in > } > else if (command_editing_p && instream == stdin && ISATTY (instream)) > { > + int can_repeat = repeat && *line != NULL; > + if (can_repeat) > + rl_erase_empty_line++; > rl = gdb_readline_wrapper (local_prompt); > + if (can_repeat) > + rl_erase_empty_line--; > } > else > { > Index: event-top.c > =================================================================== > RCS file: /cvs/src/src/gdb/event-top.c,v > retrieving revision 1.24 > diff -u -p -r1.24 event-top.c > --- event-top.c 5 Nov 2002 22:38:11 -0000 1.24 > +++ event-top.c 7 Dec 2002 06:21:12 -0000 > @@ -191,6 +191,7 @@ cli_command_loop (void) > strcpy (a_prompt, PREFIX (0)); > strcat (a_prompt, gdb_prompt); > strcat (a_prompt, SUFFIX (0)); > + rl_erase_empty_line = *line != NULL; > rl_callback_handler_install (a_prompt, input_handler); > } > else > @@ -296,6 +297,7 @@ display_gdb_prompt (char *new_prompt) > if (async_command_editing_p) > { > rl_callback_handler_remove (); > + rl_erase_empty_line = *line != NULL; > rl_callback_handler_install (new_prompt, input_handler); > } > /* new_prompt at this point can be the top of the stack or the one passed in */