Mail Archives: djgpp-workers/2003/12/29/03:22:27
I've managed to find some time to fix the current GDB (both v6.0 that
was released some time ago and the CVS version available as daily
snapshots from sources.redhat.com). The patches are attached below,
for those who would like to try them out.
Note that if you don't have Autoconf, you will need to patch
gdb/configure with the same change as given below for
gdb/configure.in. Also note that you still need to unpack the tarball
with djunpack.bat as described in gdb/config/djgpp/README, or else the
automated build script might not work. So, to use these patches, you
will need:
. extract djunpack.bat
. invoke djunpack.bat as explained in README
. patch the unpacked files with the patches below
. either run Autoconf or patch gdb/configure
. invoke gdb/config/djgpp/djconfig.sh
. say "make" and watch the fun
If someone does try this, please tell me if you have any trouble.
Good luck!
2003-12-25 Eli Zaretskii <eliz AT elta DOT co DOT il>
* configure.in: Set ac_cv_search_tgetent to "none required" for
"*djgpp*" targets as well.
* config/djgpp/config.sed: Tweak to adapt to the changes in
configury.
2003-12-24 Eli Zaretskii <eliz AT elta DOT co DOT il>
* config/djgpp/djconfig.sh: Fix the test of unpacked
distribution, since there's no gdb.cxx directory anymore.
2003-12-22 Eli Zaretskii <eliz AT elta DOT co DOT il>
* go32-nat.c (go32_sldt, go32_sgdt, go32_sidt, go32_pte): Fix
mismatches between format string and arguments (avoids compiler
warnings).
--- gdb/config/djgpp/config.sed~ 2001-11-25 11:32:50.000000000 +0000
+++ gdb/config/djgpp/config.sed 2003-12-25 10:50:54.000000000 +0000
@@ -3,7 +3,7 @@
/ac_rel_source/s|ln -s|cp -p|
s|\.gdbinit|gdb.ini|g
-/ac_given_INSTALL=/,/^CEOF/ {
+/^ac_given_INSTALL=/,/^CEOF/ {
/^s%@prefix@%/a\
s,\\([yp*]\\)\\.tab,\\1_tab,g\
/^ @rm -f/s,\\$@-\\[0-9\\]\\[0-9\\],& *.i[1-9] *.i[1-9][0-9],\
@@ -12,19 +12,27 @@
s,\\.info\\*,.inf* *.i[1-9] *.i[1-9][0-9],\
s,\\.gdbinit,gdb.ini,g\
/TEXINPUTS=/s,:,';',g\
- /VPATH *=/s,\\([^A-z]\\):,\1;,g\
+ /VPATH *=/s,\\([^A-z]\\):,\\1;,g\
/\\$\\$file-\\[0-9\\]/s,echo,& *.i[1-9] *.i[1-9][0-9],\
/\\$\\$file-\\[0-9\\]/s,rm -f \\$\\$file,& \\${PACKAGE}.i[1-9] \\${PACKAGE}.i[1-9][0-9],\
s,config\\.h\\.in,config.h-in,g\
s,po2tbl\\.sed\\.in,po2tblsed.in,g
+
+}
+
+/^ac_given_srcdir=/,/^CEOF/ {
+ /^s%@TOPLEVEL_CONFIGURE_ARGUMENTS@%/a\
+ /@test ! -f /s,\\(.\\)\$, export am_cv_exeext=.exe; export lt_cv_sys_max_cmd_len=12288; \\1,
+
}
/^CONFIG_FILES=/,/^EOF/ {
- s|po/Makefile.in\([^-:]\)|po/Makefile.in:po/Makefile.in-in\1|
+ s|po/Makefile.in\([^-:a-z]\)|po/Makefile.in:po/Makefile.in-in\1|
}
-/^ *CONFIG_HEADERS=/,/^EOF/ {
- s|config.h\([^-:]\)|config.h:config.h-in\1|
+/^ *# *Handling of arguments/,/^done/ {
+ s| config.h"| config.h:config.h-in"|
+ s|config.h\([^-:"a-z]\)|config.h:config.h-in\1|
}
/^[ ]*\/\*)/s,/\*,/*|[A-z]:/*,
@@ -32,3 +40,4 @@
/\$]\*) ac_rel_source=/s,\[/\$\]\*,&|[A-z]:/*,
/ac_file_inputs=/s,\( -e "s%\^%\$ac_given_srcdir/%"\)\( -e "s%:% $ac_given_srcdir/%g"\),\2\1,
/^[ ]*if test "x`echo /s,sed 's@/,sed -e 's@^[A-z]:@@' -e 's@/,
+/^ *ac_config_headers=/s, config.h", config.h:config.h-in",
--- gdb/config/djgpp/djconfig.s~0 2002-02-25 16:09:44.000000000 +0000
+++ gdb/config/djgpp/djconfig.sh 2003-12-24 11:36:48.000000000 +0000
@@ -5,7 +5,7 @@
# configuring other GNU programs for DJGPP.
#
#=====================================================================
-# Copyright 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright 1997,1999,2000,2001,2002,2003 Free Software Foundation, Inc.
#
# Originally written by Robert Hoehne, revised by Eli Zaretskii.
# This file is part of GDB.
@@ -52,9 +52,21 @@
# Make sure they don't have some file names mangled by untarring.
echo -n "Checking the unpacked distribution..."
if ( ! test -f ${srcdir}/intl/po2tblsed.in || \
- ! test -d ${srcdir}/gdb/testsuite/gdb.cxx || \
+ ! test -f ${srcdir}/gdb/ChangeLog.002 || \
! test -f ${srcdir}/readline/config.h-in ) ; then
+ if ( ! test -f ${srcdir}/intl/po2tblsed.in ) ; then
+ notfound=${srcdir}/intl/po2tblsed.in
+ else
+ if ( ! test -d ${srcdir}/gdb/testsuite/cxx) ; then
+ notfound=${srcdir}/gdb/ChangeLog.002
+ else
+ if ( ! test -f ${srcdir}/readline/config.h-in ) ; then
+ notfound=${srcdir}/readline/config.h-in
+ fi
+ fi
+ fi
echo " FAILED."
+ echo "(File $notfound was not found.)"
echo ""
echo "You MUST unpack the sources with the DJTAR command, like this:"
echo ""
@@ -62,6 +74,7 @@
echo ""
echo "where X.YZ is the GDB version, and fnchange.lst can be found"
echo "in the gdb/config/djgpp/ directory in the GDB distribution."
+ echo ""
echo "configure FAILED!"
exit 1
else
--- gdb/go32-nat.c~0 2003-12-28 14:57:38.000000000 +0000
+++ gdb/go32-nat.c 2003-12-28 11:41:18.000000000 +0000
@@ -1515,7 +1515,7 @@ go32_sldt (char *arg, int from_tty)
if (ldt_entry < 0
|| (ldt_entry & 4) == 0
|| (ldt_entry & 3) != (cpl & 3))
- error ("Invalid LDT entry 0x%03x.", ldt_entry);
+ error ("Invalid LDT entry 0x%03lx.", (unsigned long)ldt_entry);
}
}
@@ -1553,8 +1553,8 @@ go32_sldt (char *arg, int from_tty)
if (ldt_entry >= 0)
{
if (ldt_entry > limit)
- error ("Invalid LDT entry %#x: outside valid limits [0..%#x]",
- ldt_entry, limit);
+ error ("Invalid LDT entry %#lx: outside valid limits [0..%#x]",
+ (unsigned long)ldt_entry, limit);
display_descriptor (ldt_descr.stype, base, ldt_entry / 8, 1);
}
@@ -1584,8 +1584,8 @@ go32_sgdt (char *arg, int from_tty)
{
gdt_entry = parse_and_eval_long (arg);
if (gdt_entry < 0 || (gdt_entry & 7) != 0)
- error ("Invalid GDT entry 0x%03x: not an integral multiple of 8.",
- gdt_entry);
+ error ("Invalid GDT entry 0x%03lx: not an integral multiple of 8.",
+ (unsigned long)gdt_entry);
}
}
@@ -1595,8 +1595,8 @@ go32_sgdt (char *arg, int from_tty)
if (gdt_entry >= 0)
{
if (gdt_entry > gdtr.limit)
- error ("Invalid GDT entry %#x: outside valid limits [0..%#x]",
- gdt_entry, gdtr.limit);
+ error ("Invalid GDT entry %#lx: outside valid limits [0..%#x]",
+ (unsigned long)gdt_entry, gdtr.limit);
display_descriptor (0, gdtr.base, gdt_entry / 8, 1);
}
@@ -1625,7 +1625,7 @@ go32_sidt (char *arg, int from_tty)
{
idt_entry = parse_and_eval_long (arg);
if (idt_entry < 0)
- error ("Invalid (negative) IDT entry %d.", idt_entry);
+ error ("Invalid (negative) IDT entry %ld.", idt_entry);
}
}
@@ -1637,8 +1637,8 @@ go32_sidt (char *arg, int from_tty)
if (idt_entry >= 0)
{
if (idt_entry > idtr.limit)
- error ("Invalid IDT entry %#x: outside valid limits [0..%#x]",
- idt_entry, idtr.limit);
+ error ("Invalid IDT entry %#lx: outside valid limits [0..%#x]",
+ (unsigned long)idt_entry, idtr.limit);
display_descriptor (1, idtr.base, idt_entry, 1);
}
@@ -1834,7 +1834,7 @@ display_page_table (long n, int force)
static void
go32_pte (char *arg, int from_tty)
{
- long pde_idx = -1, i;
+ long pde_idx = -1L, i;
if (arg && *arg)
{
@@ -1845,7 +1845,7 @@ go32_pte (char *arg, int from_tty)
{
pde_idx = parse_and_eval_long (arg);
if (pde_idx < 0 || pde_idx >= 1024)
- error ("Entry %d is outside valid limits [0..1023].", pde_idx);
+ error ("Entry %ld is outside valid limits [0..1023].", pde_idx);
}
}
--- gdb/configure.i~0 2003-06-08 18:27:12.000000000 +0000
+++ gdb/configure.in 2003-12-25 13:40:14.000000000 +0000
@@ -290,8 +290,7 @@
LIBS="../libtermcap/libtermcap.a $LIBS"
ac_cv_search_tgetent="../libtermcap/libtermcap.a"
fi ;;
- go32*)
- # ??? Is this really true?
+ go32* | *djgpp*)
ac_cv_search_tgetent="none required"
;;
aix*)
2003-12-28 Eli Zaretskii <eliz AT elta DOT co DOT il>
* readline.c (rl_save_state, rl_restore_state): Support systems
that don't define SIGWINCH.
2003-12-25 Eli Zaretskii <eliz AT elta DOT co DOT il>
* 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.
2003-12-23 Eli Zaretskii <eliz AT elta DOT co DOT il>
* 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++)
- Raw text -