Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Eli Zaretskii" <eliz@elta.co.il>
To: gdb-patches@sources.redhat.com
Subject: [RFA] Patch to imported readline to allow DJGPP build
Date: Mon, 29 Dec 2003 08:03:00 -0000	[thread overview]
Message-ID: <7137-Mon29Dec2003100055+0200-eliz@elta.co.il> (raw)

The current imported readline is broken for DJGPP.  The following
patch is needed to allow GDB to build the DJGPP port.  Okay to commit?

Btw, I don't understand what is going on with Readline: I looked at
its official home page (to figure out how to submit the patches below
to the Readline maintainer) and found there an old version 4.3 of
Readline where the DJGPP-specific code is ripped out.  The version
that we have in the GDB repository seems a newer one, but it also has
the DJGPP-specific code in it.  Can someone please tell me what is the
story behind this?  TIA

2003-12-28  Eli Zaretskii  <eliz@elta.co.il>

	* readline.c (rl_save_state, rl_restore_state): Support systems
	that don't define SIGWINCH.

	* terminal.c (_rl_get_screen_size) [__DJGPP__]: Compute the
	screen width and height using console I/O.
	(_rl_init_terminal_io) [__MSDOS__]: Zero out all the _rl_term_*
	variables.  Convert to _rl_* naming scheme.
	(_rl_set_cursor) [__MSDOS__]: Ifdef away this function.

	* display.c (_rl_move_vert) [__MSDOS__]: Don't use undeclared
	variable `l'.  Use `delta' instead recomputing its value anew.
	Assign -delta to i instead of the other way around.

--- readline/readline.c~0	2002-12-08 22:31:36.000000000 +0000
+++ readline/readline.c	2003-12-28 10:33:08.000000000 +0000
@@ -933,7 +933,9 @@ rl_save_state (sp)
   sp->macro = rl_executing_macro;
 
   sp->catchsigs = rl_catch_signals;
+#if defined (SIGWINCH)
   sp->catchsigwinch = rl_catch_sigwinch;
+#endif
 
   return (0);
 }
@@ -967,7 +969,9 @@ rl_restore_state (sp)
   rl_executing_macro = sp->macro;
 
   rl_catch_signals = sp->catchsigs;
+#if defined (SIGWINCH)
   rl_catch_sigwinch = sp->catchsigwinch;
+#endif
 
   return (0);
 }
--- readline/terminal.c~0	2002-12-08 22:31:36.000000000 +0000
+++ readline/terminal.c	2003-12-28 10:34:46.000000000 +0000
@@ -220,7 +220,10 @@ _rl_get_screen_size (tty, ignore_env)
       if (ignore_env == 0 && (ss = sh_get_env_value ("COLUMNS")))
 	_rl_screenwidth = atoi (ss);
 
-#if !defined (__DJGPP__)
+#if defined (__DJGPP__)
+      if (_rl_screenwidth <= 0)
+	_rl_screenwidth = ScreenCols ();
+#else
       if (_rl_screenwidth <= 0 && term_string_buffer)
 	_rl_screenwidth = tgetnum ("co");
 #endif
@@ -233,7 +236,10 @@ _rl_get_screen_size (tty, ignore_env)
       if (ignore_env == 0 && (ss = sh_get_env_value ("LINES")))
 	_rl_screenheight = atoi (ss);
 
-#if !defined (__DJGPP__)
+#if defined (__DJGPP__)
+      if (_rl_screenheight <= 0)
+	_rl_screenheight = ScreenRows ();
+#else
       if (_rl_screenheight <= 0 && term_string_buffer)
 	_rl_screenheight = tgetnum ("li");
 #endif
@@ -382,12 +388,19 @@ _rl_init_terminal_io (terminal_name)
     term = "dumb";
 
 #ifdef __MSDOS__
-  term_im = term_ei = term_ic = term_IC = (char *)NULL;
-  term_up = term_dc = term_DC = visible_bell = (char *)NULL;
-  term_ku = term_kd = term_kl = term_kr = (char *)NULL;
-  term_mm = term_mo = (char *)NULL;
-  terminal_can_insert = term_has_meta = _rl_term_autowrap = 0;
-  term_cr = "\r";
+  _rl_term_im = _rl_term_ei = _rl_term_ic = _rl_term_IC = (char *)NULL;
+  _rl_term_up = _rl_term_dc = _rl_term_DC = _rl_visible_bell = (char *)NULL;
+  _rl_term_ku = _rl_term_kd = _rl_term_kl = _rl_term_kr = (char *)NULL;
+  _rl_term_mm = _rl_term_mo = (char *)NULL;
+  _rl_terminal_can_insert = term_has_meta = _rl_term_autowrap = 0;
+  _rl_term_cr = "\r";
+  _rl_term_clreol = _rl_term_clrpag = _rl_term_backspace = (char *)NULL;
+  _rl_term_goto = _rl_term_pc = _rl_term_ip = (char *)NULL;
+  _rl_term_ks = _rl_term_ke =_rl_term_vs = _rl_term_ve = (char *)NULL;
+  _rl_term_kh = _rl_term_kH = _rl_term_at7 = _rl_term_kI = (char *)NULL;
+#if defined(HACK_TERMCAP_MOTION)
+  _rl_term_forward_char = (char *)NULL;
+#endif
 
   _rl_get_screen_size (tty, 0);
 #else  /* !__MSDOS__ */
@@ -677,6 +690,7 @@ void
 _rl_set_cursor (im, force)
      int im, force;
 {
+#ifndef __MSDOS__
   if (_rl_term_ve && _rl_term_vs)
     {
       if (force || im != rl_insert_mode)
@@ -687,4 +701,5 @@ _rl_set_cursor (im, force)
 	    tputs (_rl_term_ve, 1, _rl_output_character_function);
 	}
     }
+#endif
 }
--- readline/display.c~0	2003-01-11 00:43:52.000000000 +0000
+++ readline/display.c	2003-12-23 18:47:36.000000000 +0000
@@ -1642,10 +1642,10 @@ _rl_move_vert (to)
 #ifdef __MSDOS__
       int row, col;
 
-      l = fflush (rl_outstream); /* make sure the cursor pos is current! */
+      fflush (rl_outstream); /* make sure the cursor pos is current! */
       ScreenGetCursor (&row, &col);
-      ScreenSetCursor ((row + to - _rl_last_v_pos), col);
-      delta = i;
+      ScreenSetCursor (row + delta, col);
+      i = -delta;    /* in case someone wants to use it after the loop */
 #else /* !__MSDOS__ */
       if (_rl_term_up && *_rl_term_up)
 	for (i = 0; i < -delta; i++)


             reply	other threads:[~2003-12-29  8:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-29  8:03 Eli Zaretskii [this message]
2003-12-29 22:32 ` Elena Zannoni
2003-12-30  6:16   ` Eli Zaretskii
2004-01-15 19:03     ` Elena Zannoni
2004-01-17 18:27       ` Eli Zaretskii
2003-12-30  7:26   ` Eli Zaretskii
2003-12-29 19:57 Michael Elizabeth Chastain
2003-12-29 21:48 ` Eli Zaretskii

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=7137-Mon29Dec2003100055+0200-eliz@elta.co.il \
    --to=eliz@elta.co.il \
    --cc=gdb-patches@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