public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [RFA] readline cleanup
@ 2002-03-06 22:32 Martin M. Hunt
  2002-03-07 10:42 ` Keith Seitz
  0 siblings, 1 reply; 4+ messages in thread
From: Martin M. Hunt @ 2002-03-06 22:32 UTC (permalink / raw)
  To: Insight Mailing List

In interface.tcl, the gdbtk readline stuff was trying to call non-existent functions. 
 I replaced them with something reasonable.

gdb_run_readline_command() is not used. It looks like it MIGHT be useful, 
but I don't know what for.  Anyone know?

-- 
Martin Hunt
GDB Engineer
Red Hat, Inc.

2002-03-06  Martin M. Hunt  <hunt@redhat.com>

	* library/interface.tcl (gdbtk_tcl_readline): Remove
	call to "command::insert" and instead insert the command
	into the console window.
	(gdbtk_tcl_readline_end): Catch the unsets and do not call
	non-existent function command::end_multi_line_input.


Index: library/interface.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/interface.tcl,v
retrieving revision 1.41
diff -u -p -r1.41 interface.tcl
--- interface.tcl	2002/02/18 17:19:44	1.41
+++ interface.tcl	2002/03/07 06:28:37
@@ -512,7 +512,7 @@ proc gdbtk_tcl_trace_find_hook {arg from
 # ------------------------------------------------------------------
 proc gdb_run_readline_command {command args} {
   global gdbtk_state
-#  debug "$command $args"
+  debug "$command $args"
   set gdbtk_state(readlineArgs) $args
   set gdbtk_state(readlineShowUser) 1
   gdb_cmd $command
@@ -524,7 +524,7 @@ proc gdb_run_readline_command {command a
 # ------------------------------------------------------------------
 proc gdb_run_readline_command_no_output {command args} {
   global gdbtk_state
-#  debug "$command $args"
+  debug "$command $args"
   set gdbtk_state(readlineArgs) $args
   set gdbtk_state(readlineShowUser) 0
   gdb_cmd $command
@@ -535,7 +535,7 @@ proc gdb_run_readline_command_no_output 
 # ------------------------------------------------------------------
 proc gdbtk_tcl_readline_begin {message} {
   global gdbtk_state
-#  debug "readline begin"
+#  debug
   set gdbtk_state(readline) 0
   if {$gdbtk_state(console) != "" && $gdbtk_state(readlineShowUser)} {
     $gdbtk_state(console) insert $message
@@ -547,12 +547,12 @@ proc gdbtk_tcl_readline_begin {message} 
 # ------------------------------------------------------------------
 proc gdbtk_tcl_readline {prompt} {
   global gdbtk_state
-#  debug "$prompt"
+#  debug "prompt=$prompt"
   if {[info exists gdbtk_state(readlineArgs)]} {
     # Not interactive, so pop the list, and print element.
     set cmd [lvarpop gdbtk_state(readlineArgs)]
-    if {$gdbtk_state(readlineShowUser)} {
-      command::insert_command $cmd
+    if {$gdbtk_state(console) != "" && $gdbtk_state(readlineShowUser)} {
+      $gdbtk_state(console) insert $cmd
     }
   } else {
     # Interactive.
@@ -573,10 +573,9 @@ proc gdbtk_tcl_readline {prompt} {
 # ------------------------------------------------------------------
 proc gdbtk_tcl_readline_end {} {
   global gdbtk_state
-#  debug "readline_end"
+#  debug
   catch {unset gdbtk_state(readlineArgs)}
-  unset gdbtk_state(readlineActive)
-  command::end_multi_line_input
+  catch {unset gdbtk_state(readlineActive)}
 }
 
 # ------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA] readline cleanup
  2002-03-06 22:32 [RFA] readline cleanup Martin M. Hunt
@ 2002-03-07 10:42 ` Keith Seitz
  2002-03-07 11:40   ` Tom Tromey
  2002-03-07 12:25   ` Martin M. Hunt
  0 siblings, 2 replies; 4+ messages in thread
From: Keith Seitz @ 2002-03-07 10:42 UTC (permalink / raw)
  To: Martin M. Hunt; +Cc: Insight Mailing List

On Wed, 6 Mar 2002, Martin M. Hunt wrote:

> In interface.tcl, the gdbtk readline stuff was trying to call non-existent functions.
>  I replaced them with something reasonable.
>
> gdb_run_readline_command() is not used. It looks like it MIGHT be useful,
> but I don't know what for.  Anyone know?

I'd really like to know how all this keeps getting broken. I know that I
fixed this myself not too long ago (year or two).

Any way, yes, please commit. Do you think you could try adding a testcase
for this somewhere?

Thanks,
Keith

> 2002-03-06  Martin M. Hunt  <hunt@redhat.com>
>
> 	* library/interface.tcl (gdbtk_tcl_readline): Remove
> 	call to "command::insert" and instead insert the command
> 	into the console window.
> 	(gdbtk_tcl_readline_end): Catch the unsets and do not call
> 	non-existent function command::end_multi_line_input.
>
>
> Index: library/interface.tcl
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbtk/library/interface.tcl,v
> retrieving revision 1.41
> diff -u -p -r1.41 interface.tcl
> --- interface.tcl	2002/02/18 17:19:44	1.41
> +++ interface.tcl	2002/03/07 06:28:37
> @@ -512,7 +512,7 @@ proc gdbtk_tcl_trace_find_hook {arg from
>  # ------------------------------------------------------------------
>  proc gdb_run_readline_command {command args} {
>    global gdbtk_state
> -#  debug "$command $args"
> +  debug "$command $args"
>    set gdbtk_state(readlineArgs) $args
>    set gdbtk_state(readlineShowUser) 1
>    gdb_cmd $command
> @@ -524,7 +524,7 @@ proc gdb_run_readline_command {command a
>  # ------------------------------------------------------------------
>  proc gdb_run_readline_command_no_output {command args} {
>    global gdbtk_state
> -#  debug "$command $args"
> +  debug "$command $args"
>    set gdbtk_state(readlineArgs) $args
>    set gdbtk_state(readlineShowUser) 0
>    gdb_cmd $command
> @@ -535,7 +535,7 @@ proc gdb_run_readline_command_no_output
>  # ------------------------------------------------------------------
>  proc gdbtk_tcl_readline_begin {message} {
>    global gdbtk_state
> -#  debug "readline begin"
> +#  debug
>    set gdbtk_state(readline) 0
>    if {$gdbtk_state(console) != "" && $gdbtk_state(readlineShowUser)} {
>      $gdbtk_state(console) insert $message
> @@ -547,12 +547,12 @@ proc gdbtk_tcl_readline_begin {message}
>  # ------------------------------------------------------------------
>  proc gdbtk_tcl_readline {prompt} {
>    global gdbtk_state
> -#  debug "$prompt"
> +#  debug "prompt=$prompt"
>    if {[info exists gdbtk_state(readlineArgs)]} {
>      # Not interactive, so pop the list, and print element.
>      set cmd [lvarpop gdbtk_state(readlineArgs)]
> -    if {$gdbtk_state(readlineShowUser)} {
> -      command::insert_command $cmd
> +    if {$gdbtk_state(console) != "" && $gdbtk_state(readlineShowUser)} {
> +      $gdbtk_state(console) insert $cmd
>      }
>    } else {
>      # Interactive.
> @@ -573,10 +573,9 @@ proc gdbtk_tcl_readline {prompt} {
>  # ------------------------------------------------------------------
>  proc gdbtk_tcl_readline_end {} {
>    global gdbtk_state
> -#  debug "readline_end"
> +#  debug
>    catch {unset gdbtk_state(readlineArgs)}
> -  unset gdbtk_state(readlineActive)
> -  command::end_multi_line_input
> +  catch {unset gdbtk_state(readlineActive)}
>  }
>
>  # ------------------------------------------------------------------
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA] readline cleanup
  2002-03-07 10:42 ` Keith Seitz
@ 2002-03-07 11:40   ` Tom Tromey
  2002-03-07 12:25   ` Martin M. Hunt
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2002-03-07 11:40 UTC (permalink / raw)
  To: Keith Seitz; +Cc: Martin M. Hunt, Insight Mailing List

>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:

Keith> I'd really like to know how all this keeps getting broken. I
Keith> know that I fixed this myself not too long ago (year or two).

That's funny, since I thought I did this too.
This is zombie code that rises from the grave occasionally.
"Send more paramedics".

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA] readline cleanup
  2002-03-07 10:42 ` Keith Seitz
  2002-03-07 11:40   ` Tom Tromey
@ 2002-03-07 12:25   ` Martin M. Hunt
  1 sibling, 0 replies; 4+ messages in thread
From: Martin M. Hunt @ 2002-03-07 12:25 UTC (permalink / raw)
  To: Keith Seitz; +Cc: Insight Mailing List

Checked in.

On Thursday 07 March 2002 10:41 am, Keith Seitz wrote:
> On Wed, 6 Mar 2002, Martin M. Hunt wrote:
> > In interface.tcl, the gdbtk readline stuff was trying to call
> > non-existent functions. I replaced them with something reasonable.
> >
> > gdb_run_readline_command() is not used. It looks like it MIGHT be useful,
> > but I don't know what for.  Anyone know?
>
> I'd really like to know how all this keeps getting broken. I know that I
> fixed this myself not too long ago (year or two).
>
> Any way, yes, please commit. Do you think you could try adding a testcase
> for this somewhere?
>
> Thanks,
> Keith
>
> > 2002-03-06  Martin M. Hunt  <hunt@redhat.com>
> >
> > 	* library/interface.tcl (gdbtk_tcl_readline): Remove
> > 	call to "command::insert" and instead insert the command
> > 	into the console window.
> > 	(gdbtk_tcl_readline_end): Catch the unsets and do not call
> > 	non-existent function command::end_multi_line_input.
> >
> >
> > Index: library/interface.tcl
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/gdbtk/library/interface.tcl,v
> > retrieving revision 1.41
> > diff -u -p -r1.41 interface.tcl
> > --- interface.tcl	2002/02/18 17:19:44	1.41
> > +++ interface.tcl	2002/03/07 06:28:37
> > @@ -512,7 +512,7 @@ proc gdbtk_tcl_trace_find_hook {arg from
> >  # ------------------------------------------------------------------
> >  proc gdb_run_readline_command {command args} {
> >    global gdbtk_state
> > -#  debug "$command $args"
> > +  debug "$command $args"
> >    set gdbtk_state(readlineArgs) $args
> >    set gdbtk_state(readlineShowUser) 1
> >    gdb_cmd $command
> > @@ -524,7 +524,7 @@ proc gdb_run_readline_command {command a
> >  # ------------------------------------------------------------------
> >  proc gdb_run_readline_command_no_output {command args} {
> >    global gdbtk_state
> > -#  debug "$command $args"
> > +  debug "$command $args"
> >    set gdbtk_state(readlineArgs) $args
> >    set gdbtk_state(readlineShowUser) 0
> >    gdb_cmd $command
> > @@ -535,7 +535,7 @@ proc gdb_run_readline_command_no_output
> >  # ------------------------------------------------------------------
> >  proc gdbtk_tcl_readline_begin {message} {
> >    global gdbtk_state
> > -#  debug "readline begin"
> > +#  debug
> >    set gdbtk_state(readline) 0
> >    if {$gdbtk_state(console) != "" && $gdbtk_state(readlineShowUser)} {
> >      $gdbtk_state(console) insert $message
> > @@ -547,12 +547,12 @@ proc gdbtk_tcl_readline_begin {message}
> >  # ------------------------------------------------------------------
> >  proc gdbtk_tcl_readline {prompt} {
> >    global gdbtk_state
> > -#  debug "$prompt"
> > +#  debug "prompt=$prompt"
> >    if {[info exists gdbtk_state(readlineArgs)]} {
> >      # Not interactive, so pop the list, and print element.
> >      set cmd [lvarpop gdbtk_state(readlineArgs)]
> > -    if {$gdbtk_state(readlineShowUser)} {
> > -      command::insert_command $cmd
> > +    if {$gdbtk_state(console) != "" && $gdbtk_state(readlineShowUser)} {
> > +      $gdbtk_state(console) insert $cmd
> >      }
> >    } else {
> >      # Interactive.
> > @@ -573,10 +573,9 @@ proc gdbtk_tcl_readline {prompt} {
> >  # ------------------------------------------------------------------
> >  proc gdbtk_tcl_readline_end {} {
> >    global gdbtk_state
> > -#  debug "readline_end"
> > +#  debug
> >    catch {unset gdbtk_state(readlineArgs)}
> > -  unset gdbtk_state(readlineActive)
> > -  command::end_multi_line_input
> > +  catch {unset gdbtk_state(readlineActive)}
> >  }
> >
> >  # ------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-03-07 20:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-06 22:32 [RFA] readline cleanup Martin M. Hunt
2002-03-07 10:42 ` Keith Seitz
2002-03-07 11:40   ` Tom Tromey
2002-03-07 12:25   ` Martin M. Hunt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).