public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: Insight Maling List <insight@sources.redhat.com>
Subject: [PATCH] Fix target output in console window
Date: Wed, 02 Jan 2002 15:46:00 -0000	[thread overview]
Message-ID: <Pine.GSO.4.33.0201021542500.9746-100000@makita.cygnus.com> (raw)

Hi,

Turns out that ConsoleWin::einsert is just plain wrong. It inserts text at
the insertion cursor, so it looks like a command. (I.e., if you run a
program which prints "hello" to stdout, pressing return in the console
window will make gdb think you've entered the command "hello". Not quite
what we want.)

To prevent this from happening again, I've whacked ConsoleWin::einsert
entirely. As far as I can tell, it is not used anywhere else.

Please let me know if there are problems.
Keith

ChangeLog
2002-01-02  Keith Seitz  <kseitz@redhat.com>

	* library/console.ith (insert): Add tag parameter.
	(einsert): Delete.
	* library/console.itb: (insert): Add tag parameter.
	(einsert): Delete.
	* library/interface.tcl (gdbtk_tcl_fputs): Use Console::insert.
	(gdbtk_tcl_fputs_error): Likewise.
	(gdbtk_tcl_fputs_log): Likewise.
	(gdbtk_tcl_fputs_target): Likewise.
	(set_target): Likewise.

Patch
Index: library/interface.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/interface.tcl,v
retrieving revision 1.35
diff -u -p -r1.35 interface.tcl
--- library/interface.tcl	2001/12/11 08:55:52	1.35
+++ library/interface.tcl	2002/01/02 23:40:34
@@ -418,7 +418,7 @@ proc echo {args} {
 # ------------------------------------------------------------------
 proc gdbtk_tcl_fputs_error {message} {
   if {$::gdbtk_state(console) != ""} {
-    $::gdbtk_state(console) einsert $message err_tag
+    $::gdbtk_state(console) insert $message err_tag
     update
   }
 }
@@ -428,7 +428,7 @@ proc gdbtk_tcl_fputs_error {message} {
 # ------------------------------------------------------------------
 proc gdbtk_tcl_fputs_log {message} {
   if {$::gdbtk_state(console) != ""} {
-    $::gdbtk_state(console) einsert $message log_tag
+    $::gdbtk_state(console) insert $message log_tag
     update
   }
 }
@@ -438,7 +438,7 @@ proc gdbtk_tcl_fputs_log {message} {
 # ------------------------------------------------------------------
 proc gdbtk_tcl_fputs_target {message} {
   if {$::gdbtk_state(console) != ""} {
-    $::gdbtk_state(console) einsert $message target_tag
+    $::gdbtk_state(console) insert $message target_tag
     update
   }
 }
@@ -1106,7 +1106,7 @@ necessary,\nmodify the port setting with

     if {![catch {pref get gdb/load/$gdb_target_name-after_attaching} aa] && $aa != ""} {
       if {[catch {gdb_cmd $aa} err]} {
-	catch {[ManagedWin::find Console] einsert $err err_tag}
+	catch {[ManagedWin::find Console] insert $err err_tag}
       }
     }
     set gdb_target_changed 0
@@ -1429,7 +1429,7 @@ proc gdbtk_nexti {} {
   catch {gdb_immediate nexti}
 }

-  # ------------------------------------------------------------------
+# ------------------------------------------------------------------
 #  PROC: gdbtk_attached
 # ------------------------------------------------------------------
 #
Index: library/console.ith
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/console.ith,v
retrieving revision 1.6
diff -u -p -r1.6 console.ith
--- library/console.ith	2001/09/28 16:36:50	1.6
+++ library/console.ith	2002/01/02 23:40:34
@@ -26,8 +26,7 @@ class Console {

     method constructor {args}
     method destructor {}
-    method insert {line}
-    method einsert {line tag}
+    method insert {line {tag ""}}
     method invoke {}
     method _insertion {args}
     method get_text {}
Index: library/console.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/console.itb,v
retrieving revision 1.15
diff -u -p -r1.15 console.itb
--- library/console.itb	2001/12/05 17:08:06	1.15
+++ library/console.itb	2002/01/02 23:40:34
@@ -219,13 +219,13 @@ body Console::busy {event} {
 # ------------------------------------------------------------------
 #  METHOD:  insert - insert new text in the text widget
 # ------------------------------------------------------------------
-body Console::insert {line} {
+body Console::insert {line {tag ""}} {
   if {$_needNL} {
     $_twin insert {insert linestart} "\n"
   }
   # Remove all \r characters from line.
   set line [join [split $line \r] {}]
-  $_twin insert {insert -1 line lineend} $line
+  $_twin insert {insert -1 line lineend} $line $tag

   set nlines [lindex [split [$_twin index end] .] 0]
   if {$nlines > $throttle} {
@@ -236,19 +236,6 @@ body Console::insert {line} {
   $_twin see insert
   set _needNL 0
   ::update idletasks
-}
-
-#-------------------------------------------------------------------
-#  METHOD:  einsert - insert error text in the text widget
-# ------------------------------------------------------------------
-body Console::einsert {line tag} {
-  debug $line
-  if {$_needNL} {
-    $_twin insert end "\n"
-  }
-  $_twin insert end $line $tag
-  $_twin see insert
-  set _needNL 0
 }

 # ------------------------------------------------------------------

                 reply	other threads:[~2002-01-02 23:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.33.0201021542500.9746-100000@makita.cygnus.com \
    --to=keiths@redhat.com \
    --cc=insight@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).