summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Molenda <jsm@bugshack.cygnus.com>1999-08-02 23:48:37 +0000
committerJason Molenda <jsm@bugshack.cygnus.com>1999-08-02 23:48:37 +0000
commit6da787a878c938e680f13808dee254beacefbd43 (patch)
tree7c7b4d4f6655b210e33ca51f656f4552c9326ed3
parent1392c9fbbf6fe8811e5374356b7fdf3b389068ab (diff)
downloadgdb-6da787a878c938e680f13808dee254beacefbd43.tar.gz
import gdb-1999-08-02 snapshot
-rw-r--r--gdb/ChangeLog126
-rw-r--r--gdb/Makefile.in2
-rw-r--r--gdb/buildsym.c2
-rw-r--r--gdb/buildsym.h2
-rw-r--r--gdb/config/i386/tm-linux.h72
-rw-r--r--gdb/config/mips/tm-mips.h2
-rw-r--r--gdb/config/pa/nm-hppah.h12
-rw-r--r--gdb/dbxread.c4
-rw-r--r--gdb/dwarf2read.c2
-rw-r--r--gdb/dwarfread.c3
-rw-r--r--gdb/event-top.c3
-rw-r--r--gdb/hp-psymtab-read.c2
-rw-r--r--gdb/hppa-tdep.c41
-rw-r--r--gdb/hppah-nat.c2
-rw-r--r--gdb/i386-tdep.c134
-rw-r--r--gdb/infrun.c114
-rw-r--r--gdb/infttrace.c20
-rw-r--r--gdb/monitor.c40
-rw-r--r--gdb/os9kread.c4
-rw-r--r--gdb/stabsread.c26
-rw-r--r--gdb/symfile.c4
-rw-r--r--gdb/symtab.c16
-rw-r--r--gdb/testsuite/ChangeLog100
-rw-r--r--gdb/testsuite/gdb.base/Makefile.in22
-rw-r--r--gdb/testsuite/gdb.base/annota1.exp6
-rw-r--r--gdb/testsuite/gdb.base/attach.exp6
-rw-r--r--gdb/testsuite/gdb.base/call-ar-st.exp13
-rw-r--r--gdb/testsuite/gdb.base/callfuncs.exp55
-rw-r--r--gdb/testsuite/gdb.base/callfwmall.exp54
-rw-r--r--gdb/testsuite/gdb.base/completion.exp18
-rw-r--r--gdb/testsuite/gdb.base/condbreak.exp3
-rw-r--r--gdb/testsuite/gdb.base/corefile.exp3
-rw-r--r--gdb/testsuite/gdb.base/display.exp60
-rw-r--r--gdb/testsuite/gdb.base/ending-run.exp22
-rw-r--r--gdb/testsuite/gdb.base/foll-exec.exp2
-rw-r--r--gdb/testsuite/gdb.base/foll-vfork.exp22
-rw-r--r--gdb/testsuite/gdb.base/gdbvars.exp2
-rw-r--r--gdb/testsuite/gdb.base/interrupt.exp2
-rw-r--r--gdb/testsuite/gdb.base/list.exp43
-rw-r--r--gdb/testsuite/gdb.base/long_long.exp156
-rw-r--r--gdb/testsuite/gdb.base/maint.exp55
-rw-r--r--gdb/testsuite/gdb.base/pointers.c1
-rw-r--r--gdb/testsuite/gdb.base/pointers.exp2
-rw-r--r--gdb/testsuite/gdb.base/printcmds.exp26
-rw-r--r--gdb/testsuite/gdb.base/ptype.exp3
-rw-r--r--gdb/testsuite/gdb.base/scope.exp9
-rw-r--r--gdb/testsuite/gdb.base/setvar.exp4
-rw-r--r--gdb/testsuite/gdb.base/signals.exp4
-rw-r--r--gdb/testsuite/gdb.base/structs.c52
-rw-r--r--gdb/testsuite/gdb.base/structs.exp6
-rw-r--r--gdb/testsuite/gdb.base/structs2.exp2
-rw-r--r--gdb/testsuite/gdb.base/watchpoint.exp10
-rw-r--r--gdb/testsuite/gdb.base/whatis.exp9
-rw-r--r--gdb/testsuite/gdb.c++/Makefile.in17
-rw-r--r--gdb/testsuite/gdb.c++/annota2.exp13
-rw-r--r--gdb/testsuite/gdb.c++/anon-union.cc23
-rw-r--r--gdb/testsuite/gdb.c++/anon-union.exp54
-rw-r--r--gdb/testsuite/gdb.c++/classes.exp46
-rw-r--r--gdb/testsuite/gdb.c++/cplusfuncs.cc6
-rw-r--r--gdb/testsuite/gdb.c++/cplusfuncs.exp25
-rw-r--r--gdb/testsuite/gdb.c++/demangle.exp4
-rw-r--r--gdb/testsuite/gdb.c++/derivation.exp5
-rw-r--r--gdb/testsuite/gdb.c++/inherit.exp254
-rw-r--r--gdb/testsuite/gdb.c++/local.exp57
-rw-r--r--gdb/testsuite/gdb.c++/member-ptr.exp35
-rw-r--r--gdb/testsuite/gdb.c++/method.exp19
-rw-r--r--gdb/testsuite/gdb.c++/misc.cc13
-rw-r--r--gdb/testsuite/gdb.c++/misc.exp55
-rw-r--r--gdb/testsuite/gdb.c++/overload.exp50
-rw-r--r--gdb/testsuite/gdb.c++/ref-types.cc51
-rw-r--r--gdb/testsuite/gdb.c++/ref-types.exp411
-rw-r--r--gdb/testsuite/gdb.c++/templates.cc4
-rw-r--r--gdb/testsuite/gdb.c++/templates.exp246
-rw-r--r--gdb/testsuite/gdb.c++/userdef.exp31
-rw-r--r--gdb/testsuite/gdb.c++/virtfunc.cc4
-rw-r--r--gdb/testsuite/gdb.c++/virtfunc.exp150
-rw-r--r--gdb/testsuite/lib/gdb.exp76
-rw-r--r--gdb/top.c34
-rw-r--r--gdb/xcoffread.c4
-rw-r--r--readline/CHANGELOG139
-rw-r--r--readline/CHANGES131
-rw-r--r--readline/MANIFEST18
-rw-r--r--readline/Makefile.in267
-rw-r--r--readline/README111
-rw-r--r--readline/aclocal.m4167
-rw-r--r--readline/bind.c62
-rw-r--r--readline/callback.c2
-rw-r--r--readline/complete.c219
-rwxr-xr-xreadline/configure366
-rw-r--r--readline/configure.in42
-rw-r--r--readline/display.c118
-rw-r--r--readline/doc/Makefile.in25
-rw-r--r--readline/doc/hist.texinfo19
-rw-r--r--readline/doc/hsuser.texinfo4
-rw-r--r--readline/doc/readline.0514
-rw-r--r--readline/doc/readline.343
-rw-r--r--readline/doc/rlman.texinfo19
-rw-r--r--readline/doc/rltech.texinfo163
-rw-r--r--readline/doc/rluser.texinfo50
-rwxr-xr-xreadline/doc/texi2dvi467
-rwxr-xr-xreadline/doc/texi2html144
-rw-r--r--readline/examples/Makefile.in13
-rw-r--r--readline/examples/rl.c3
-rw-r--r--readline/funmap.c2
-rw-r--r--readline/histexpand.c22
-rw-r--r--readline/histfile.c12
-rw-r--r--readline/histlib.h1
-rw-r--r--readline/history.c2
-rw-r--r--readline/history.h91
-rw-r--r--readline/input.c66
-rw-r--r--readline/isearch.c32
-rw-r--r--readline/keymaps.c2
-rw-r--r--readline/keymaps.h21
-rw-r--r--readline/kill.c13
-rw-r--r--readline/posixjmp.h10
-rw-r--r--readline/readline.c85
-rw-r--r--readline/readline.h471
-rw-r--r--readline/rlconf.h4
-rw-r--r--readline/rltty.c11
-rw-r--r--readline/search.c5
-rw-r--r--readline/shell.c45
-rw-r--r--readline/signals.c247
-rwxr-xr-xreadline/support/config.guess26
-rwxr-xr-xreadline/support/config.sub71
-rwxr-xr-xreadline/support/mkdist2
-rw-r--r--readline/terminal.c10
-rw-r--r--readline/tilde.c42
-rw-r--r--readline/util.c3
-rw-r--r--readline/vi_mode.c40
-rw-r--r--sim/mips/ChangeLog6
-rw-r--r--sim/mips/interp.c56
131 files changed, 5328 insertions, 2268 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8b16fcd6ce5..21950fb5e09 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,124 @@
+1999-08-01 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * config/mips/tm-mips.h (BIG_ENDIAN): Don't define here.
+
+1999-08-01 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * stabsread.c (read_range_type): Handle an unsigned range type
+ whose length in bytes is any power of two, not just a few
+ common ones.
+
+ * monitor.c (monitor_expect): When we receive a character that
+ isn't part of the string we were expecting, don't just start
+ matching again at the beginning of the string --- some shorter
+ suffix of the input might be a prefix of the string too.
+
+1999-07-31 Fred Fish <fnf@cygnus.com>
+
+ * symfile.c (symbol_file_command): Fix typo that made -1 casted
+ to a CORE_ADDR look like an subtraction expression.
+ (add_symbol_file_command): Ditto.
+
+1999-07-30 Jim Blandy <jimb@cris.red-bean.com>
+
+ * hppa-tdep.c (pa_print_registers): Frob register output some more.
+
+1999-07-29 Jim Blandy <jimb@cris.red-bean.com>
+
+ * config/pa/nm-hppah.h (PTRACE_ARG3_TYPE): After more
+ consideration, make this a CORE_ADDR, like WDB did.
+
+ Rather than casting every single use of really_free_pendings to
+ make_cleanup_func, why not actually make it have that type? Golly!
+ * buildsym.c (really_free_pendings): Change argument type to PTR.
+ buildsym.h (really_free_pendings): Fix declaration.
+ * dbxread.c (dbx_symfile_read, dbx_psymtab_to_symtab_1),
+ dwarf2read.c (psymtab_to_symtab_1), dwarfread
+ (psymtab_to_symtab_1), hp-psymtab-read.c (hpread_build_psymtabs),
+ os9kread.c (os9k_symfile_read, os9k_psymtab_to_symtab_1),
+ xcoffread.c (xcoff_psymtab_to_symtab_1, xcoff_initial_scan):
+ Remove casts.
+
+ Pass a CORE_ADDR safely through catch_errors.
+ * hppa-tdep.c (args_for_find_stub): New member, return_val.
+ (cover_find_stub_with_shl_get): Change argument and return type to
+ match catch_errors. Save return value of find_stub_with_shl_get
+ in *args.
+ (initialize_hp_cxx_exception_support): Collect value of
+ eh_notify_callback_addr from args.
+
+ Get rid of some noise. It would be nice to get helpful warnings
+ from the compiler about lossy conversions.
+ * hppa-tdep.c (eh_notify_hook_addr, eh_notify_callback_addr,
+ eh_break_addr, eh_catch_catch_addr, eh_catch_throw_addr,
+ break_callback_sal): Initialize these to zero, not NULL, to shush
+ warnings.
+ * infttrace.c (thread_fake_step): Compare signal to
+ TARGET_SIGNAL_0, not NULL, to avoid warnings.
+ (_initialize_infttrace): Add sanity check.
+
+ * config/pa/nm-hppah.h (PTRACE_ARG3_TYPE): Define this to be
+ long, so we can pass arguments properly to ptrace.
+
+ * hppah-nat.c (child_xfer_memory): Correctly compute mask to round
+ address to an int boundary.
+
+1999-07-29 Jim Blandy <jimb@savonarola.red-bean.com>
+
+ Change from Ian Lance Taylor <ian@zembu.com>. The
+ i386_linux_sigtramp* functions should be moved to
+ i386-linux-tdep.c, when that file is introduced.
+
+ * config/i386/tm-linux.h (LINUX_SIGCONTEXT_SIZE): Define.
+ (LINUX_SIGCONTEXT_PC_OFFSET): Define.
+ (LINUX_SIGCONTEXT_SP_OFFSET): Define.
+ (SIGCONTEXT_PC_OFFSET): Don't define.
+ (I386_LINUX_SIGTRAMP): Define.
+ (IN_SIGTRAMP): Define.
+ (i386_linux_sigtramp): Declare.
+ (sigtramp_saved_pc): Define.
+ (i386_linux_sigtramp_saved_pc): Declare.
+ (FRAMELESS_SIGNAL): Define.
+ (FRAME_CHAIN, FRAME_SAVED_PC): Define after #undef.
+ * i386-tdep.c (i386_linux_sigtramp_start): New static function if
+ I386_LINUX_SIGTRAMP.
+ (i386_linux_sigtramp): New function if I386_LINUX_SIGTRAMP.
+ (i386_linux_sigtramp_saved_pc): Likewise.
+ (i386_linux_sigtramp_saved_sp): Likewise.
+
+1999-07-28 Jim Blandy <jimb@savonarola.red-bean.com>
+
+ * infrun.c (handle_inferior_event): Don't try to use the code for
+ stepping over a function call to also handle stepping out of a
+ sigtramp on HP-UX. That ends up trashing step-resume breakpoints.
+ This change reverts some of David Taylor's change of 31 Dec 1998.
+ The HP-UX maintainer needs to submit a new change for whatever
+ problem the original change was trying to fix.
+
+1999-07-28 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * event-top.c (command_line_handler): Don't treat an empty line
+ from readline the same way as a multiline command. This avoids
+ missing detecting when the user presses just 'enter'.
+
+1999-07-28 Jim Blandy <jimb@savonarola.red-bean.com>
+
+ Provide more sanity checking:
+ * infrun.c (handle_inferior_event): Before assigning a new
+ breakpoint to step_resume_breakpoint, make sure it's not already
+ pointing at one; if it is, that's a bug.
+ (check_for_old_step_resume_breakpoint): New function.
+
+1999-07-28 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Eli Zaretskii <eliz@is.elta.co.il>:
+ * top.c (gdb_init) [__MSDOS__]: Arrange for GDB to return to the
+ original directory before exiting.
+ (cd_command) [_WIN32 || __MSDOS__]: Canonicalize the new directory
+ name explicitly. Handle "d:/" names correctly.
+ (init_history) [__MSDOS__]: Use _gdb_history as the default GDB
+ history file name.
+
Mon Jul 26 17:13:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
* remote.c (enum packet_support, enum packet_detect, struct
@@ -30,8 +151,9 @@ Mon Jul 26 17:13:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
1999-07-15 Jim Blandy <jimb@cris.red-bean.com>
Make the output from "info registers" fit withinin 80 columns.
- * hppa-tdep.c: Make it easy to change row and column counts.
- Switch to three columns, instead of four, and adjust spacing.
+ * hppa-tdep.c (pa_print_registers): Make it easy to change row and
+ column counts. Switch to three columns, instead of four, and
+ adjust spacing.
First cut at supporting HPPA2.0 in "wide" (64-bit) mode.
* configure.tgt: Add hppa2.0w target.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 3703f46d846..5cbeae58a70 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -224,7 +224,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \
ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
-VERSION = 19990726
+VERSION = 19990802
DIST=gdb
LINT=/usr/5bin/lint
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 860f4aaa075..5668afc482d 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -148,7 +148,7 @@ find_symbol_in_list (struct pending *list, char *name, int length)
/* ARGSUSED */
void
-really_free_pendings (int foo)
+really_free_pendings (PTR dummy)
{
struct pending *next, *next1;
diff --git a/gdb/buildsym.h b/gdb/buildsym.h
index f16ffc57748..a67d72275bd 100644
--- a/gdb/buildsym.h
+++ b/gdb/buildsym.h
@@ -243,7 +243,7 @@ extern void finish_block (struct symbol *symbol,
CORE_ADDR start, CORE_ADDR end,
struct objfile *objfile);
-extern void really_free_pendings (int foo);
+extern void really_free_pendings (PTR dummy);
extern void start_subfile (char *name, char *dirname);
diff --git a/gdb/config/i386/tm-linux.h b/gdb/config/i386/tm-linux.h
index e39dc047cb1..0767bd9ba97 100644
--- a/gdb/config/i386/tm-linux.h
+++ b/gdb/config/i386/tm-linux.h
@@ -26,8 +26,14 @@
#include "i386/tm-i386.h"
-/* Offset to saved PC in sigcontext, from <linux/signal.h>. */
-#define SIGCONTEXT_PC_OFFSET 38
+/* Size of sigcontext, from <asm/sigcontext.h>. */
+#define LINUX_SIGCONTEXT_SIZE (88)
+
+/* Offset to saved PC in sigcontext, from <asm/sigcontext.h>. */
+#define LINUX_SIGCONTEXT_PC_OFFSET (56)
+
+/* Offset to saved SP in sigcontext, from <asm/sigcontext.h>. */
+#define LINUX_SIGCONTEXT_SP_OFFSET (28)
/* We need this file for the SOLIB_TRAMPOLINE stuff. */
@@ -36,4 +42,66 @@
/* The following works around a problem with /usr/include/sys/procfs.h */
#define sys_quotactl 1
+/* When the i386 Linux kernel calls a signal handler, the return
+ address points to a bit of code on the stack. These definitions
+ are used to identify this bit of code as a signal trampoline in
+ order to support backtracing through calls to signal handlers. */
+
+#define I386_LINUX_SIGTRAMP
+#define IN_SIGTRAMP(pc, name) ((name) == NULL && i386_linux_sigtramp (pc))
+
+extern int i386_linux_sigtramp PARAMS ((CORE_ADDR));
+
+/* We need our own version of sigtramp_saved_pc to get the saved PC in
+ a sigtramp routine. */
+
+#define sigtramp_saved_pc i386_linux_sigtramp_saved_pc
+extern CORE_ADDR i386_linux_sigtramp_saved_pc PARAMS ((struct frame_info *));
+
+/* Signal trampolines don't have a meaningful frame. As in tm-i386.h,
+ the frame pointer value we use is actually the frame pointer of the
+ calling frame--that is, the frame which was in progress when the
+ signal trampoline was entered. gdb mostly treats this frame
+ pointer value as a magic cookie. We detect the case of a signal
+ trampoline by looking at the SIGNAL_HANDLER_CALLER field, which is
+ set based on IN_SIGTRAMP.
+
+ When a signal trampoline is invoked from a frameless function, we
+ essentially have two frameless functions in a row. In this case,
+ we use the same magic cookie for three frames in a row. We detect
+ this case by seeing whether the next frame has
+ SIGNAL_HANDLER_CALLER set, and, if it does, checking whether the
+ current frame is actually frameless. In this case, we need to get
+ the PC by looking at the SP register value stored in the signal
+ context.
+
+ This should work in most cases except in horrible situations where
+ a signal occurs just as we enter a function but before the frame
+ has been set up. */
+
+#define FRAMELESS_SIGNAL(FRAME) \
+ ((FRAME)->next != NULL \
+ && (FRAME)->next->signal_handler_caller \
+ && frameless_look_for_prologue (FRAME))
+
+#undef FRAME_CHAIN
+#define FRAME_CHAIN(FRAME) \
+ ((FRAME)->signal_handler_caller \
+ ? (FRAME)->frame \
+ : (FRAMELESS_SIGNAL (FRAME) \
+ ? (FRAME)->frame \
+ : (!inside_entry_file ((FRAME)->pc) \
+ ? read_memory_integer ((FRAME)->frame, 4) \
+ : 0)))
+
+#undef FRAME_SAVED_PC
+#define FRAME_SAVED_PC(FRAME) \
+ ((FRAME)->signal_handler_caller \
+ ? sigtramp_saved_pc (FRAME) \
+ : (FRAMELESS_SIGNAL (FRAME) \
+ ? read_memory_integer (i386_linux_sigtramp_saved_sp ((FRAME)->next), 4) \
+ : read_memory_integer ((FRAME)->frame + 4, 4)))
+
+extern CORE_ADDR i386_linux_sigtramp_saved_sp PARAMS ((struct frame_info *));
+
#endif /* #ifndef TM_LINUX_H */
diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h
index bfdc94577fd..3df3dab15f3 100644
--- a/gdb/config/mips/tm-mips.h
+++ b/gdb/config/mips/tm-mips.h
@@ -109,8 +109,6 @@ extern int in_sigtramp PARAMS ((CORE_ADDR, char *));
#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
-#define BIG_ENDIAN 4321
-
/* BREAKPOINT_FROM_PC uses the program counter value to determine whether a
16- or 32-bit breakpoint should be used. It returns a pointer
to a string of bytes that encode a breakpoint instruction, stores
diff --git a/gdb/config/pa/nm-hppah.h b/gdb/config/pa/nm-hppah.h
index 9d0866ce1a8..19bf2f76097 100644
--- a/gdb/config/pa/nm-hppah.h
+++ b/gdb/config/pa/nm-hppah.h
@@ -26,6 +26,18 @@
#define REGISTER_U_ADDR(addr, blockend, regno) \
{ addr = (int)(blockend) + REGISTER_BYTE (regno);}
+/* This isn't really correct, because ptrace is actually a 32-bit
+ interface. However, the modern HP-UX targets all really use
+ ttrace, which is a 64-bit interface --- a debugger running in
+ either 32- or 64-bit mode can debug a 64-bit process. BUT, the
+ code doesn't use ttrace directly --- it calls call_ptrace instead,
+ which is supposed to be drop-in substitute for ptrace. In other
+ words, they access a 64-bit system call (ttrace) through a
+ compatibility layer which is allegedly a 32-bit interface.
+
+ So I don't feel the least bit guilty about this. */
+#define PTRACE_ARG3_TYPE CORE_ADDR
+
/* HPUX 8.0, in its infinite wisdom, has chosen to prototype ptrace
with five arguments, so programs written for normal ptrace lose. */
#define FIVE_ARG_PTRACE
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 285d1548d84..258daed30de 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -623,7 +623,7 @@ dbx_symfile_read (objfile, section_offsets, mainline)
symbol_table_offset = DBX_SYMTAB_OFFSET (objfile);
free_pending_blocks ();
- back_to = make_cleanup ((make_cleanup_func) really_free_pendings, 0);
+ back_to = make_cleanup (really_free_pendings, 0);
init_minimal_symbol_collection ();
make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
@@ -1664,7 +1664,7 @@ dbx_psymtab_to_symtab_1 (pst)
/* Init stuff necessary for reading in symbols */
stabsread_init ();
buildsym_init ();
- old_chain = make_cleanup ((make_cleanup_func) really_free_pendings, 0);
+ old_chain = make_cleanup (really_free_pendings, 0);
file_string_table_offset = FILE_STRING_OFFSET (pst);
symbol_size = SYMBOL_SIZE (pst);
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 8f0274b447a..b27ac49161c 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1327,7 +1327,7 @@ psymtab_to_symtab_1 (pst)
back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL);
buildsym_init ();
- make_cleanup ((make_cleanup_func) really_free_pendings, NULL);
+ make_cleanup (really_free_pendings, NULL);
/* read in the comp_unit header */
cu_header.length = read_4_bytes (abfd, info_ptr);
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c
index e9893caa26a..13599fae35f 100644
--- a/gdb/dwarfread.c
+++ b/gdb/dwarfread.c
@@ -2456,8 +2456,7 @@ psymtab_to_symtab_1 (pst)
if (DBLENGTH (pst)) /* Otherwise it's a dummy */
{
buildsym_init ();
- old_chain = make_cleanup ((make_cleanup_func)
- really_free_pendings, 0);
+ old_chain = make_cleanup (really_free_pendings, 0);
read_ofile_symtab (pst);
if (info_verbose)
{
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 376352eb2b8..639a71bd176 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -634,9 +634,8 @@ command_line_handler (rl)
free (rl); /* Allocated in readline. */
- if (p == linebuffer || *(p - 1) == '\\')
+ if (*(p - 1) == '\\')
{
- /* We come here also if the line entered is empty (just a 'return') */
p--; /* Put on top of '\'. */
if (*p == '\\')
diff --git a/gdb/hp-psymtab-read.c b/gdb/hp-psymtab-read.c
index e1208dca513..0d2b236fecd 100644
--- a/gdb/hp-psymtab-read.c
+++ b/gdb/hp-psymtab-read.c
@@ -1622,7 +1622,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
/* Just in case the stabs reader left turds lying around. */
free_pending_blocks ();
- make_cleanup ((make_cleanup_func) really_free_pendings, 0);
+ make_cleanup (really_free_pendings, 0);
pst = (struct partial_symtab *) 0;
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index abd3b90d653..ed41361458f 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -134,10 +134,11 @@ typedef struct
{
struct minimal_symbol *msym;
CORE_ADDR solib_handle;
+ CORE_ADDR return_val;
}
args_for_find_stub;
-static CORE_ADDR cover_find_stub_with_shl_get PARAMS ((args_for_find_stub *));
+static int cover_find_stub_with_shl_get (PTR);
static int is_pa_2 = 0; /* False */
@@ -1914,14 +1915,14 @@ find_stub_with_shl_get (function, handle)
}
/* Cover routine for find_stub_with_shl_get to pass to catch_errors */
-static CORE_ADDR
-cover_find_stub_with_shl_get (args)
- args_for_find_stub *args;
+static int
+cover_find_stub_with_shl_get (PTR args_untyped)
{
- return find_stub_with_shl_get (args->msym, args->solib_handle);
+ args_for_find_stub *args = args_untyped;
+ args->return_val = find_stub_with_shl_get (args->msym, args->solib_handle);
+ return 0;
}
-
/* Insert the specified number of args and function address
into a call sequence of the above form stored at DUMMYNAME.
@@ -2519,7 +2520,7 @@ pa_print_registers (raw_regs, regnum, fpregs)
/* Alas, we are compiled so that "long long" is 32 bits */
long raw_val[2];
long long_val;
- int rows = 24, columns = 3;
+ int rows = 48, columns = 2;
for (i = 0; i < rows; i++)
{
@@ -2540,17 +2541,18 @@ pa_print_registers (raw_regs, regnum, fpregs)
/* Being big-endian, on this machine the low bits
(the ones we want to look at) are in the second longword. */
long_val = extract_signed_integer (&raw_val[1], 4);
- printf_filtered ("%8.8s: %8x",
+ printf_filtered ("%10.10s: %8x ",
REGISTER_NAME (regnum), long_val);
}
else
{
/* raw_val = extract_signed_integer(&raw_val, 8); */
if (raw_val[0] == 0)
- printf_filtered ("%8.8s: %8x",
+ printf_filtered ("%10.10s: %8x ",
REGISTER_NAME (regnum), raw_val[1]);
else
- printf_filtered ("%8.8s: %8x%8.8x", REGISTER_NAME (regnum),
+ printf_filtered ("%10.10s: %8x%8.8x ",
+ REGISTER_NAME (regnum),
raw_val[0], raw_val[1]);
}
}
@@ -3886,17 +3888,17 @@ int hp_cxx_exception_support_initialized = 0;
/* Similar to above, but imported from breakpoint.c -- non-target-specific */
extern int exception_support_initialized;
/* Address of __eh_notify_hook */
-static CORE_ADDR eh_notify_hook_addr = NULL;
+static CORE_ADDR eh_notify_hook_addr = 0;
/* Address of __d_eh_notify_callback */
-static CORE_ADDR eh_notify_callback_addr = NULL;
+static CORE_ADDR eh_notify_callback_addr = 0;
/* Address of __d_eh_break */
-static CORE_ADDR eh_break_addr = NULL;
+static CORE_ADDR eh_break_addr = 0;
/* Address of __d_eh_catch_catch */
-static CORE_ADDR eh_catch_catch_addr = NULL;
+static CORE_ADDR eh_catch_catch_addr = 0;
/* Address of __d_eh_catch_throw */
-static CORE_ADDR eh_catch_throw_addr = NULL;
+static CORE_ADDR eh_catch_throw_addr = 0;
/* Sal for __d_eh_break */
-static struct symtab_and_line *break_callback_sal = NULL;
+static struct symtab_and_line *break_callback_sal = 0;
/* Code in end.c expects __d_pid to be set in the inferior,
otherwise __d_eh_notify_callback doesn't bother to call
@@ -4049,11 +4051,12 @@ initialize_hp_cxx_exception_support ()
args.solib_handle = som_solib_get_solib_by_pc (eh_notify_callback_addr);
args.msym = msym;
+ args.return_val = 0;
recurse++;
- eh_notify_callback_addr = catch_errors ((int (*)PARAMS ((char *))) cover_find_stub_with_shl_get,
- (char *) &args,
- message, RETURN_MASK_ALL);
+ catch_errors (cover_find_stub_with_shl_get, (PTR) &args, message,
+ RETURN_MASK_ALL);
+ eh_notify_callback_addr = args.return_val;
recurse--;
exception_catchpoints_are_fragile = 1;
diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c
index 627760d7998..4aec8eef92f 100644
--- a/gdb/hppah-nat.c
+++ b/gdb/hppah-nat.c
@@ -209,7 +209,7 @@ child_xfer_memory (memaddr, myaddr, len, write, target)
{
register int i;
/* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -sizeof (int);
+ register CORE_ADDR addr = memaddr & - (CORE_ADDR)(sizeof (int));
/* Round ending address up; get number of longwords that makes. */
register int count
= (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 3e50ca89edc..238879060bc 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -722,6 +722,140 @@ i386v4_sigtramp_saved_pc (frame)
}
#endif /* I386V4_SIGTRAMP_SAVED_PC */
+#ifdef I386_LINUX_SIGTRAMP
+
+/* When the i386 Linux kernel calls a signal handler, the return
+ address points to a bit of code on the stack. This function
+ returns whether the PC appears to be within this bit of code.
+
+ The instruction sequence is
+ pop %eax
+ mov $0x77,%eax
+ int $0x80
+ or 0x58 0xb8 0x77 0x00 0x00 0x00 0xcd 0x80.
+
+ Checking for the code sequence should be somewhat reliable, because
+ the effect is to call the system call sigreturn. This is unlikely
+ to occur anywhere other than a signal trampoline.
+
+ It kind of sucks that we have to read memory from the process in
+ order to identify a signal trampoline, but there doesn't seem to be
+ any other way. The IN_SIGTRAMP macro in tm-linux.h arranges to
+ only call us if no function name could be identified, which should
+ be the case since the code is on the stack. */
+
+#define LINUX_SIGTRAMP_INSN0 (0x58) /* pop %eax */
+#define LINUX_SIGTRAMP_OFFSET0 (0)
+#define LINUX_SIGTRAMP_INSN1 (0xb8) /* mov $NNNN,%eax */
+#define LINUX_SIGTRAMP_OFFSET1 (1)
+#define LINUX_SIGTRAMP_INSN2 (0xcd) /* int */
+#define LINUX_SIGTRAMP_OFFSET2 (6)
+
+static const unsigned char linux_sigtramp_code[] =
+{
+ LINUX_SIGTRAMP_INSN0, /* pop %eax */
+ LINUX_SIGTRAMP_INSN1, 0x77, 0x00, 0x00, 0x00, /* mov $0x77,%eax */
+ LINUX_SIGTRAMP_INSN2, 0x80 /* int $0x80 */
+};
+
+#define LINUX_SIGTRAMP_LEN (sizeof linux_sigtramp_code)
+
+/* If PC is in a sigtramp routine, return the address of the start of
+ the routine. Otherwise, return 0. */
+
+static CORE_ADDR
+i386_linux_sigtramp_start (pc)
+ CORE_ADDR pc;
+{
+ unsigned char buf[LINUX_SIGTRAMP_LEN];
+
+ /* We only recognize a signal trampoline if PC is at the start of
+ one of the three instructions. We optimize for finding the PC at
+ the start, as will be the case when the trampoline is not the
+ first frame on the stack. We assume that in the case where the
+ PC is not at the start of the instruction sequence, there will be
+ a few trailing readable bytes on the stack. */
+
+ if (read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0)
+ return 0;
+
+ if (buf[0] != LINUX_SIGTRAMP_INSN0)
+ {
+ int adjust;
+
+ switch (buf[0])
+ {
+ case LINUX_SIGTRAMP_INSN1:
+ adjust = LINUX_SIGTRAMP_OFFSET1;
+ break;
+ case LINUX_SIGTRAMP_INSN2:
+ adjust = LINUX_SIGTRAMP_OFFSET2;
+ break;
+ default:
+ return 0;
+ }
+
+ pc -= adjust;
+
+ if (read_memory_nobpt (pc, (char *) buf, LINUX_SIGTRAMP_LEN) != 0)
+ return 0;
+ }
+
+ if (memcmp (buf, linux_sigtramp_code, LINUX_SIGTRAMP_LEN) != 0)
+ return 0;
+
+ return pc;
+}
+
+/* Return whether PC is in a Linux sigtramp routine. */
+
+int
+i386_linux_sigtramp (pc)
+ CORE_ADDR pc;
+{
+ return i386_linux_sigtramp_start (pc) != 0;
+}
+
+/* Assuming FRAME is for a Linux sigtramp routine, return the saved
+ program counter. The Linux kernel will set up a sigcontext
+ structure immediately before the sigtramp routine on the stack. */
+
+CORE_ADDR
+i386_linux_sigtramp_saved_pc (frame)
+ struct frame_info *frame;
+{
+ CORE_ADDR pc;
+
+ pc = i386_linux_sigtramp_start (frame->pc);
+ if (pc == 0)
+ error ("i386_linux_sigtramp_saved_pc called when no sigtramp");
+ return read_memory_integer ((pc
+ - LINUX_SIGCONTEXT_SIZE
+ + LINUX_SIGCONTEXT_PC_OFFSET),
+ 4);
+}
+
+/* Assuming FRAME is for a Linux sigtramp routine, return the saved
+ stack pointer. The Linux kernel will set up a sigcontext structure
+ immediately before the sigtramp routine on the stack. */
+
+CORE_ADDR
+i386_linux_sigtramp_saved_sp (frame)
+ struct frame_info *frame;
+{
+ CORE_ADDR pc;
+
+ pc = i386_linux_sigtramp_start (frame->pc);
+ if (pc == 0)
+ error ("i386_linux_sigtramp_saved_sp called when no sigtramp");
+ return read_memory_integer ((pc
+ - LINUX_SIGCONTEXT_SIZE
+ + LINUX_SIGCONTEXT_SP_OFFSET),
+ 4);
+}
+
+#endif /* I386_LINUX_SIGTRAMP */
+
#ifdef STATIC_TRANSFORM_NAME
/* SunPRO encodes the static variables. This is not related to C++ mangling,
it is done for C too. */
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 08e6f645b1d..efb1caf9152 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1298,6 +1298,16 @@ init_execution_control_state (ecs)
ecs->wp = &(ecs->ws);
}
+/* Call this function before setting step_resume_breakpoint, as a
+ sanity check. We should never be setting a new
+ step_resume_breakpoint when we have an old one active. */
+static void
+check_for_old_step_resume_breakpoint ()
+{
+ if (step_resume_breakpoint)
+ warning ("GDB bug: infrun.c (wait_for_inferior): dropping old step_resume breakpoint");
+}
+
/* Given an execution control state that has been freshly filled in
by an event from the inferior, figure out what it means and take
appropriate action. */
@@ -2143,16 +2153,39 @@ handle_inferior_event (ecs)
if (signal_program[stop_signal] == 0)
stop_signal = TARGET_SIGNAL_0;
- /* If we're in the middle of a "next" command, let the code for
- stepping over a function handle this. pai/1997-09-10
-
- A previous comment here suggested it was possible to change
- this to jump to keep_going in all cases. */
-
- if (step_over_calls > 0)
- goto step_over_function;
- else
- goto check_sigtramp2;
+ /* I'm not sure whether this needs to be check_sigtramp2 or
+ whether it could/should be keep_going.
+
+ This used to jump to step_over_function if we are stepping,
+ which is wrong.
+
+ Suppose the user does a `next' over a function call, and while
+ that call is in progress, the inferior receives a signal for
+ which GDB does not stop (i.e., signal_stop[SIG] is false). In
+ that case, when we reach this point, there is already a
+ step-resume breakpoint established, right where it should be:
+ immediately after the function call the user is "next"-ing
+ over. If we jump to step_over_function now, two bad things
+ happen:
+
+ - we'll create a new breakpoint, at wherever the current
+ frame's return address happens to be. That could be
+ anywhere, depending on what function call happens to be on
+ the top of the stack at that point. Point is, it's probably
+ not where we need it.
+
+ - the existing step-resume breakpoint (which is at the correct
+ address) will get orphaned: step_resume_breakpoint will point
+ to the new breakpoint, and the old step-resume breakpoint
+ will never be cleaned up.
+
+ The old behavior was meant to help HP-UX single-step out of
+ sigtramps. It would place the new breakpoint at prev_pc, which
+ was certainly wrong. I don't know the details there, so fixing
+ this probably breaks that. As with anything else, it's up to
+ the HP-UX maintainer to furnish a fix that doesn't break other
+ platforms. --JimB, 20 May 1999 */
+ goto check_sigtramp2;
}
/* Handle cases caused by hitting a breakpoint. */
@@ -2513,6 +2546,7 @@ handle_inferior_event (ecs)
/* We could probably be setting the frame to
step_frame_address; I don't think anyone thought to
try it. */
+ check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
if (breakpoints_inserted)
@@ -2595,6 +2629,7 @@ handle_inferior_event (ecs)
INIT_SAL (&xxx); /* initialize to zeroes */
xxx.pc = tmp;
xxx.section = find_pc_overlay (xxx.pc);
+ check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
set_momentary_breakpoint (xxx, NULL, bp_step_resume);
insert_breakpoints ();
@@ -2619,51 +2654,30 @@ handle_inferior_event (ecs)
step_over_function:
/* A subroutine call has happened. */
{
- /* Set a special breakpoint after the return */
- struct symtab_and_line sr_sal;
+ /* We've just entered a callee, and we wish to resume until it
+ returns to the caller. Setting a step_resume breakpoint on
+ the return address will catch a return from the callee.
+
+ However, if the callee is recursing, we want to be careful
+ not to catch returns of those recursive calls, but only of
+ THIS instance of the call.
- INIT_SAL (&sr_sal);
- sr_sal.symtab = NULL;
- sr_sal.line = 0;
+ To do this, we set the step_resume bp's frame to our current
+ caller's frame (step_frame_address, which is set by the "next"
+ or "until" command, before execution begins). */
+ struct symtab_and_line sr_sal;
- /* If we came here after encountering a signal in the middle of
- a "next", use the stashed-away previous frame pc */
- sr_sal.pc
- = stopped_by_random_signal
- ? prev_pc
- : ADDR_BITS_REMOVE (SAVED_PC_AFTER_CALL (get_current_frame ()));
+ INIT_SAL (&sr_sal); /* initialize to zeros */
+ sr_sal.pc =
+ ADDR_BITS_REMOVE (SAVED_PC_AFTER_CALL (get_current_frame ()));
+ sr_sal.section = find_pc_overlay (sr_sal.pc);
+ check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
- set_momentary_breakpoint (sr_sal,
- stopped_by_random_signal ?
- NULL : get_current_frame (),
+ set_momentary_breakpoint (sr_sal, get_current_frame (),
bp_step_resume);
- /* We've just entered a callee, and we wish to resume until
- it returns to the caller. Setting a step_resume bp on
- the return PC will catch a return from the callee.
-
- However, if the callee is recursing, we want to be
- careful not to catch returns of those recursive calls,
- but of THIS instance of the call.
-
- To do this, we set the step_resume bp's frame to our
- current caller's frame (step_frame_address, which is
- set by the "next" or "until" command, before execution
- begins).
-
- But ... don't do it if we're single-stepping out of a
- sigtramp, because the reason we're single-stepping is
- precisely because unwinding is a problem (HP-UX 10.20,
- e.g.) and the frame address is likely to be incorrect.
- No danger of sigtramp recursion. */
-
- if (ecs->stepping_through_sigtramp)
- {
- step_resume_breakpoint->frame = (CORE_ADDR) NULL;
- ecs->stepping_through_sigtramp = 0;
- }
- else if (!IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc))
+ if (!IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc))
step_resume_breakpoint->frame = step_frame_address;
if (breakpoints_inserted)
@@ -2713,6 +2727,7 @@ handle_inferior_event (ecs)
/* Do not specify what the fp should be when we stop
since on some machines the prologue
is where the new fp value is established. */
+ check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
if (breakpoints_inserted)
@@ -2757,6 +2772,7 @@ handle_inferior_event (ecs)
/* Do not specify what the fp should be when we stop
since on some machines the prologue
is where the new fp value is established. */
+ check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
if (breakpoints_inserted)
diff --git a/gdb/infttrace.c b/gdb/infttrace.c
index dae4ad44065..c76c5132201 100644
--- a/gdb/infttrace.c
+++ b/gdb/infttrace.c
@@ -1403,13 +1403,12 @@ get_process_first_stopped_thread_id (pid, thread_state)
{
int tt_status;
- tt_status = call_real_ttrace (
- TT_PROC_GET_FIRST_LWP_STATE,
- (pid_t) pid,
- (lwpid_t) TT_NIL,
- (TTRACE_ARG_TYPE) thread_state,
- (TTRACE_ARG_TYPE) sizeof (*thread_state),
- TT_NIL);
+ tt_status = call_real_ttrace (TT_PROC_GET_FIRST_LWP_STATE,
+ (pid_t) pid,
+ (lwpid_t) TT_NIL,
+ (TTRACE_ARG_TYPE) thread_state,
+ (TTRACE_ARG_TYPE) sizeof (*thread_state),
+ TT_NIL);
if (errno)
{
@@ -4330,7 +4329,7 @@ thread_fake_step (tid, signal)
p = find_thread_info (tid);
if (p != NULL)
{
- if (p->have_signal && signal == NULL)
+ if (p->have_signal && signal == TARGET_SIGNAL_0)
{
/* Pass on a saved signal.
*/
@@ -5875,6 +5874,11 @@ _initialize_infttrace ()
errno = 0;
memory_page_dictionary.page_size = sysconf (_SC_PAGE_SIZE);
+ /* We do a lot of casts from pointers to TTRACE_ARG_TYPE; make sure
+ this is okay. */
+ if (sizeof (TTRACE_ARG_TYPE) < sizeof (void *))
+ abort ();
+
if (errno || (memory_page_dictionary.page_size <= 0))
perror_with_name ("sysconf");
}
diff --git a/gdb/monitor.c b/gdb/monitor.c
index 1709a71f562..306b78350ae 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -607,9 +607,43 @@ monitor_expect (string, buf, buflen)
}
else
{
- p = string;
- if (c == *p)
- p++;
+ /* We got a character that doesn't match the string. We need to
+ back up p, but how far? If we're looking for "..howdy" and the
+ monitor sends "...howdy"? There's certainly a match in there,
+ but when we receive the third ".", we won't find it if we just
+ restart the matching at the beginning of the string.
+
+ This is a Boyer-Moore kind of situation. We want to reset P to
+ the end of the longest prefix of STRING that is a suffix of
+ what we've read so far. In the example above, that would be
+ ".." --- the longest prefix of "..howdy" that is a suffix of
+ "...". This longest prefix could be the empty string, if C
+ is nowhere to be found in STRING.
+
+ If this longest prefix is not the empty string, it must contain
+ C, so let's search from the end of STRING for instances of C,
+ and see if the portion of STRING before that is a suffix of
+ what we read before C. Actually, we can search backwards from
+ p, since we know no prefix can be longer than that.
+
+ Note that we can use STRING itself, along with C, as a record
+ of what we've received so far. :) */
+ int i;
+
+ for (i = (p - string) - 1; i >= 0; i--)
+ if (string[i] == c)
+ {
+ /* Is this prefix a suffix of what we've read so far?
+ In other words, does
+ string[0 .. i-1] == string[p - i, p - 1]? */
+ if (! memcmp (string, p - i, i))
+ {
+ p = string + i + 1;
+ break;
+ }
+ }
+ if (i < 0)
+ p = string;
}
}
}
diff --git a/gdb/os9kread.c b/gdb/os9kread.c
index 402130c1e0a..8f439c4d476 100644
--- a/gdb/os9kread.c
+++ b/gdb/os9kread.c
@@ -347,7 +347,7 @@ os9k_symfile_read (objfile, section_offsets, mainline)
init_psymbol_list (objfile, DBX_SYMCOUNT (objfile));
free_pending_blocks ();
- back_to = make_cleanup ((make_cleanup_func) really_free_pendings, 0);
+ back_to = make_cleanup (really_free_pendings, 0);
make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
read_minimal_symbols (objfile, section_offsets);
@@ -1248,7 +1248,7 @@ os9k_psymtab_to_symtab_1 (pst)
/* Init stuff necessary for reading in symbols */
stabsread_init ();
buildsym_init ();
- old_chain = make_cleanup ((make_cleanup_func) really_free_pendings, 0);
+ old_chain = make_cleanup (really_free_pendings, 0);
/* Read in this file's symbols */
os9k_read_ofile_symtab (pst);
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index ec59cf36bd0..52b22f12158 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -4701,18 +4701,30 @@ read_range_type (pp, typenums, objfile)
/* We used to do this only for subrange of self or subrange of int. */
else if (n2 == 0)
{
+ /* -1 is used for the upper bound of (4 byte) "unsigned int" and
+ "unsigned long", and we already checked for that,
+ so don't need to test for it here. */
+
if (n3 < 0)
/* n3 actually gives the size. */
return init_type (TYPE_CODE_INT, -n3, TYPE_FLAG_UNSIGNED,
NULL, objfile);
- if (n3 == 0xff)
- return init_type (TYPE_CODE_INT, 1, TYPE_FLAG_UNSIGNED, NULL, objfile);
- if (n3 == 0xffff)
- return init_type (TYPE_CODE_INT, 2, TYPE_FLAG_UNSIGNED, NULL, objfile);
- /* -1 is used for the upper bound of (4 byte) "unsigned int" and
- "unsigned long", and we already checked for that,
- so don't need to test for it here. */
+ /* Is n3 == 2**(8n))-1 for some integer n? Then it's an
+ unsigned n-byte integer. But do require n to be a power of
+ two; we don't want 3- and 5-byte integers flying around. */
+ {
+ int bytes;
+ unsigned long bits;
+
+ bits = n3;
+ for (bytes = 0; (bits & 0xff) == 0xff; bytes++)
+ bits >>= 8;
+ if (bits == 0
+ && ((bytes - 1) & bytes) == 0) /* "bytes is a power of two" */
+ return init_type (TYPE_CODE_INT, bytes, TYPE_FLAG_UNSIGNED, NULL,
+ objfile);
+ }
}
/* I think this is for Convex "long long". Since I don't know whether
Convex sets self_subrange, I also accept that particular size regardless
diff --git a/gdb/symfile.c b/gdb/symfile.c
index fcf8326ee74..42d9e4f867e 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -884,7 +884,7 @@ symbol_file_command (args, from_tty)
if (text_relocation == (CORE_ADDR) 0)
return;
- else if (text_relocation == (CORE_ADDR) - 1)
+ else if (text_relocation == (CORE_ADDR) -1)
{
symbol_file_add (name, from_tty, (CORE_ADDR) 0,
1, mapped, readnow, 1, 0);
@@ -1313,7 +1313,7 @@ add_symbol_file_command (args, from_tty)
else
{
target_link (name, &text_addr);
- if (text_addr == (CORE_ADDR) - 1)
+ if (text_addr == (CORE_ADDR) -1)
error ("Don't know how to get text start location for this file");
}
diff --git a/gdb/symtab.c b/gdb/symtab.c
index b09ccae4ba5..2ade65fcb20 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1319,7 +1319,21 @@ lookup_block_symbol (block, name, namespace)
PC, then use the main symbol.
?!? Is checking the current pc correct? Is this routine
- ever called to look up a symbol from another context? */
+ ever called to look up a symbol from another context?
+
+ FIXME: No, it's not correct. If someone sets a
+ conditional breakpoint at an address, then the
+ breakpoint's `struct expression' should refer to the
+ `struct symbol' appropriate for the breakpoint's
+ address, which may not be the PC.
+
+ Even if it were never called from another context,
+ it's totally bizarre for lookup_symbol's behavior to
+ depend on the value of the inferior's current PC. We
+ should pass in the appropriate PC as well as the
+ block. The interface to lookup_symbol should change
+ to require the caller to provide a PC. */
+
if (SYMBOL_ALIASES (sym))
sym = find_active_alias (sym, read_pc ());
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index d0c567b3754..c1e25cab084 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,103 @@
+1999-07-30 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.c++/ref-types.cc, gdb.c++/ref-types.exp: Appease doschk
+ by merging in ref-types2 tests.
+ * gdb.c++/ref-types2.cc, gdb.c++/ref-types2.exp: Remove.
+
+ From Jimmy Guo <guo@cup.hp.com> and others at HP:
+ * gdb.c++/Makefile.in: Add standard actions.
+ (EXECUTABLES): Rename from PROGS, update list.
+ * gdb.c++/ambiguous.cc, gdb.c++/ambiguous.exp: Move to here
+ from gdb.hp.
+ * gdb.c++/anon-union.cc: Don't use anonymous struct, make
+ foo and bar locals.
+ * gdb.c++/anon-union.exp: Fix tests to match.
+ * gdb.c++/classes.exp: Run if HP compiler used, add extra
+ expect matches to handle output variations.
+ * gdb.c++/cplusfuncs.cc: Make operator -> return foo *.
+ * gdb.c++/cplusfuncs.exp: Update to match, allow word "class" in
+ output, add HP alternatives for new and delete prints.
+ * gdb.c++/ctti.exp, gdb.c++/cttiadd.cc, gdb.c++/cttiadd1.cc,
+ gdb.c++/cttiadd2.cc, gdb.c++/cttiadd3.cc: Move here from gdb.hp.
+ * gdb.c++/demangle.exp: Use $style when reporting failure.
+ * gdb.c++/derivation.exp: Add some xfails if GCC-compiled.
+ * gdb.c++/inherit.exp: Run if HP compiler used, add some
+ match alternatives.
+ * gdb.c++/local.exp: Add match alternatives or xfails for HP
+ compilers.
+ * gdb.c++/member-ptr.exp: Add xfails for hppa*-*-*.
+ * gdb.c++/method.exp: Add match alternatives.
+ * gdb.c++/misc.cc: Add bool types.
+ * gdb.c++/misc.exp: Add tests for bool types.
+ * gdb.c++/overload.exp: Add xfails.
+ * gdb.c++/templates.cc: Remove bogus arglist init, init fvpchar.
+ * gdb.c++/templates.exp: Run if HP compiler used, add some xfails,
+ add some more template parameter tests (only for HP currently).
+ * gdb.c++/userdef.exp: Add xfails for hppa*-*-*.
+ * gdb.c++/virtfunc.cc: Add return type and value for main.
+ * gdb.c++/virtfunc.exp: Run if HP compiler used, add some
+ match alternatives.
+
+1999-07-30 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/display.exp: Fix output of 'p/a &&j' test.
+
+1999-07-29 Jim Blandy <jimb@savonarola.red-bean.com>
+
+ * gdb.base/signals.exp: Don't expect getting a backtrace from
+ within a signal handler to fail on Linux.
+
+1999-07-29 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Jimmy Guo <guo@cup.hp.com> and others at HP:
+ * lib/gdb.exp: Remove some gratuitious semicolons.
+ (delete_breakpoints): Increase timeout.
+ (gdb_expect): Add -notransfer option.
+ (gdb_test): Use -notransfer option.
+ (get_compiler_info): Add f77 case.
+ (get_compiler): New proc, split out from gdb_preprocess, add f77
+ case.
+ (gdb_preprocess): Call get_compiler.
+
+ * gdb.base/Makefile.in (EXECUTABLES): Update the list.
+ * gdb.base/attach.exp, gdb.base/display.exp,
+ gdb.base/ending-run.exp, gdb.base/gdbvars.exp,
+ gdb.base/long_long.exp, gdb.base/printcmds.exp,
+ gdb.base/structs.exp, gdb.base/structs2.exp: Remove or fill in
+ third arg to gdb_test.
+ * gdb.base/call-ar-st.exp: Add HP-UX xfail for >10-arg functions.
+ * gdb.base/callfuncs.exp, gdb.base/callfwmall.exp: Remove some
+ HP-UX xfails, add others.
+ * gdb.base/completion.exp: Reflect name change of self-test.
+ * gdb.base/condbreak.exp, gdb.base/corefile.exp,
+ gdb.base/foll-exec.exp, gdb.base/interrupt.exp,
+ gdb.base/ptype.exp, gdb.base/scope.exp, gdb.base/setvar.exp: Note
+ HP failure number.
+ * gdb.base/foll-vfork.exp: Loosen matches slightly, remove
+ useless HP-UX 10.30 references.
+ * gdb.base/maint.exp: Loosen matches.
+ * gdb.base/pointers.c (main): Declare more_code.
+ * gdb.base/pointers.exp: Match on output of a `next'.
+ * gdb.base/structs.c: Add prototypes.
+ * gdb.base/watchpoint.exp: Remove HP-UX 10.30 reference.
+ * gdb.base/whatis.exp: Fail for both HP-UX 10.20 and 11.
+
+1999-07-29 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/list.exp: Add tests for repeating 'list <linenum>'
+ command.
+
+1999-07-27 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.c++/annota2.exp: Fix delete breakpoint query testcase.
+ Fix run to main failures. Watchpoint can be hardware watchpoint.
+
+ * gdb.base/annota1.exp: Clean up some more, in case printf has
+ debug info. Deal with lack of signal hanlder info in stack.
+
+ From Jim Kingdon <kingdon@redhat.com>:
+ * gdb.base/annota1.exp: If printf has debug info, deal with it.
+
1999-07-19 Stan Shebs <shebs@andros.cygnus.com>
* gdb.base/foll-exec.exp, gdb.base/foll-fork.exp,
diff --git a/gdb/testsuite/gdb.base/Makefile.in b/gdb/testsuite/gdb.base/Makefile.in
index fbb7fe2fad2..7dbe519cf9a 100644
--- a/gdb/testsuite/gdb.base/Makefile.in
+++ b/gdb/testsuite/gdb.base/Makefile.in
@@ -2,19 +2,19 @@ VPATH = @srcdir@
srcdir = @srcdir@
EXECUTABLES = all-types annota1 bitfields break \
- call-ar-st call-rt-st call-strs callfuncs callfuncs2 commands \
- compiler condbreak constvars coremaker display \
- ending-run exprs funcargs int-type interrupt \
- jump langs \
- list long_long \
- mips_pro miscexprs nodebug opaque pointers pointers2 printcmds ptype \
+ call-ar-st call-rt-st call-strs callfuncs callfwmall \
+ commands compiler condbreak constvars coremaker \
+ dbx-test display ending-run execd-prog exprs \
+ foll-exec foll-fork foll-vfork funcargs int-type interrupt jump \
+ langs list long_long mips_pro miscexprs nodebug opaque overlays \
+ pointers pointers2 printcmds ptype \
recurse reread reread1 restore return run \
- scope section_command setshow setvar \
- shmain sigall signals smoke smoke1 \
- solib so-impl-ld so-indr-cl \
- step-test structs structs2 twice-tmp varargs watchpoint whatis
+ scope section_command setshow setvar shmain sigall signals \
+ solib solib_sl so-impl-ld so-indr-cl step-test structs structs2 \
+ twice-tmp varargs vforked-prog watchpoint whatis
-MISCELLANEOUS = coremmap.data shr1.sl shr2.sl solib1.sl solib2.sl
+MISCELLANEOUS = coremmap.data ../foobar.baz \
+ shr1.sl shr2.sl solib_sl.sl solib1.sl solib2.sl
all:
@echo "Nothing to be done for all..."
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
index ba24fe92b28..5ecdcb37b84 100644
--- a/gdb/testsuite/gdb.base/annota1.exp
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -228,7 +228,7 @@ gdb_expect {
#
send_gdb "continue\n"
gdb_expect {
- -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 3\r\n\r\nBreakpoint 3, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n\032\032frame-function-name\r\nprintf\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-where\r\n from.*\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
+ -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 3\r\n\r\nBreakpoint 3, \r\n\032\032frame-begin 0 $hex\r\n\r\n(\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n)*\032\032frame-function-name\r\nprintf\r\n\032\032frame-args\r\n.*\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
{ pass "continue to printf" }
-re ".*$gdb_prompt$" { fail "continue to printf" }
timeout { fail "continue to printf (timeout)" }
@@ -242,7 +242,7 @@ gdb_expect {
#
send_gdb "backtrace\n"
gdb_expect {
- -re "\r\n\032\032post-prompt\r\n\r\n\032\032frame-begin 0 $hex\r\n.0 \r\n\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n\032\032frame-function-name\r\nprintf\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-where\r\n from.*\r\n\032\032frame-end\r\n\r\n\032\032frame-begin 1 $hex\r\n.1 \r\n\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${srcdir}/${subdir}/${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032frame-end\r\n$gdb_prompt$" \
+ -re "\r\n\032\032post-prompt\r\n\r\n\032\032frame-begin 0 $hex\r\n.0 \r\n(\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n)*\032\032frame-function-name\r\nprintf\r\n\032\032frame-args\r\n \\(.*frame-end\r\n\r\n\032\032frame-begin 1 $hex\r\n.1 \r\n\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${srcdir}/${subdir}/${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032frame-end\r\n$gdb_prompt$" \
{ pass "bactrace from shlibrary" }
-re ".*$gdb_prompt$" { fail "backtrace from shlibrary" }
timeout { fail "backtrace from shlibrary (timeout)" }
@@ -277,7 +277,7 @@ match_max 3000
verbose "match_max now is: [match_max]"
send_gdb "backtrace\n"
gdb_expect {
- -re ".*frame-begin 0 $hex.*0.*frame-end.*frame-begin 1 $hex.*1.*\032\032signal-handler-caller\r\n.signal handler called.\r\n\r\n\032\032frame-end\r\n\r\n.*frame-begin 2 $hex.*2.*frame-begin 3 $hex.*3.*frame-end.*$gdb_prompt$" \
+ -re "frame-begin 0 $hex.*0.*frame-end.*frame-begin 1 $hex.*1.*(\032\032signal-handler-caller\r\n.signal handler called.\r\n\r\n)*\032\032frame-end\r\n\r\n\032\032frame-begin 2 $hex.*2.*(frame-begin 3 $hex.*3.*)*frame-end.*$gdb_prompt$" \
{ pass "backtrace @ signal handler" }
-re ".*$gdb_prompt$" { fail "backtrace @ signal handler" }
timeout { fail "backtrace @ signal handler (timeout)" }
diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index b86838b2afd..09a08774966 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -128,7 +128,7 @@ proc do_attach_tests {} {
# This reponse is expected on HP-UX 10.20 (i.e., ptrace-based).
-re "Attaching to.*, process 0.*No such process.*$gdb_prompt $"\
{pass "attach to nonexistent process is prohibited"}
- # This response is expected on HP-UX 10.30 & 11.0 (i.e., ttrace-based).
+ # This response is expected on HP-UX 11.0 (i.e., ttrace-based).
-re "Attaching to.*, process 0 failed.*Hint.*$gdb_prompt $"\
{pass "attach to nonexistent process is prohibited"}
-re "$gdb_prompt $" {fail "attach to nonexistent process is prohibited"}
@@ -386,8 +386,8 @@ proc do_call_attach_tests {} {
# Get rid of the process
#
- gdb_test "p should_exit = 1" ".*" ""
- gdb_test "c" ".*Program exited normally.*" ""
+ gdb_test "p should_exit = 1" ".*"
+ gdb_test "c" ".*Program exited normally.*"
# Be paranoid
#
diff --git a/gdb/testsuite/gdb.base/call-ar-st.exp b/gdb/testsuite/gdb.base/call-ar-st.exp
index 5662eb77a49..15ebe1d4e12 100644
--- a/gdb/testsuite/gdb.base/call-ar-st.exp
+++ b/gdb/testsuite/gdb.base/call-ar-st.exp
@@ -465,12 +465,6 @@ gdb_test "tbreak 1300" \
gdb_test continue "Continuing\\..*Contents of two_floats_t:.*main \\(\\) at.*call-ar-st.c:1300.*1300.*init_bit_flags_combo\\(flags_combo, \\(unsigned\\)1, \\(unsigned\\)0, .y.,.*" \
"continue to 1300"
-
-# FIXME:
-# HP aCC demangler currently does not handle hp aCC functions with >10 args
-# DTS CLLbs16994 coulter 990114
-
-if {$hp_aCC_compiler} {setup_xfail "hppa*-*-*"}
#step
send_gdb "step\n"
gdb_expect {
@@ -501,6 +495,13 @@ gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1305\[\r\n\t \]+
"continue to 1305"
#call print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)
+
+# FIXME:
+# HP aCC demangler currently does not handle hp aCC functions with >10 args
+# DTS CLLbs16994 coulter 990114
+
+if {$hp_aCC_compiler} {setup_xfail "hppa*-*-*" CLLbs16994}
+
if {![target_info exists gdb,skip_float_tests]} {
send_gdb "print print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n"
gdb_expect {
diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
index 7db87b7caff..1ce9683316a 100644
--- a/gdb/testsuite/gdb.base/callfuncs.exp
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -94,6 +94,8 @@ proc set_lang_c {} {
proc do_function_calls {} {
global prototypes
global gcc_compiled
+ global gdb_prompt
+
# We need to up this because this can be really slow on some boards.
set timeout 60;
@@ -129,13 +131,13 @@ proc do_function_calls {} {
# Gcc emits different stabs for the two parameters; the first is
# claimed to be a float, the second a double.
# dbxout.c in gcc claims this is the desired behavior.
- setup_xfail "mn10300-*-*" "hppa*-*-*11*"
+ setup_xfail "mn10300-*-*"
gdb_test "p t_float_values(3.14159,-2.3765)" " = 1"
- setup_xfail "mn10300-*-*" "hppa*-*-*11*"
+ setup_xfail "mn10300-*-*"
gdb_test "p t_float_values(float_val1,float_val2)" " = 1"
- setup_xfail "mn10300-*-*" "hppa*-*-*11*"
+ setup_xfail "mn10300-*-*"
gdb_test "p t_float_values(3.14159,float_val2)" " = 1"
- setup_xfail "mn10300-*-*" "hppa*-*-*11*"
+ setup_xfail "mn10300-*-*"
gdb_test "p t_float_values(float_val1,-2.3765)" " = 1"
# Test passing of arguments which might not be widened.
@@ -185,59 +187,22 @@ proc do_function_calls {} {
# the RS6000.
setup_xfail "rs6000*-*-*"
setup_xfail "powerpc*-*-*"
- if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
- send_gdb "p t_func_values(add,func_val2)\n"
- gdb_expect {
- -re "You cannot.*ignored.*" {pass "p t_func_values(add,func_val2)"}
- -re "Program received signal SIGBUS, Bus error.*" {
- if [istarget hppa*-*-hpux*] {
- pass "p t_func_values(add,func_val2)"
- } else {
- fail "p t_func_values(add,func_val2)"
- }
- }
- }
- } else {
+ if {![istarget hppa*-*-hpux*]} then {
gdb_test "p t_func_values(add,func_val2)" " = 1"
}
setup_xfail "rs6000*-*-*"
setup_xfail "powerpc*-*-*"
- if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
- send_gdb "p t_func_values(func_val1,doubleit)\n"
- gdb_expect {
- -re "You cannot.*ignored.*" {pass "p t_func_values(func_val1,doubleit)"}
- -re "Program received signal SIGBUS, Bus error.*" {
- if [istarget hppa*-*-hpux*] {
- pass "p t_func_values(func_val1,doubleit)"
- } else {
- fail "p t_func_values(func_val1,doubleit)"
- }
- }
- }
- } else {
+ if {![istarget hppa*-*-hpux*]} then {
gdb_test "p t_func_values(func_val1,doubleit)" " = 1"
}
- gdb_test "p t_call_add(func_val1,3,4)" " = 7"
-
setup_xfail "rs6000*-*-*"
setup_xfail "powerpc*-*-*"
- if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
- send_gdb "p t_call_add(add,3,4)\n"
- gdb_expect {
- -re "You cannot.*ignored.*" {pass "p t_call_add(add,3,4)"}
- -re "Program received signal SIGBUS, Bus error.*" {
- if [istarget hppa*-*-hpux*] {
- pass "p t_call_add(add,3,4)"
- } else {
- fail "p t_call_add(add,3,4)"
- }
- }
- }
- } else {
+ if {![istarget hppa*-*-hpux*]} then {
gdb_test "p t_call_add(add,3,4)" " = 7"
}
+ gdb_test "p t_call_add(func_val1,3,4)" " = 7"
gdb_test "p t_enum_value1(enumval1)" " = 1"
gdb_test "p t_enum_value1(enum_val1)" " = 1"
diff --git a/gdb/testsuite/gdb.base/callfwmall.exp b/gdb/testsuite/gdb.base/callfwmall.exp
index 7c734f80672..7d7cf78adc0 100644
--- a/gdb/testsuite/gdb.base/callfwmall.exp
+++ b/gdb/testsuite/gdb.base/callfwmall.exp
@@ -19,7 +19,7 @@
# This file was written by Fred Fish. (fnf@cygnus.com)
-# SAME tests as in callfns.exp but here the inferior program does not
+# SAME tests as in callfuncs.exp but here the inferior program does not
# call malloc.
@@ -99,6 +99,8 @@ proc set_lang_c {} {
proc do_function_calls {} {
global prototypes
global gcc_compiled
+ global gdb_prompt
+
# We need to up this because this can be really slow on some boards.
set timeout 60;
@@ -134,13 +136,13 @@ proc do_function_calls {} {
# Gcc emits different stabs for the two parameters; the first is
# claimed to be a float, the second a double.
# dbxout.c in gcc claims this is the desired behavior.
- setup_xfail "mn10300-*-*" "hppa*-*-*11*"
+ setup_xfail "mn10300-*-*"
gdb_test "p t_float_values(3.14159,-2.3765)" " = 1"
- setup_xfail "mn10300-*-*" "hppa*-*-*11*"
+ setup_xfail "mn10300-*-*"
gdb_test "p t_float_values(float_val1,float_val2)" " = 1"
- setup_xfail "mn10300-*-*" "hppa*-*-*11*"
+ setup_xfail "mn10300-*-*"
gdb_test "p t_float_values(3.14159,float_val2)" " = 1"
- setup_xfail "mn10300-*-*" "hppa*-*-*11*"
+ setup_xfail "mn10300-*-*"
gdb_test "p t_float_values(float_val1,-2.3765)" " = 1"
# Test passing of arguments which might not be widened.
@@ -192,38 +194,14 @@ proc do_function_calls {} {
setup_xfail "rs6000*-*-*"
setup_xfail "powerpc*-*-*"
- if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
- send_gdb "p t_func_values(add,func_val2)\n"
- gdb_expect {
- -re "You cannot.*ignored.*" {pass "p t_func_values(add,func_val2)"}
- -re "Program received signal SIGBUS, Bus error.*" {
- if [istarget hppa*-*-hpux*] {
- pass "p t_func_values(add,func_val2)"
- } else {
- fail "p t_func_values(add,func_val2)"
- }
- }
- }
- } else {
+ if {![istarget hppa*-*-hpux*]} then {
gdb_test "p t_func_values(add,func_val2)" " = 1"
}
setup_xfail "rs6000*-*-*"
setup_xfail "powerpc*-*-*"
- if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
- send_gdb "p t_func_values(func_val1,doubleit)\n"
- gdb_expect {
- -re "You cannot.*ignored.*" {pass "p t_func_values(func_val1,doubleit)"}
- -re "Program received signal SIGBUS, Bus error.*" {
- if [istarget hppa*-*-hpux*] {
- pass "p t_func_values(func_val1,doubleit)"
- } else {
- fail "p t_func_values(func_val1,doubleit)"
- }
- }
- }
- } else {
+ if {![istarget hppa*-*-hpux*]} then {
gdb_test "p t_func_values(func_val1,doubleit)" " = 1"
}
@@ -232,19 +210,7 @@ proc do_function_calls {} {
setup_xfail "rs6000*-*-*"
setup_xfail "powerpc*-*-*"
- if {!$gcc_compiled && [istarget hppa*-*-hpux*]} then {
- send_gdb "p t_call_add(add,3,4)\n"
- gdb_expect {
- -re "You cannot.*ignored.*" {pass "p t_call_add(add,3,4)"}
- -re "Program received signal SIGBUS, Bus error.*" {
- if [istarget hppa*-*-hpux*] {
- pass "p t_call_add(add,3,4)"
- } else {
- fail "p t_call_add(add,3,4)"
- }
- }
- }
- } else {
+ if {![istarget hppa*-*-hpux*]} then {
gdb_test "p t_call_add(add,3,4)" " = 7"
}
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index 327f37dc1c3..2db201236ed 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -533,10 +533,10 @@ gdb_expect {
}
-send_gdb "file ${srcdir}/gdb.base/a1\t"
+send_gdb "file ${srcdir}/gdb.base/self\t"
sleep 1
gdb_expect {
- -re "^file ${srcdir}/gdb.base/.*'a1.*-self\\.exp' $"\
+ -re "^file ${srcdir}/gdb.base/.*'selftest\\.exp' $"\
{ send_gdb "\n"
gdb_expect {
-re "\r\nA program is being debugged already\\. Kill it\\? \\(y or n\\) $"
@@ -544,17 +544,17 @@ gdb_expect {
{ send_gdb "n\n"
gdb_expect {
-re "\r\nProgram not killed\\.\r\n$gdb_prompt $"\
- { pass "complete 'file gdb.base/a1'"}
- -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/a1'"}
- timeout {fail "(timeout) complete 'file gdb.base/a1'"}
+ { pass "complete 'file gdb.base/self'"}
+ -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/self'"}
+ timeout {fail "(timeout) complete 'file gdb.base/self'"}
}
}
- -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/a1'"}
- timeout {fail "(timeout) complete 'file gdb.base/a1'"}
+ -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/self'"}
+ timeout {fail "(timeout) complete 'file gdb.base/self'"}
}
}
- -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/a1'" }
- timeout { fail "(timeout) complete 'file gdb.base/a1'" }
+ -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/self'" }
+ timeout { fail "(timeout) complete 'file gdb.base/self'" }
}
diff --git a/gdb/testsuite/gdb.base/condbreak.exp b/gdb/testsuite/gdb.base/condbreak.exp
index 8f8f11c9cf2..8ec8536cad9 100644
--- a/gdb/testsuite/gdb.base/condbreak.exp
+++ b/gdb/testsuite/gdb.base/condbreak.exp
@@ -151,8 +151,7 @@ gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$sr
#
# run until the breakpoint at marker2
#
-#See 11512CLLbs
-setup_xfail hppa2.0w-*-*
+setup_xfail hppa2.0w-*-* 11512CLLbs
gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile:4\[49\].*4\[49\]\[\t \]+.*" \
"run until breakpoint at marker2"
diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
index b2677306dd5..32f3f56b8ac 100644
--- a/gdb/testsuite/gdb.base/corefile.exp
+++ b/gdb/testsuite/gdb.base/corefile.exp
@@ -217,8 +217,7 @@ gdb_expect {
# test reinit_frame_cache
gdb_load ${binfile}
-# HP defect CLLbs17002
-setup_xfail "*-*-*"
+setup_xfail "*-*-*" CLLbs17002
gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\)" "up in corefile.exp (reinit)"
gdb_test "core" "No core file now."
diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp
index 59ac18d2109..760a2e0a21e 100644
--- a/gdb/testsuite/gdb.base/display.exp
+++ b/gdb/testsuite/gdb.base/display.exp
@@ -48,13 +48,13 @@ gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
# Some coverage stuff
#
-gdb_test "kill" ".*The program is not being run.*" ""
-gdb_test "detach" ".*" ""
-gdb_test "run" ".*" ""
+gdb_test "kill" ".*The program is not being run.*"
+gdb_test "detach" ".*"
+gdb_test "run" ".*"
gdb_load ${binfile}
-gdb_test "kill" ".*" ""
-gdb_test "detach" ".*" ""
+gdb_test "kill" ".*"
+gdb_test "detach" ".*"
# Ok, on to real life
#
@@ -85,8 +85,8 @@ gdb_test "c" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f sum = 1
gdb_test "c" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f sum = 2.80259693e.45\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0.*\[1-9\]*: i = 0.*" "second disp"
gdb_test "enab disp 6" ".*No display number 6..*" "catch err"
-gdb_test "disab disp 1" ".*" "disab"
-gdb_test "disab disp 2" ".*" ""
+gdb_test "disab disp 1" ".*" "disab disp 1"
+gdb_test "disab disp 2" ".*" "disab disp 2"
gdb_test "enab disp 1" ".*" "re-enab"
gdb_test "enab disp 1" ".*" "re-enab of enab"
gdb_test "undisp 5" ".*" "undisp"
@@ -117,46 +117,50 @@ gdb_expect {
timeout { fail "timeout" }
}
-gdb_test "disab 3" ".*.*" ""
+gdb_test "disab 3" ".*.*" "disab 3"
gdb_test "c" ".*Breakpoint 4.*" "watch off"
# Now the printf tests
#
gdb_test "fin" ".*Run till exit.*Value returned is.*= 10.*" "finish"
-gdb_test "s" ".*do_vars.*.*25" ""
-gdb_test "tb 35" ".*Breakpoint 5 a.*" ""
-gdb_test "c" ".*do_vars.*35.*35.*" ""
+gdb_test "s" ".*do_vars.*.*27.*"
+gdb_test "tb 37" ".*Breakpoint 5 a.*"
+gdb_test "c" ".*do_vars.*37.*37.*"
# Beat on printf a bit
#
-gdb_test "printf" ".*Argument required.*" ""
-gdb_test "printf %d" ".*Bad format string, missing.*" ""
-gdb_test "printf \"%d" ".*Bad format string, non-terminated.*" ""
-gdb_test "printf \"%d%d\",i" ".*Wrong number of arguments.*" ""
-gdb_test "printf \"\\\\!\\a\\f\\r\\t\\v\\b\"" ".*!.*" ""
+gdb_test "printf" ".*Argument required.*"
+gdb_test "printf %d" ".*Bad format string, missing.*"
+gdb_test "printf \"%d" ".*Bad format string, non-terminated.*"
+gdb_test "printf \"%d%d\",i" ".*Wrong number of arguments.*"
+gdb_test "printf \"\\\\!\\a\\f\\r\\t\\v\\b\"" ".*!.*"
gdb_test "printf \"\"" ".*" "re-set term"
-gdb_test "printf \"\\w\"" ".*Unrecognized escape character.*" ""
-gdb_test "printf \"%d\" j" ".*Invalid argument syntax.*" ""
+gdb_test "printf \"\\w\"" ".*Unrecognized escape character.*"
+gdb_test "printf \"%d\" j" ".*Invalid argument syntax.*"
# play with "p", too
#
-gdb_test "p/r j" ".*Undefined output format.*" ""
+gdb_test "p/r j" ".*Undefined output format.*"
gdb_test "p j" ".*" "debug test output"
-#gdb_test "x/rx j" ".*Cannot access memory.*" "no error!"
+
# x/0 j doesn't produce any output and terminates PA64 process when testing
-if [istarget "hppa*-hp-hpux11*"] {
- xfail "'x/0 j' terminate PA64 process - skipped test point"
+if [istarget "hppa2.0w-hp-hpux11*"] {
+ xfail "'x/0 j' terminates PA64 process - skipped test point"
} else {
- gdb_test "x/0 j" ".*" "x/0 j"
+ gdb_test "x/0 j" ".*"
+}
+if [istarget "hppa*-hp-hpux*"] {
+ # on HP-UX you could access the first page without getting an error
+ gdb_test "x/rx j" ".*(Cannot access|Error accessing) memory.*|.*0xa:\[ \t\]*\[0-9\]+.*"
}
gdb_test "p/0 j" ".*Item count other than 1 is meaningless.*" "p/0 j"
gdb_test "p/s sum" ".*Format letter.*is meaningless.*" " no s"
gdb_test "p/i sum" ".*Format letter.*is meaningless.*.*" "no i"
-gdb_test "p/a &sum" ".*= 0x.*<sum>.*" ""
-gdb_test "p/a main+1000" ".*= 0x.*<.*>.*" ""
-gdb_test "p/a \\\$pc" ".*= 0x.*<do_vars+.*>.*" ""
-gdb_test "p/a &j" ".*= 0x.*<.*>.*" ""
-gdb_test "p/a &&j" ".*A syntax error.*" ""
+gdb_test "p/a &sum" ".*= $hex.*<sum>.*"
+gdb_test "p/a main+1000" ".*= $hex.*<.*>.*"
+gdb_test "p/a \$pc" ".*= $hex.*<do_vars+.*>.*"
+gdb_test "p/a &j" ".*= $hex.*<do_vars+.*>.*"
+gdb_test "p/a &&j" ".*A parse error.*"
# Done!
#
diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp
index e36c975bfd1..790a98c06cc 100644
--- a/gdb/testsuite/gdb.base/ending-run.exp
+++ b/gdb/testsuite/gdb.base/ending-run.exp
@@ -52,19 +52,19 @@ gdb_load ${binfile}
# to the prolog--that's another bug...)
#
gdb_test "b 1" ".*Breakpoint.*line 1.*" "bpt at line before routine"
-gdb_test "b 13" ".*Note.*also.*Breakpoint.*2.*" ""
+gdb_test "b 13" ".*Note.*also.*Breakpoint.*2.*"
# Set up to go to the next-to-last line of the program
#
-gdb_test "b 31" ".*Breakpoint.*3.*" ""
+gdb_test "b 31" ".*Breakpoint.*3.*"
# Expect to hit the bp at line "1", but symbolize this
# as line "13". Then try to clear it--this should work.
#
if [target_info exists use_gdb_stub] {
- gdb_test "continue" ".*Breakpoint.*1.*callee.*13.*" ""
+ gdb_test "continue" ".*Breakpoint.*1.*callee.*13.*"
} else {
- gdb_test "r" ".*Breakpoint.*1.*callee.*13.*" ""
+ gdb_test "r" ".*Breakpoint.*1.*callee.*13.*"
}
gdb_test "cle" ".*Deleted breakpoints 2 1.*" "clear worked"
send_gdb "i b\n"
@@ -76,15 +76,15 @@ gdb_expect {
# Test some other "clear" combinations
#
-gdb_test "b 1" ".*Breakpoint.*4.*" ""
-gdb_test "b 13" ".*Note.*also.*Breakpoint.*5.*" ""
+gdb_test "b 1" ".*Breakpoint.*4.*"
+gdb_test "b 13" ".*Note.*also.*Breakpoint.*5.*"
gdb_test "cle 13" ".*Deleted breakpoint 5.*" "Only cleared 1 by line"
send_gdb "inf line 13\n"
gdb_expect {
-re ".*address (0x\[0-9a-fA-F]*).*$gdb_prompt $" {
set line_eight $expect_out(1,string)
- gdb_test "b 13" ".*Breakpoint.*6.*" ""
+ gdb_test "b 13" ".*Breakpoint.*6.*"
gdb_test "cle *$line_eight" ".*Deleted breakpoints 6 4.*" "Clear 2 by address"
}
-re ".*$gdb_prompt $" {
@@ -96,9 +96,9 @@ send_gdb "inf line 14\n"
gdb_expect {
-re ".*address (0x\[0-9a-fA-F]*).*$gdb_prompt $" {
set line_nine $expect_out(1,string)
- gdb_test "b 14" ".*Breakpoint.*7.*" ""
- gdb_test "b *$line_nine" ".*Note.*also.*Breakpoint.*8.*" ""
- gdb_test "c" ".*Breakpoint.*7.*callee.*14.*" ""
+ gdb_test "b 14" ".*Breakpoint.*7.*"
+ gdb_test "b *$line_nine" ".*Note.*also.*Breakpoint.*8.*"
+ gdb_test "c" ".*Breakpoint.*7.*callee.*14.*"
gdb_test "cle" ".*Deleted breakpoints 8 7.*" "Clear 2 by default"
}
-re ".*$gdb_prompt $" {
@@ -123,7 +123,7 @@ gdb_expect {
# See if we can step out with control. The "1 2 3" stuff
# is output from the program.
#
-gdb_test "cont" ".*Breakpoint.*32.*" ""
+gdb_test "cont" ".*Breakpoint.*31.*"
gdb_test "next" ".*1 2 7 14 23 34 47 62 79 Goodbye!.*32.*" "Step to return"
set old_timeout $timeout
diff --git a/gdb/testsuite/gdb.base/foll-exec.exp b/gdb/testsuite/gdb.base/foll-exec.exp
index 260a7d8f5d7..c4d62a58972 100644
--- a/gdb/testsuite/gdb.base/foll-exec.exp
+++ b/gdb/testsuite/gdb.base/foll-exec.exp
@@ -209,7 +209,7 @@ proc do_exec_tests {} {
# DTS CLLbs16760
# PA64 doesn't know about $START$ in dld.sl at this point. It should.
# - Michael Coulter
- setup_xfail hppa2.0w-hp-hpux*
+ setup_xfail hppa2.0w-hp-hpux* CLLbs16760
send_gdb "continue\n"
gdb_expect {
-re ".*Executing new program:.*${testfile2}.*Catchpoint .*(exec\'d .*${testfile2}).*in .START..*$gdb_prompt $"\
diff --git a/gdb/testsuite/gdb.base/foll-vfork.exp b/gdb/testsuite/gdb.base/foll-vfork.exp
index b25bf56e83a..60f8f1f87f6 100644
--- a/gdb/testsuite/gdb.base/foll-vfork.exp
+++ b/gdb/testsuite/gdb.base/foll-vfork.exp
@@ -79,7 +79,7 @@ proc vfork_parent_follow_through_step {} {
}
send_gdb "next\n"
gdb_expect {
- -re "Detaching after fork from.*13.*$gdb_prompt $"\
+ -re "Detaching after fork from.*13.*$gdb_prompt "\
{pass "vfork parent follow, through step"}
-re "$gdb_prompt $" {fail "vfork parent follow, through step"}
timeout {fail "(timeout) vfork parent follow, through step" }
@@ -106,7 +106,7 @@ proc vfork_parent_follow_to_bp {} {
}
send_gdb "continue\n"
gdb_expect {
- -re ".*Detaching after fork from process.*Breakpoint.*18.*$gdb_prompt $"\
+ -re ".*Detaching after fork from process.*Breakpoint.*18.*$gdb_prompt "\
{pass "vfork parent follow, to bp"}
-re "$gdb_prompt $" {fail "vfork parent follow, to bp"}
timeout {fail "(timeout) vfork parent follow, to bp" }
@@ -129,7 +129,7 @@ proc vfork_and_exec_child_follow_to_main_bp {} {
}
send_gdb "continue\n"
gdb_expect {
- -re "Detaching from program.*Attaching after fork to.*Executing new program.*Breakpoint.*vforked-prog.c:9.*$gdb_prompt $"\
+ -re "Detaching from program.*Attaching after fork to.*Executing new program.*Breakpoint.*vforked-prog.c:9.*$gdb_prompt "\
{pass "vfork and exec child follow, to main bp"}
-re "$gdb_prompt $" {fail "vfork and exec child follow, to main bp"}
timeout {fail "(timeout) vfork and exec child follow, to main bp" }
@@ -175,7 +175,7 @@ proc vfork_and_exec_child_follow_through_step {} {
# the implementation of "next" sets a "step resume" breakpoint at the
# return from the vfork(), which the child will hit on its way to exec'ing.
#
- if { ![istarget "hppa*-*-hpux10.30"] && ![istarget "hppa*-*-hpux11.*"] } {
+ if { ![istarget "hppa*-*-hpux11.*"] } {
verbose "vfork child-following next test ignored for non-hppa or pre-HP/UX-10.30 targets."
return 0
}
@@ -187,7 +187,7 @@ proc vfork_and_exec_child_follow_through_step {} {
}
send_gdb "next\n"
gdb_expect {
- -re "Detaching from program.*Attaching after fork to.*Executing new program.*Breakpoint.*vforked-prog.c:9.*$gdb_prompt $"\
+ -re "Detaching from program.*Attaching after fork to.*Executing new program.*Breakpoint.*vforked-prog.c:9.*$gdb_prompt "\
{pass "vfork and exec child follow, through step"}
-re "$gdb_prompt $" {fail "vfork and exec child follow, through step"}
timeout {fail "(timeout) vfork and exec child follow, through step" }
@@ -242,16 +242,16 @@ proc tcatch_vfork_then_parent_follow {} {
# HP-UX 10.20 seems to stop you in "vfork", while more recent HP-UXs
# stop you in "_vfork".
gdb_expect {
- -re "0x\[0-9a-fA-F\]*.*vfork.*$gdb_prompt $"\
+ -re "0x\[0-9a-fA-F\]*.*vfork.*$gdb_prompt "\
{pass "vfork parent follow, tcatch vfork"}
- -re "0x\[0-9a-fA-F\]*.*_vfork.*$gdb_prompt $"\
+ -re "0x\[0-9a-fA-F\]*.*_vfork.*$gdb_prompt "\
{pass "vfork parent follow, tcatch vfork"}
-re "$gdb_prompt $" {fail "vfork parent follow, tcatch vfork"}
timeout {fail "(timeout) vfork parent follow, tcatch vfork"}
}
send_gdb "finish\n"
gdb_expect {
- -re "Run till exit from.*vfork.*0x\[0-9a-fA-F\]* in main .* at .*${srcfile}:12.*$gdb_prompt $"\
+ -re "Run till exit from.*vfork.*0x\[0-9a-fA-F\]* in main .* at .*${srcfile}:12.*$gdb_prompt "\
{pass "vfork parent follow, finish after tcatch vfork"}
-re "$gdb_prompt $" {fail "vfork parent follow, finish after tcatch vfork"}
timeout {fail "(timeout) vfork parent follow, finish after tcatch vfork" }
@@ -283,16 +283,16 @@ proc tcatch_vfork_then_child_follow {} {
# HP-UX 10.20 seems to stop you in "vfork", while more recent HP-UXs
# stop you in "_vfork".
gdb_expect {
- -re "0x\[0-9a-fA-F\]*.*vfork.*$gdb_prompt $"\
+ -re "0x\[0-9a-fA-F\]*.*vfork.*$gdb_prompt "\
{pass "vfork child follow, tcatch vfork"}
- -re "0x\[0-9a-fA-F\]*.*_vfork.*$gdb_prompt $"\
+ -re "0x\[0-9a-fA-F\]*.*_vfork.*$gdb_prompt "\
{pass "vfork child follow, tcatch vfork"}
-re "$gdb_prompt $" {fail "vfork child follow, tcatch vfork"}
timeout {fail "(timeout) vfork child follow, tcatch vfork"}
}
send_gdb "finish\n"
gdb_expect {
- -re "Run till exit from.*vfork.*${srcfile2}:9.*$gdb_prompt $"\
+ -re "Run till exit from.*vfork.*${srcfile2}:9.*$gdb_prompt "\
{pass "vfork child follow, finish after tcatch vfork"}
-re "$gdb_prompt $" {fail "vfork child follow, finish after tcatch vfork"}
timeout {fail "(timeout) vfork child follow, finish after tcatch vfork" }
diff --git a/gdb/testsuite/gdb.base/gdbvars.exp b/gdb/testsuite/gdb.base/gdbvars.exp
index 2ab37e0222f..9678df6bb6e 100644
--- a/gdb/testsuite/gdb.base/gdbvars.exp
+++ b/gdb/testsuite/gdb.base/gdbvars.exp
@@ -84,7 +84,7 @@ proc test_value_history {} {
gdb_test "print \$0" "\\\$8 = 102" \
"Print value-history\[MAX\] using explicit index \$0"
- gdb_test "print 108" "\\\$9 = 108" ""
+ gdb_test "print 108" "\\\$9 = 108"
gdb_test "print \$\$0" "\\\$10 = 108" \
"Print value-history\[MAX\] using explicit index \$\$0"
diff --git a/gdb/testsuite/gdb.base/interrupt.exp b/gdb/testsuite/gdb.base/interrupt.exp
index 379df02bc51..c2ad284f8e3 100644
--- a/gdb/testsuite/gdb.base/interrupt.exp
+++ b/gdb/testsuite/gdb.base/interrupt.exp
@@ -110,7 +110,7 @@ if ![file exists $binfile] then {
# terminates the program. A defect is pending on this
# issue [defect #DTS CHFts24203]. Hence calling setup_xfail
# below.
- setup_xfail "hppa*-*-*11*"
+ setup_xfail "hppa*-*-*11*" CHFts24203
fail "call function when asleep (wrong output)"
}
default {
diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp
index d77ce53962d..f319ba07c94 100644
--- a/gdb/testsuite/gdb.base/list.exp
+++ b/gdb/testsuite/gdb.base/list.exp
@@ -282,6 +282,48 @@ proc test_list_forward {} {
gdb_stop_suppressing_tests;
}
+# Test that repeating the list linenum command doesn't print the same
+# lines over again. Note that this test makes sure that the argument
+# linenum is dropped, when we repeat the previous command. 'x/5i $pc'
+# works the same way.
+
+proc test_repeat_list_command {} {
+ global gdb_prompt
+
+ set testcnt 0
+
+ send_gdb "list list0.c:10\n"
+ gdb_expect {
+ -re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list list0.c:10" ; gdb_suppress_tests }
+ timeout { fail "list list0.c:10 (timeout)" ; gdb_suppress_tests }
+ }
+
+ send_gdb "\n"
+ gdb_expect {
+ -re "15\[ \t\]+foo \[(\]+.*\[)\]+;.*24\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list 15-24" ; gdb_suppress_tests }
+ timeout { fail "list 15-24 (timeout)" ; gdb_suppress_tests }
+ }
+
+ send_gdb "\n"
+ gdb_expect {
+ -re "25\[ \t\]+foo \[(\]+.*\[)\]+;.*34\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list 25-34" ; gdb_suppress_tests }
+ timeout { fail "list 25-34 (timeout)" ; gdb_suppress_tests }
+ }
+
+ send_gdb "\n"
+ gdb_expect {
+ -re "35\[ \t\]+foo \\(.*\\);.*42\[ \t\]+.*\}\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list 35-42" ; gdb_suppress_tests }
+ timeout { fail "list 35-42 (timeout)" ; gdb_suppress_tests }
+ }
+
+ pass "repeat list commands to page forward using 'return' ($testcnt tests)"
+ gdb_stop_suppressing_tests;
+}
+
proc test_list_backwards {} {
global gdb_prompt
@@ -513,6 +555,7 @@ if [ set_listsize 10 ] then {
test_list_function
test_list_forward
test_list_backwards
+ test_repeat_list_command
test_list_range
test_list_filename_and_function
test_forward_search
diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp
index 52e6ff593a5..07006b653a6 100644
--- a/gdb/testsuite/gdb.base/long_long.exp
+++ b/gdb/testsuite/gdb.base/long_long.exp
@@ -79,84 +79,84 @@ gdb_test "p/d dec" ".*-6101065172474983726.*" "decimal print p/d"
# Try all the combinations to bump up coverage.
#
-gdb_test "p/d oct" ".*12046818088235383159.*" ""
-gdb_test "p/u oct" ".*12046818088235383159.*" ""
-gdb_test "p/o oct" ".*.*" ""
-gdb_test "p/t oct" ".*1010011100101110111001010011100101110111000001010011100101110111.*" ""
-gdb_test "p/a oct" ".*0x.*77053977.*" ""
-gdb_test "p/c oct" ".*'w'.*" ""
-gdb_test "p/f oct" ".*-5.9822653797615723e-120.*" ""
-
-gdb_test "p/d *(int *)&oct" ".*-1490098887.*" ""
-gdb_test "p/u *(int *)&oct" ".*2804868409.*" ""
-gdb_test "p/o *(int *)&oct" ".*024713562471.*" ""
-gdb_test "p/t *(int *)&oct" ".*10100111001011101110010100111001.*" ""
-gdb_test "p/a *(int *)&oct" ".*0xf*a72ee539.*" ""
-gdb_test "p/c *(int *)&oct" ".*57 '9'.*" ""
-gdb_test "p/f *(int *)&oct" ".*-2.42716126e-15.*" ""
-
-gdb_test "p/d *(short *)&oct" ".*-22738.*" ""
-gdb_test "p/u *(short *)&oct" ".*42798.*" ""
-gdb_test "p/o *(short *)&oct" ".*0123456.*" ""
-gdb_test "p/t *(short *)&oct" ".*1010011100101110.*" ""
-gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*" ""
-gdb_test "p/c *(short *)&oct" ".* 46 '.'.*" ""
-gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*" ""
-gdb_test "p/f *(short *)&oct" ".*-22738.*" ""
-
-gdb_test "x/x &oct" ".*0xa72ee539.*" ""
-gdb_test "x/d &oct" ".*.-1490098887*" ""
-gdb_test "x/u &oct" ".*2804868409.*" ""
-gdb_test "x/o &oct" ".*024713562471.*" ""
-gdb_test "x/t &oct" ".*10100111001011101110010100111001.*" ""
-gdb_test "x/a &oct" ".*0xa72ee539.*" ""
-gdb_test "x/c &oct" ".*-89 '\\\\247'.*" ""
-gdb_test "x/f &oct" ".*-5.9822653797615723e-120.*" ""
-
-gdb_test "x/2x &oct" ".*.*" ""
-gdb_test "x/2d &oct" ".*.*" ""
-gdb_test "x/2u &oct" ".*.*" ""
-gdb_test "x/2o &oct" ".*.*" ""
-gdb_test "x/2t &oct" ".*.*" ""
-gdb_test "x/2a &oct" ".*.*" ""
-gdb_test "x/2c &oct" ".*.*" ""
-gdb_test "x/2f &oct" ".*.*" ""
-
-gdb_test "x/2bx &oct" ".*.*" ""
-gdb_test "x/2bd &oct" ".*.*" ""
-gdb_test "x/2bu &oct" ".*.*" ""
-gdb_test "x/2bo &oct" ".*.*" ""
-gdb_test "x/2bt &oct" ".*.*" ""
-gdb_test "x/2ba &oct" ".*.*" ""
-gdb_test "x/2bc &oct" ".*.*" ""
-gdb_test "x/2bf &oct" ".*.*" ""
-
-gdb_test "x/2hx &oct" ".*.*" ""
-gdb_test "x/2hd &oct" ".*.*" ""
-gdb_test "x/2hu &oct" ".*.*" ""
-gdb_test "x/2ho &oct" ".*.*" ""
-gdb_test "x/2ht &oct" ".*.*" ""
-gdb_test "x/2ha &oct" ".*.*" ""
-gdb_test "x/2hc &oct" ".*.*" ""
-gdb_test "x/2hf &oct" ".*.*" ""
-
-gdb_test "x/2wx &oct" ".*.*" ""
-gdb_test "x/2wd &oct" ".*.*" ""
-gdb_test "x/2wu &oct" ".*.*" ""
-gdb_test "x/2wo &oct" ".*.*" ""
-gdb_test "x/2wt &oct" ".*.*" ""
-gdb_test "x/2wa &oct" ".*.*" ""
-gdb_test "x/2wc &oct" ".*.*" ""
-gdb_test "x/2wf &oct" ".*.*" ""
-
-gdb_test "x/2gx &oct" ".*.*" ""
-gdb_test "x/2gd &oct" ".*.*" ""
-gdb_test "x/2gu &oct" ".*.*" ""
-gdb_test "x/2go &oct" ".*.*" ""
-gdb_test "x/2gt &oct" ".*.*" ""
-gdb_test "x/2ga &oct" ".*.*" ""
-gdb_test "x/2gc &oct" ".*.*" ""
-gdb_test "x/2gf &oct" ".*.*" ""
+gdb_test "p/d oct" ".*-6399925985474168457.*"
+gdb_test "p/u oct" ".*12046818088235383159.*"
+gdb_test "p/o oct" ".*.*"
+gdb_test "p/t oct" ".*1010011100101110111001010011100101110111000001010011100101110111.*"
+gdb_test "p/a oct" ".*0x.*77053977.*"
+gdb_test "p/c oct" ".*'w'.*"
+gdb_test "p/f oct" ".*-5.9822653797615723e-120.*"
+
+gdb_test "p/d *(int *)&oct" ".*-1490098887.*"
+gdb_test "p/u *(int *)&oct" ".*2804868409.*"
+gdb_test "p/o *(int *)&oct" ".*024713562471.*"
+gdb_test "p/t *(int *)&oct" ".*10100111001011101110010100111001.*"
+gdb_test "p/a *(int *)&oct" ".*0xf*a72ee539.*"
+gdb_test "p/c *(int *)&oct" ".*57 '9'.*"
+gdb_test "p/f *(int *)&oct" ".*-2.42716126e-15.*"
+
+gdb_test "p/d *(short *)&oct" ".*-22738.*"
+gdb_test "p/u *(short *)&oct" ".*42798.*"
+gdb_test "p/o *(short *)&oct" ".*0123456.*"
+gdb_test "p/t *(short *)&oct" ".*1010011100101110.*"
+gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*"
+gdb_test "p/c *(short *)&oct" ".* 46 '.'.*"
+gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*"
+gdb_test "p/f *(short *)&oct" ".*-22738.*"
+
+gdb_test "x/x &oct" ".*0xa72ee539.*"
+gdb_test "x/d &oct" ".*.-1490098887*"
+gdb_test "x/u &oct" ".*2804868409.*"
+gdb_test "x/o &oct" ".*024713562471.*"
+gdb_test "x/t &oct" ".*10100111001011101110010100111001.*"
+gdb_test "x/a &oct" ".*0xa72ee539.*"
+gdb_test "x/c &oct" ".*-89 '\\\\247'.*"
+gdb_test "x/f &oct" ".*-5.9822653797615723e-120.*"
+
+gdb_test "x/2x &oct" ".*.*"
+gdb_test "x/2d &oct" ".*.*"
+gdb_test "x/2u &oct" ".*.*"
+gdb_test "x/2o &oct" ".*.*"
+gdb_test "x/2t &oct" ".*.*"
+gdb_test "x/2a &oct" ".*.*"
+gdb_test "x/2c &oct" ".*.*"
+gdb_test "x/2f &oct" ".*.*"
+
+gdb_test "x/2bx &oct" ".*.*"
+gdb_test "x/2bd &oct" ".*.*"
+gdb_test "x/2bu &oct" ".*.*"
+gdb_test "x/2bo &oct" ".*.*"
+gdb_test "x/2bt &oct" ".*.*"
+gdb_test "x/2ba &oct" ".*.*"
+gdb_test "x/2bc &oct" ".*.*"
+gdb_test "x/2bf &oct" ".*.*"
+
+gdb_test "x/2hx &oct" ".*.*"
+gdb_test "x/2hd &oct" ".*.*"
+gdb_test "x/2hu &oct" ".*.*"
+gdb_test "x/2ho &oct" ".*.*"
+gdb_test "x/2ht &oct" ".*.*"
+gdb_test "x/2ha &oct" ".*.*"
+gdb_test "x/2hc &oct" ".*.*"
+gdb_test "x/2hf &oct" ".*.*"
+
+gdb_test "x/2wx &oct" ".*.*"
+gdb_test "x/2wd &oct" ".*.*"
+gdb_test "x/2wu &oct" ".*.*"
+gdb_test "x/2wo &oct" ".*.*"
+gdb_test "x/2wt &oct" ".*.*"
+gdb_test "x/2wa &oct" ".*.*"
+gdb_test "x/2wc &oct" ".*.*"
+gdb_test "x/2wf &oct" ".*.*"
+
+gdb_test "x/2gx &oct" ".*.*"
+gdb_test "x/2gd &oct" ".*.*"
+gdb_test "x/2gu &oct" ".*.*"
+gdb_test "x/2go &oct" ".*.*"
+gdb_test "x/2gt &oct" ".*.*"
+gdb_test "x/2ga &oct" ".*.*"
+gdb_test "x/2gc &oct" ".*.*"
+gdb_test "x/2gf &oct" ".*.*"
gdb_exit
return 0
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index 29e3134732b..b1f7c53f28d 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -92,10 +92,18 @@ match_max 6000
# so that branch will really never be covered in this tests here!!
#
+# guo: on linux this command output is huge. for some reason splitting up
+# the regexp checks works.
+#
send_gdb "maint check-symtabs\n"
gdb_expect {
- -re "^maint check-symtabs.*$gdb_prompt $"\
+ -re "^maint check-symtabs" {
+ gdb_expect {
+ -re "$gdb_prompt $" \
{ pass "maint check-symtabs" }
+ timeout { fail "(timeout) maint check-symtabs" }
+ }
+ }
-re ".*$gdb_prompt $" { fail "maint check-symtabs" }
timeout { fail "(timeout) maint check-symtabs" }
}
@@ -235,7 +243,9 @@ gdb_expect {
send_gdb "shell grep 'main.*function' psymbols_output\n"
gdb_expect {
-re ".main., function, $hex.*$gdb_prompt $"\
- { pass "maint print psymbols" }
+ { pass "maint print psymbols 1" }
+ -re ".*main. .., function, $hex.*$gdb_prompt $"\
+ { pass "maint print psymbols 2" }
-re ".*$gdb_prompt $" { fail "maint print psymbols" }
timeout { fail "(timeout) maint print psymbols" }
}
@@ -338,13 +348,18 @@ gdb_expect {
timeout { fail "(timeout) maint print type" }
}
-#send_gdb "maint print unwind &main\n"
-#gdb_expect {
-# -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+220>\r\n\tflags = Args_stored Save_RP\r\n\tRegion_description = $hex\r\n\tEntry_FR = $hex\r\n\tEntry_GR = $hex\r\n\tTotal_frame_size = $hex\r\n$gdb_prompt $"\
-# { pass "maint print unwind" }
-# -re ".*$gdb_prompt $" { fail "maint print unwind" }
-# timeout { fail "(timeout) maint print unwind" }
-# }
+if [istarget "hppa*-*-11*"] {
+ setup_xfail hppa*-*-*11* CLLbs14860
+ send "maint print unwind &main\n"
+ expect {
+ -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+\[0-9\]*>\r\n\tflags = Args_stored Save_RP\r\n\tRegion_description = $hex\r\n\tEntry_FR = $hex\r\n\tEntry_GR = $hex\r\n\tTotal_frame_size = $hex\r\n$gdb_prompt $"\
+ { pass "maint print unwind" }
+ -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+\[0-9\]*>\r\n\tflags = Args_stored Save_RP\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n$gdb_prompt $"\
+ { xfail "maint print unwind" }
+ -re ".*$gdb_prompt $" { xfail "maint info unwind" }
+ timeout { fail "(timeout) maint print unwind" }
+ }
+}
set oldtimeout $timeout
set timeout [expr $timeout + 300]
@@ -369,7 +384,7 @@ gdb_expect {
send_gdb "maint info breakpoints\n"
gdb_expect {
- -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:60\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\
+ -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\
{ pass "maint info breakpoints" }
-re ".*$gdb_prompt $" { fail "maint info breakpoints" }
timeout { fail "(timeout) maint info breakpoints" }
@@ -383,7 +398,9 @@ if {! ([istarget "hppa*-*-hpux*"]
}
send_gdb "maint info breakpoints\n"
gdb_expect {
- -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:60\r\n\[ \t\]+breakpoint already hit 1 time\r\n-1\[ \t\]+shlib events\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex.*breakpoint already hit.*$gdb_prompt $"\
+ -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\
+ { pass "maint info breakpoints" }
+ -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n-1\[ \t\]+shlib events\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex.*breakpoint already hit.*$gdb_prompt $"\
{ pass "maint info breakpoints: shlib events" }
-re ".*$gdb_prompt $" {
fail "maint info breakpoints: shlib events"
@@ -521,13 +538,15 @@ gdb_expect {
timeout { fail "(timeout) help maint print type" }
}
-#send_gdb "help maint print unwind\n"
-#gdb_expect {
-# -re "Print unwind table entry at given address\\..*$gdb_prompt $"\
-# { pass "help maint print unwind" }
-# -re ".*$gdb_prompt $" { fail "help maint print unwind" }
-# timeout { fail "(timeout) help maint print unwind" }
-# }
+if [istarget "hppa*-*-*"] {
+ send_gdb "help maint print unwind\n"
+ gdb_expect {
+ -re "Print unwind table entry at given address\\..*$gdb_prompt $"\
+ { pass "help maint print unwind" }
+ -re ".*$gdb_prompt $" { fail "help maint print unwind" }
+ timeout { fail "(timeout) help maint print unwind" }
+ }
+}
send_gdb "help maint info sections\n"
gdb_expect {
diff --git a/gdb/testsuite/gdb.base/pointers.c b/gdb/testsuite/gdb.base/pointers.c
index 60e6444e4a4..a6f0062dab7 100644
--- a/gdb/testsuite/gdb.base/pointers.c
+++ b/gdb/testsuite/gdb.base/pointers.c
@@ -74,6 +74,7 @@ int y;
int main ()
{
void dummy();
+ int more_code();
/* Ensure that malloc is a pointer type; avoid use of "void" and any include files. */
/* extern char *malloc();*/
diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp
index bccda66abc3..539f875b71c 100644
--- a/gdb/testsuite/gdb.base/pointers.exp
+++ b/gdb/testsuite/gdb.base/pointers.exp
@@ -62,7 +62,7 @@ if ![runto_main] then {
continue
}
-gdb_test "next" "" "continuing after dummy()"
+gdb_test "next " "more_code.*;" "continuing after dummy()"
#
diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
index cdbe56c9010..79c6bc68940 100644
--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -398,7 +398,7 @@ proc test_print_repeats_10 {} {
global gdb_prompt
for { set x 1; } { $x <= 16 } { incr x; } {
- gdb_test "set print elements $x" "" ""
+ gdb_test "set print elements $x" ""
for { set e 1; } { $e <= 16 } {incr e; } {
set v [expr $e - 1];
set command "p &ctable2\[${v}*16\]"
@@ -451,23 +451,23 @@ proc test_print_strings {} {
# Test that setting print elements unlimited doesn't completely suppress
# printing; this was a bug in older gdb's.
- gdb_test "set print elements 0" "" ""
+ gdb_test "set print elements 0" ""
gdb_test "p teststring" \
" = (.unsigned char .. )?\"teststring contents\"" "p teststring with elements set to 0"
- gdb_test "set print elements 1" "" ""
+ gdb_test "set print elements 1" ""
gdb_test "p teststring" \
" = (.unsigned char .. )?\"t\"\\.\\.\\." "p teststring with elements set to 1"
- gdb_test "set print elements 5" "" ""
+ gdb_test "set print elements 5" ""
gdb_test "p teststring" \
" = (.unsigned char .. )?\"tests\"\\.\\.\\." "p teststring with elements set to 5"
- gdb_test "set print elements 19" "" ""
+ gdb_test "set print elements 19" ""
gdb_test "p teststring" \
" = (.unsigned char .. )?\"teststring contents\"" "p teststring with elements set to 19"
- gdb_test "set print elements 20" "" ""
+ gdb_test "set print elements 20" ""
gdb_test "p teststring" \
" = (.unsigned char .. )?\"teststring contents\"" "p teststring with elements set to 20"
- gdb_test "set print elements 8" "" ""
+ gdb_test "set print elements 8" ""
gdb_test "p &ctable1\[0\]" \
" = \\(unsigned char \\*\\) \"\""
@@ -540,7 +540,7 @@ proc test_print_strings {} {
proc test_print_int_arrays {} {
global gdb_prompt
- gdb_test "set print elements 24" "" ""
+ gdb_test "set print elements 24" ""
gdb_test "p int1dim" \
" = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}"
@@ -566,8 +566,8 @@ proc test_print_char_arrays {} {
global gdb_prompt
global hex
- gdb_test "set print elements 24" "" ""
- gdb_test "set print address on" "" ""
+ gdb_test "set print elements 24" ""
+ gdb_test "set print address on" ""
gdb_test "p arrays" \
" = {array1 = \"abc\", array2 = \"d\", array3 = \"e\", array4 = \"fg\", array5 = \"hij\"}"
@@ -584,13 +584,13 @@ proc test_print_char_arrays {} {
gdb_test "p parrays->array5" " = \"hij\""
gdb_test "p &parrays->array5" " = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex"
- gdb_test "set print address off" "" ""
+ gdb_test "set print address off" ""
}
proc test_print_string_constants {} {
global gdb_prompt
- gdb_test "set print elements 50" "" ""
+ gdb_test "set print elements 50" ""
if [target_info exists gdb,cannot_call_functions] {
setup_xfail "*-*-*" 2416
@@ -677,7 +677,7 @@ gdb_test "print \$pc" "No registers\\."
gdb_load ${binfile}
gdb_test "set print sevenbit-strings" ""
-gdb_test "set print address off" "" ""
+gdb_test "set print address off" ""
gdb_test "set width 0" ""
if [set_lang_c] then {
diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp
index d36efec12c6..f5b45034245 100644
--- a/gdb/testsuite/gdb.base/ptype.exp
+++ b/gdb/testsuite/gdb.base/ptype.exp
@@ -129,7 +129,8 @@ gdb_test "ptype boolean" "type = enum (boolean |)\{FALSE, TRUE\}.*" "ptype unnam
# as (51) doesn't have a name. Only 55 has a name.
if {!$gcc_compiled && !$hp_aCC_compiler} {
- setup_xfail "rs6000-*-*" "i*86-*-sysv4*" "hppa*-*-*" # CLLbs14773
+ setup_xfail "rs6000-*-*" "i*86-*-sysv4*"
+ setup_xfail "hppa*-*-*" CLLbs14773
}
get_debug_format
setup_xfail_format "DWARF 1"
diff --git a/gdb/testsuite/gdb.base/scope.exp b/gdb/testsuite/gdb.base/scope.exp
index 708bc42ea1a..6c3f9f2f1ad 100644
--- a/gdb/testsuite/gdb.base/scope.exp
+++ b/gdb/testsuite/gdb.base/scope.exp
@@ -112,8 +112,7 @@ proc test_at_main {} {
# Print scope1.c::filelocal, which is 2
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
- #DTS 11747CLLbs
- if {$hp_cc_compiler} then { setup_xfail "hppa2.0w-*-*"}
+ if {$hp_cc_compiler} then { setup_xfail "hppa2.0w-*-*" 11747CLLbs}
if [gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"] {
gdb_suppress_tests ;
}
@@ -122,8 +121,7 @@ proc test_at_main {} {
# Print scope1.c::filelocal_bss, which is 102
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
- #DTS 11747CLLbs
- if {$hp_cc_compiler} then { setup_xfail "hppa2.0w-*-*"}
+ if {$hp_cc_compiler} then { setup_xfail "hppa2.0w-*-*" 11747CLLbs}
if [gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss"] {
gdb_suppress_tests ;
}
@@ -132,8 +130,7 @@ proc test_at_main {} {
# Print scope1.c::filelocal_ro, which is 202
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
- #DTS 11747CLLbs
- if {$hp_cc_compiler} then { setup_xfail "hppa2.0w-*-*"}
+ if {$hp_cc_compiler} then { setup_xfail "hppa2.0w-*-*" 11747CLLbs}
if [gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"] {
gdb_suppress_tests ;
}
diff --git a/gdb/testsuite/gdb.base/setvar.exp b/gdb/testsuite/gdb.base/setvar.exp
index ec217cf78c0..2c9b4162cb1 100644
--- a/gdb/testsuite/gdb.base/setvar.exp
+++ b/gdb/testsuite/gdb.base/setvar.exp
@@ -330,11 +330,11 @@ gdb_test "set v_unsigned_short_pointer=v_unsigned_short_array" ""
gdb_test "set variable *(v_unsigned_short_pointer)=123" ""
gdb_test "set variable *(v_unsigned_short_pointer+1)=-456" ""
# DTS 10060CLLbs - bad type info from cc
-if {$hp_cc_compiler} {setup_xfail hppa*-*-*11*}
+if {$hp_cc_compiler} {setup_xfail hppa*-*-*11* 10060CLLbs}
gdb_test "print v_unsigned_short_array" ".\[0-9\]* =.*\{123,.*65080\}" \
"set variable unsigned short pointer"
# DTS 10060CLLbs - bad type info from cc
-if {$hp_cc_compiler} {setup_xfail hppa*-*-*11*}
+if {$hp_cc_compiler} {setup_xfail hppa*-*-*11* 10060CLLbs}
gdb_test "print *(v_unsigned_short_pointer+1)" ".\[0-9\]* = 65080"
#
# test "set variable" for type "int *"
diff --git a/gdb/testsuite/gdb.base/signals.exp b/gdb/testsuite/gdb.base/signals.exp
index 6511b2e44fb..ad875cc1420 100644
--- a/gdb/testsuite/gdb.base/signals.exp
+++ b/gdb/testsuite/gdb.base/signals.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -184,7 +184,7 @@ proc signal_tests_1 {} {
# This doesn't test that main is frame #2, just that main is frame
# #2, #3, or higher. At some point this should be fixed (but
# it quite possibly would introduce new FAILs on some systems).
- setup_xfail "i*86-pc-linux-gnu*" "i*86-*-bsdi2.0"
+ setup_xfail "i*86-*-bsdi2.0"
gdb_test "backtrace 10" "#0.*handler.*#1.*#2.*main.*" \
"backtrace in signals_tests_1"
diff --git a/gdb/testsuite/gdb.base/structs.c b/gdb/testsuite/gdb.base/structs.c
index b44d2fea98f..82a537c88bc 100644
--- a/gdb/testsuite/gdb.base/structs.c
+++ b/gdb/testsuite/gdb.base/structs.c
@@ -102,68 +102,120 @@ struct struct16 fun16()
return foo16;
}
+#ifdef PROTOTYPES
+void Fun1(struct struct1 foo1)
+#else
void Fun1(foo1)
struct struct1 foo1;
+#endif
{
L1 = foo1;
}
+#ifdef PROTOTYPES
+void Fun2(struct struct2 foo2)
+#else
void Fun2(foo2)
struct struct2 foo2;
+#endif
{
L2 = foo2;
}
+#ifdef PROTOTYPES
+void Fun3(struct struct3 foo3)
+#else
void Fun3(foo3)
struct struct3 foo3;
+#endif
{
L3 = foo3;
}
+#ifdef PROTOTYPES
+void Fun4(struct struct4 foo4)
+#else
void Fun4(foo4)
struct struct4 foo4;
+#endif
{
L4 = foo4;
}
+#ifdef PROTOTYPES
+void Fun5(struct struct5 foo5)
+#else
void Fun5(foo5)
struct struct5 foo5;
+#endif
{
L5 = foo5;
}
+#ifdef PROTOTYPES
+void Fun6(struct struct6 foo6)
+#else
void Fun6(foo6)
struct struct6 foo6;
+#endif
{
L6 = foo6;
}
+#ifdef PROTOTYPES
+void Fun7(struct struct7 foo7)
+#else
void Fun7(foo7)
struct struct7 foo7;
+#endif
{
L7 = foo7;
}
+#ifdef PROTOTYPES
+void Fun8(struct struct8 foo8)
+#else
void Fun8(foo8)
struct struct8 foo8;
+#endif
{
L8 = foo8;
}
+#ifdef PROTOTYPES
+void Fun9(struct struct9 foo9)
+#else
void Fun9(foo9)
struct struct9 foo9;
+#endif
{
L9 = foo9;
}
+#ifdef PROTOTYPES
+void Fun10(struct struct10 foo10)
+#else
void Fun10(foo10)
struct struct10 foo10;
+#endif
{
L10 = foo10;
}
+#ifdef PROTOTYPES
+void Fun11(struct struct11 foo11)
+#else
void Fun11(foo11)
struct struct11 foo11;
+#endif
{
L11 = foo11;
}
+#ifdef PROTOTYPES
+void Fun12(struct struct12 foo12)
+#else
void Fun12(foo12)
struct struct12 foo12;
+#endif
{
L12 = foo12;
}
+#ifdef PROTOTYPES
+void Fun16(struct struct16 foo16)
+#else
void Fun16(foo16)
struct struct16 foo16;
+#endif
{
L16 = foo16;
}
diff --git a/gdb/testsuite/gdb.base/structs.exp b/gdb/testsuite/gdb.base/structs.exp
index 1c79af5b646..7f4556cabcb 100644
--- a/gdb/testsuite/gdb.base/structs.exp
+++ b/gdb/testsuite/gdb.base/structs.exp
@@ -127,9 +127,9 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
-gdb_test "set print sevenbit-strings" "" ""
-gdb_test "set print address off" "" ""
-gdb_test "set width 0" "" ""
+gdb_test "set print sevenbit-strings" ""
+gdb_test "set print address off" ""
+gdb_test "set width 0" ""
if [target_info exists gdb,cannot_call_functions] {
setup_xfail "*-*-*" 2416
diff --git a/gdb/testsuite/gdb.base/structs2.exp b/gdb/testsuite/gdb.base/structs2.exp
index 14652bef06c..d2924ea62f6 100644
--- a/gdb/testsuite/gdb.base/structs2.exp
+++ b/gdb/testsuite/gdb.base/structs2.exp
@@ -45,7 +45,7 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
-gdb_test "set width 0" "" ""
+gdb_test "set width 0" ""
if { ![runto_main] } then {
gdb_suppress_tests
diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp
index 7dced3b0e33..f9fda6559b2 100644
--- a/gdb/testsuite/gdb.base/watchpoint.exp
+++ b/gdb/testsuite/gdb.base/watchpoint.exp
@@ -79,9 +79,9 @@ proc initialize {} {
# ??rehrauer: To fix DTS #CHFts23014, in which setting a watchpoint
- # before running can cause the inferior to croak on HP-UX 10.30 and
- # 11.0 for reasons as yet unknown, we've disabled the ability to set
- # watches without a running inferior. Verify the restriction.
+ # before running can cause the inferior to croak on HP-UX 11.0 for
+ # reasons yet unknown, we've disabled the ability to set watches
+ # without a running inferior. Verify the restriction.
#
send_gdb "watch ival3\n"
gdb_expect {
@@ -157,8 +157,8 @@ proc test_simple_watchpoint {} {
if { !$wp_set } {
# ??rehrauer: To fix DTS #CHFts23014, in which setting a watchpoint
- # before running can cause the inferior to croak on HP-UX 10.30 and
- # 11.0 for reasons as yet unknown, we've disabled the ability to set
+ # before running can cause the inferior to croak on HP-UX 11.0
+ # for reasons yet unknown, we've disabled the ability to set
# watches without a running inferior. The following testpoints used
# to be in [initialize].
#
diff --git a/gdb/testsuite/gdb.base/whatis.exp b/gdb/testsuite/gdb.base/whatis.exp
index d540e4cd808..20cd67e287d 100644
--- a/gdb/testsuite/gdb.base/whatis.exp
+++ b/gdb/testsuite/gdb.base/whatis.exp
@@ -301,11 +301,10 @@ gdb_test "whatis v_union2" \
"whatis unnamed union"
-if { [istarget "hppa*-hp-hpux10.20"] && $hp_aCC_compiler } {
- # On HP-UX 10.20 with aCC compiler and objdebug mode,
- # we need the 'void' pattern; without objdebug mode,
- # we still need to '' pattern.
- # FIXME: need to look into this further.
+if { [istarget "hppa*-hp-hpux*"] && $hp_aCC_compiler } {
+ # HP-UX: HP aCC compiler w/ +objdebug option detects language as
+ # c++, so we need the 'void' pattern here.
+ # Without +objdebug compilation option we still need to match ''.
# - guo
set void "(void|)"
} else {
diff --git a/gdb/testsuite/gdb.c++/Makefile.in b/gdb/testsuite/gdb.c++/Makefile.in
index 5efba8d1617..58ef94bf233 100644
--- a/gdb/testsuite/gdb.c++/Makefile.in
+++ b/gdb/testsuite/gdb.c++/Makefile.in
@@ -1,17 +1,24 @@
VPATH = @srcdir@
srcdir = @srcdir@
-PROGS = annota2 anon-union compiler cplusfuncs derivation inherit local \
- member-ptr method misc \
- overload ovldbreak ref-types ref-types2 templates userdef virtfunc
+EXECUTABLES = ambiguous annota2 anon-union cplusfuncs cttiadd \
+ derivation inherit local member-ptr method misc \
+ overload ovldbreak ref-typ ref-typ2 templates userdef virtfunc
all:
@echo "Nothing to be done for all..."
-#### host, target, and site specific Makefile frags come in here.
+info:
+install-info:
+dvi:
+install:
+uninstall: force
+installcheck:
+check:
clean mostlyclean:
- -rm -f *.ci *.o ${OBJS} ${PROGS} *~ core
+ -rm -f *~ *.o *.ci
+ -rm -f core ${EXECUTABLES}
distclean maintainer-clean realclean: clean
-rm -f Makefile config.status config.log
diff --git a/gdb/testsuite/gdb.c++/annota2.exp b/gdb/testsuite/gdb.c++/annota2.exp
index aabc551f6fe..0a58cd4193d 100644
--- a/gdb/testsuite/gdb.c++/annota2.exp
+++ b/gdb/testsuite/gdb.c++/annota2.exp
@@ -95,8 +95,7 @@ gdb_expect {
send_gdb "run\n"
gdb_expect {
- -re "\r\n\032\032post-prompt\r\nStarting program: $binfile \(\r\n\r\n\032\032frames-invalid\)+\(\r\n\r\n\032\032breakpoints-invalid\)*.*\(\r\n\r\n\032\032frames-invalid\)*\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota2.cc\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
- { pass "run until main breakpoint" }
+ -re "$main_line.*$gdb_prompt$" { pass "run until main breakpoint" }
-re ".*$gdb_prompt$" { fail "run until main breakpoint" }
timeout { fail "run until main breakpoint (timeout)" }
}
@@ -135,7 +134,7 @@ gdb_expect {
#
send_gdb "delete\n"
gdb_expect {
- -re " " {
+ -re ".*Delete all breakpoints. \\(y or n\\) \r\n\032\032query.*$" {
send_gdb "y\n"
gdb_expect {
-re " " { pass "delete bps" }
@@ -166,10 +165,11 @@ set main_line 22
#
# run program up to breakpoint.
#
+
+
send_gdb "run\n"
gdb_expect {
- -re "\r\n\032\032post-prompt\r\n.*Starting program: $binfile \(\r\n\r\n\032\032frames-invalid\)+\(\r\n\r\n\032\032breakpoints-invalid\)*.*\(\r\n\r\n\032\032frames-invalid\)*\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota2.cc\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
- { pass "run until main breakpoint" }
+ -re "$main_line.*$gdb_prompt$" { pass "run until main breakpoint" }
-re ".*$gdb_prompt$" { fail "run until main breakpoint" }
timeout { fail "run until main breakpoint (timeout)" }
}
@@ -179,7 +179,7 @@ send_gdb "run\n"
#
send_gdb "watch a.x\n"
gdb_expect {
- -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\nWatchpoint 3: a.x\r\n$gdb_prompt$" \
+ -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\n.*atchpoint 3: a.x\r\n$gdb_prompt$" \
{ pass "set watch on a.x" }
-re ".*$gdb_prompt$" { fail "set watch on a.x" }
timeout { fail "set watch on a.x (timeout)" }
@@ -222,3 +222,4 @@ gdb_expect {
# reinstall the old prompt for the rest of the testsuite.
set gdb_prompt $old_gdb_prompt
+
diff --git a/gdb/testsuite/gdb.c++/anon-union.cc b/gdb/testsuite/gdb.c++/anon-union.cc
index c58a3068223..0b3fd130aeb 100644
--- a/gdb/testsuite/gdb.c++/anon-union.cc
+++ b/gdb/testsuite/gdb.c++/anon-union.cc
@@ -4,13 +4,13 @@ struct Foo {
int zero;
unsigned int one;
} num1;
-
- union {
- int pebble;
- struct {
+ struct X {
int rock;
unsigned int rock2;
- } x;
+ };
+ union {
+ int pebble;
+ X x;
union {
int qux;
unsigned int mux;
@@ -32,22 +32,23 @@ union Bar {
unsigned int y;
};
-Foo foo;
-Bar bar;
int main()
{
+ Foo foo = {0, 0};
+
foo.paper = 33;
foo.pebble = 44;
foo.mux = 55;
- bar.x = 33;
+ Bar bar = {0};
- union
- {
+ union {
int z;
unsigned int w;
- };
+ }; w = 0;
+
+ bar.x = 33;
w = 45;
diff --git a/gdb/testsuite/gdb.c++/anon-union.exp b/gdb/testsuite/gdb.c++/anon-union.exp
index 83171a27e85..5ed924f6cb4 100644
--- a/gdb/testsuite/gdb.c++/anon-union.exp
+++ b/gdb/testsuite/gdb.c++/anon-union.exp
@@ -76,6 +76,16 @@ gdb_expect -re "$gdb_prompt $"
# NOTE: Add -- ptype foo.x, etc. when things are working
+#Initialize foo
+send_gdb "next\n"
+gdb_expect {
+ -re "40\[ \t\]*foo.paper = 33;\r\n$gdb_prompt $" {
+ pass "next 1"
+ }
+ -re ".*$gdb_prompt $" { fail "next 1" }
+ timeout { fail "(timeout) next 1" }
+}
+
# Print out the big anon union.
send_gdb "print foo\n"
gdb_expect {
@@ -245,10 +255,10 @@ gdb_expect {
}
-# Step over next two assignments
-send_gdb "next 2\n"
+# Step over next four assignments
+send_gdb "next 4\n"
gdb_expect {
- -re "52\[ \t\]*w = 45;\r\n$gdb_prompt $" {
+ -re "53\[ \t\]*w = 45;\r\n$gdb_prompt $" {
pass "next 3"
}
-re ".*$gdb_prompt $" { fail "next 3" }
@@ -257,30 +267,28 @@ gdb_expect {
# Tests for anon unions that are not members of a class or struct
-# w is not yet initialized; it contains garbage
-#send_gdb "print w\n"
-#gdb_expect {
-# -re "\\$\[0-9\]* = 0\r\n$gdb_prompt $" {
-# pass "print w 1"
-# }
-# -re ".*$gdb_prompt $" { fail "print w 1" }
-# timeout { fail "(timeout) print w 1" }
-#}
-#
-# z is not yet initialized; it contains garbage
-#send_gdb "print z\n"
-#gdb_expect {
-# -re "\\$\[0-9\]* = 0\r\n$gdb_prompt $" {
-# pass "print z 1"
-# }
-# -re ".*$gdb_prompt $" { fail "print z 1" }
-# timeout { fail "(timeout) print z 1" }
-#}
+send_gdb "print w\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 0\r\n$gdb_prompt $" {
+ pass "print w 1"
+ }
+ -re ".*$gdb_prompt $" { fail "print w 1" }
+ timeout { fail "(timeout) print w 1" }
+}
+
+send_gdb "print z\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 0\r\n$gdb_prompt $" {
+ pass "print z 1"
+ }
+ -re ".*$gdb_prompt $" { fail "print z 1" }
+ timeout { fail "(timeout) print z 1" }
+}
# Step over next assignment to w
send_gdb "next\n"
gdb_expect {
- -re "54\[ \t\]*\}\r\n$gdb_prompt $" {
+ -re "55\[ \t\]*\}\r\n$gdb_prompt $" {
pass "next 4"
}
-re ".*$gdb_prompt $" { fail "next 4" }
diff --git a/gdb/testsuite/gdb.c++/classes.exp b/gdb/testsuite/gdb.c++/classes.exp
index 05a6cde088f..445f2e6ad2c 100644
--- a/gdb/testsuite/gdb.c++/classes.exp
+++ b/gdb/testsuite/gdb.c++/classes.exp
@@ -42,13 +42,6 @@ if [get_compiler_info ${binfile} "c++"] {
return -1
}
-# if we are on HPUX and we are not compiled with gcc, then skip these tests.
-
-if [istarget hppa*-*-hpux*] {
- if {!$gcc_compiled} {
- continue
- }
-}
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
@@ -142,6 +135,9 @@ proc test_ptype_class_objects {} {
-re "type = struct mixed_protection_struct \{${ws}int a;${ws}int b;${ws}private:${ws}int c;${ws}int d;${ws}protected:${ws}int e;${ws}int f;${ws}public:${ws}int g;${ws}private:${ws}int h;${ws}protected:${ws}int i;$nl\}$nl$gdb_prompt $" {
pass "ptype struct mixed_protection_struct (FIXME)"
}
+ -re "type = struct mixed_protection_struct \{${ws}public:${ws}int a;${ws}int b;${ws}private:${ws}int c;${ws}int d;${ws}protected:${ws}int e;${ws}int f;${ws}public:${ws}int g;${ws}private:${ws}int h;${ws}protected:${ws}int i;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype struct mixed_protection_struct (extra public)"
+ }
-re "type = class mixed_protection_struct \{${ws}public:${ws}int a;${ws}int b;${ws}private:${ws}int c;${ws}int d;${ws}protected:${ws}int e;${ws}int f;${ws}public:${ws}int g;${ws}private:${ws}int h;${ws}protected:${ws}int i;$nl.*\}$nl$gdb_prompt $" {
setup_xfail "*-*-*"
fail "ptype struct mixed_protection_struct (FIXME)"
@@ -203,6 +199,9 @@ proc test_ptype_class_objects {} {
-re "type = class explicit_private_class \{${ws}private:${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
pass "ptype class explicit_private_class"
}
+ -re "type = class explicit_private_class \{${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class explicit_private_class (OK for HP aCC)"
+ }
-re "type = struct explicit_private_class \{${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
setup_xfail "*-*-*"
fail "ptype class explicit_private_class"
@@ -340,6 +339,9 @@ proc test_ptype_class_objects {} {
setup_xfail "*-*-*"
fail "ptype class vB (FIXME: non-portable virtual table constructs)"
}
+ -re "type = class vB : public virtual vA \{${ws}public:${ws}int vb;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vB (aCC)"
+ }
-re "type = class vB : public virtual vA \{${ws}private:${ws}vA \\*_vb.vA;${ws}public:${ws}int vb;${ws}int vx;((${ws}vB & operator=\\(vB const &\\);)|(${ws}vB\\(int, vB const &\\);)|(${ws}vB\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
setup_xfail "*-*-*"
fail "ptype class vB (FIXME) (obsolescent gcc or gdb)"
@@ -364,6 +366,9 @@ proc test_ptype_class_objects {} {
setup_xfail "*-*-*"
fail "ptype class vC (FIXME: non-portable virtual table constructs)"
}
+ -re "type = class vC : public virtual vA \{${ws}public:${ws}int vc;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vC (aCC)"
+ }
-re "type = class vC : public virtual vA \{${ws}private:${ws}vA \\*_vb.vA;${ws}public:${ws}int vc;${ws}int vx;((${ws}vC & operator=\\(vC const &\\);)|(${ws}vC\\(int, vC const &\\);)|(${ws}vC\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
setup_xfail "*-*-*"
fail "ptype class vC (FIXME) (obsolescent gcc or gdb)"
@@ -388,6 +393,9 @@ proc test_ptype_class_objects {} {
setup_xfail "*-*-*"
fail "ptype class vD (FIXME: non-portable virtual table constructs)"
}
+ -re "type = class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vD (aCC)"
+ }
-re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \\*_vb.vC;${ws}vB \\*_vb.vB;${ws}public:${ws}int vd;${ws}int vx;((${ws}vD & operator=\\(vD const &\\);)|(${ws}vD\\(int, vD const &\\);)|(${ws}vD\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
setup_xfail "*-*-*"
fail "ptype class vD (FIXME) (obsolescent gcc or gdb)"
@@ -412,6 +420,9 @@ proc test_ptype_class_objects {} {
setup_xfail "*-*-*"
fail "ptype class vE (FIXME: non-portable virtual table constructs)"
}
+ -re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vE (aCC)"
+ }
-re "type = class vE : public virtual vD \{${ws}private:${ws}vD \\*_vb.vD;${ws}public:${ws}int ve;${ws}int vx;((${ws}vE & operator=\\(vE const &\\);)|(${ws}vE\\(int, vE const &\\);)|(${ws}vE\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
setup_xfail "*-*-*"
fail "ptype class vE (FIXME) (obsolescent gcc or gdb)"
@@ -446,6 +457,9 @@ proc test_ptype_class_objects {} {
setup_xfail_format "DWARF 1"
send_gdb "ptype class Foo\n"
gdb_expect {
+ -re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;\r\n${ws}Foo\\(int, int\\);${ws}int operator!.void.;${ws}operator int.void.;${ws}int times.int.;$nl\}$nl$gdb_prompt $" {
+ pass "ptype class Foo(aCC)"
+ }
-re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;${ws}Foo & operator=\\(Foo const &\\);${ws}Foo\\(Foo const &\\);${ws}Foo\\(int, int\\);${ws}int operator!\\(void\\);${ws}int operator int\\(void\\);${ws}int times\\(int\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype class Foo"
}
@@ -584,7 +598,7 @@ proc test_pointers_to_class_members {} {
timeout { fail "print (int)&Bar::y == 2*sizeof(int) (timeout)" ; return }
}
- send_gdb "next\n"
+ send_gdb "next 2\n"
setup_xfail "*-*-*"
gdb_expect {
-re "$decimal\[ \t\]+inheritance3 \[)(\]+;$nl$gdb_prompt $" {}
@@ -774,15 +788,15 @@ do_tests
# set a breakpoint and go there
-send_gdb "break 503\n"
+send_gdb "break 516\n"
gdb_expect {
- -re "Breakpoint \[0-9\] at.*$gdb_prompt $" { pass "set break 503" }
- -re "$gdb_prompt $" { fail "set break 503" }
- timeout { fail "(timeout) set break 503" }
+ -re "Breakpoint \[0-9\] at.*$gdb_prompt $" { pass "set break 516" }
+ -re "$gdb_prompt $" { fail "set break 516" }
+ timeout { fail "(timeout) set break 516" }
}
send_gdb "continue\n"
gdb_expect {
- -re "Continuing\\.\r\n\r\nBreakpoint \[0-9\]*, main....at.*misc\\.cc:503\r\n503.*\r\n$gdb_prompt $" { pass "continue" }
+ -re "Continuing\\.\r\n\r\nBreakpoint \[0-9\]*, main....at.*misc\\.cc:516\r\n516.*\r\n$gdb_prompt $" { pass "continue" }
-re "$gdb_prompt $" { fail "continue" }
timeout { fail "(timeout) continue" }
}
@@ -829,13 +843,17 @@ gdb_expect {
}
# ptype on the object
+# g++ is putting out the wrong debug info. This works with aCC
+if {!$hp_aCC_compiler} {setup_xfail "hppa*-*-*"}
send_gdb "ptype obj_with_enum\n"
gdb_expect {
- -re "type = class ClassWithEnum \\{\r\n\[ \t\]*public:\r\n\[ \t\]*enum ClassWithEnum::PrivEnum priv_enum;\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { pass "ptype obj_with_enum" }
+ -re "type = class ClassWithEnum \\{\r\n\[ \t\]*public:\r\n\[ \t\]*(enum |)ClassWithEnum::PrivEnum priv_enum;\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { pass "ptype obj_with_enum" }
-re "$gdb_prompt $" { fail "ptype obj_with_enum" }
timeout { fail "(timeout) ptype obj_with_enum" }
}
+# g++ is putting out the wrong debug info. This works with aCC
+if {!$hp_aCC_compiler} {setup_xfail "hppa*-*-*"}
send_gdb "print (ClassWithEnum::PrivEnum) 42\n"
gdb_expect {
-re "\\$\[0-9\]* = yellow.*$gdb_prompt $" { pass "print (ClassWithEnum::PrivEnum) 42" }
diff --git a/gdb/testsuite/gdb.c++/cplusfuncs.cc b/gdb/testsuite/gdb.c++/cplusfuncs.cc
index acb73b12af6..0c835ebf42a 100644
--- a/gdb/testsuite/gdb.c++/cplusfuncs.cc
+++ b/gdb/testsuite/gdb.c++/cplusfuncs.cc
@@ -36,7 +36,7 @@ public:
void operator || (foo&);
void operator ~ (void);
void operator -- (int);
- void operator -> (void);
+ foo* operator -> (void);
void operator -= (foo&);
void operator /= (foo&);
void operator <<= (foo&);
@@ -63,7 +63,7 @@ extern "C" {
};
#endif
-main () {
+int main () {
#ifdef usestubs
set_debug_traps();
breakpoint();
@@ -105,7 +105,7 @@ void foo::operator ^ (foo& afoo) { afoo.ifoo = 0; }
void foo::operator || (foo& afoo) { afoo.ifoo = 0; }
void foo::operator ~ (void) {}
void foo::operator -- (int ival) { ival = 0; }
-void foo::operator -> (void) {}
+foo* foo::operator -> (void) {return this;}
void foo::operator -= (foo& afoo) { afoo.ifoo = 0; }
void foo::operator /= (foo& afoo) { afoo.ifoo = 0; }
void foo::operator <<= (foo& afoo) { afoo.ifoo = 0; }
diff --git a/gdb/testsuite/gdb.c++/cplusfuncs.exp b/gdb/testsuite/gdb.c++/cplusfuncs.exp
index e36d3793447..16283f387e7 100644
--- a/gdb/testsuite/gdb.c++/cplusfuncs.exp
+++ b/gdb/testsuite/gdb.c++/cplusfuncs.exp
@@ -34,6 +34,10 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
+if {[get_compiler_info $binfile "c++"] == -1} {
+ return -1
+}
+
#
# Cause gdb to lookup a specific C++ function and print the demangled
# form.
@@ -44,7 +48,10 @@ proc info_func { regex demangled } {
send_gdb "info function $regex\n"
gdb_expect {
- -re "File .*:\r\n$demangled\r\n$gdb_prompt $" {
+ -re "File .*:\r\n$demangled\r\n.*$gdb_prompt $" {
+ pass "info function for \"$regex\""
+ }
+ -re "File .*:\r\nclass $demangled\r\n.*$gdb_prompt $" {
pass "info function for \"$regex\""
}
-re ".*$gdb_prompt $" {
@@ -125,7 +132,7 @@ proc test_lookup_operator_functions {} {
info_func "operator,(" "void foo::operator,\\(foo &\\);"
info_func "operator~(" "void foo::operator~\\(void\\);"
- info_func "operator delete(" "void foo::operator delete\\(void \\*\\);"
+ info_func "operator delete(" "void foo::operator delete\\(void \\*\\)(| static);"
info_func "operator/(" "void foo::operator/\\(foo &\\);"
info_func "operator==(" "void foo::operator==\\(foo &\\);"
info_func "operator^(" "void foo::operator\\^\\(foo &\\);"
@@ -146,14 +153,14 @@ proc test_lookup_operator_functions {} {
info_func "operator--(" "void foo::operator--\\(int\\);"
info_func "operator!=(" "void foo::operator!=\\(foo &\\);"
info_func "operator!(" "void foo::operator!\\(void\\);"
- info_func "operator new(" "void \\*foo::operator new\\(.*\\);"
+ info_func "operator new(" "void \\*foo::operator new\\(.*\\)(| static);"
info_func "operator||(" "void foo::operator\\|\\|\\(foo &\\);"
info_func "operator char \\*(" "char \\*foo::operator char \\*\\(void\\);"
info_func "operator int(" "int foo::operator int\\(void\\);"
info_func "operator|(" "void foo::operator\\|\\(foo &\\);"
info_func "operator+(" "void foo::operator\\+\\(foo &\\);"
info_func "operator++(" "void foo::operator\\+\\+\\(int\\);"
- info_func "operator->(" "void foo::operator->\\(void\\);"
+ info_func "operator->(" "foo \\*foo::operator->\\(void\\);"
info_func "operator->\\*(" "void foo::operator->\\*\\(foo &\\);"
info_func "operator>>(" "void foo::operator\>\>\\(foo &\\);"
@@ -167,6 +174,7 @@ proc test_lookup_operator_functions {} {
proc test_paddr_operator_functions {} {
global hex
+ global hp_aCC_compiler
print_addr_of "foo::operator&&(foo &)"
print_addr_of "foo::operator&=(foo &)"
@@ -184,7 +192,12 @@ proc test_paddr_operator_functions {} {
print_addr_of "foo::operator()(foo &)"
print_addr_of "foo::operator, (foo &)"
print_addr_of "foo::operator~(void)"
- print_addr_of "foo::operator delete(void *)"
+ if { !$hp_aCC_compiler } {
+ print_addr_of "foo::operator delete(void *)"
+ } else {
+ gdb_test "print &'foo::operator delete(void *) static'" \
+ " = .*(0x\[0-9a-f\]+|) <foo::operator delete.*>"
+ }
print_addr_of "foo::operator/(foo &)"
print_addr_of "foo::operator==(foo &)"
print_addr_of "foo::operator^(foo &)"
@@ -200,7 +213,7 @@ proc test_paddr_operator_functions {} {
print_addr_of "foo::operator!=(foo &)"
print_addr_of "foo::operator!(void)"
gdb_test "print &'foo::operator new'" \
- " = .* $hex <foo::operator new\\(.*\\)>"
+ " = .* $hex <foo::operator new\\(.*\\)(| static)>"
print_addr_of "foo::operator||(foo &)"
print_addr_of "foo::operator char *(void)"
print_addr_of "foo::operator int(void)"
diff --git a/gdb/testsuite/gdb.c++/demangle.exp b/gdb/testsuite/gdb.c++/demangle.exp
index 7f9f1746498..d63ab042a72 100644
--- a/gdb/testsuite/gdb.c++/demangle.exp
+++ b/gdb/testsuite/gdb.c++/demangle.exp
@@ -54,11 +54,11 @@ proc set_demangling_style {style} {
pass "$style: check demangling style"
}
-re ".*$gdb_prompt $" {
- fail "gnu: check demangling style"
+ fail "$style: check demangling style"
error "set_demangling_style: check style"
}
timeout {
- fail "gnu: check demangling style (timeout)"
+ fail "$style: check demangling style (timeout)"
error "set_demangling_style: check style"
}
}
diff --git a/gdb/testsuite/gdb.c++/derivation.exp b/gdb/testsuite/gdb.c++/derivation.exp
index 657b16662da..0ac4ecac0fe 100644
--- a/gdb/testsuite/gdb.c++/derivation.exp
+++ b/gdb/testsuite/gdb.c++/derivation.exp
@@ -127,6 +127,7 @@ gdb_expect {
send_gdb "ptype d_instance\n"
gdb_expect {
-re "type = class D : private A, public B, private C \{\r\n\[\t \]*public:\r\n\[\t \]*int d;\r\n\[\t \]*int dd;\[\r\n\t ]+D & operator=\\(D const &\\);\[\r\n\t ]+D\\(D const &\\);\[\r\n\t \]+D\\(void\\);\r\n\[\t \]*int dfoo\\(void\\);\r\n\[\t \]*int foo\\(void\\);\r\n\}.*$gdb_prompt $" { pass "ptype d_instance" }
+ -re "type = class D : private A, public B, private C \{\r\n\[\t \]*public:\r\n\[\t \]*int d;\r\n\[\t \]*int dd;\[\r\n\t \]+D\\(void\\);\r\n\[\t \]*int dfoo\\(void\\);\r\n\[\t \]*int foo\\(void\\);\r\n\}.*$gdb_prompt $" { pass "ptype d_instance" }
-re ".*$gdb_prompt $" { fail "ptype d_instance" }
timeout { fail "(timeout) ptype d_instance" }
}
@@ -156,6 +157,7 @@ gdb_expect {
send_gdb "ptype e_instance\n"
gdb_expect {
-re "type = class E : public A, private B, private C \{\r\n\[\t \]*public:\r\n\[\t \]*int e;\r\n\[\t \]*int ee;\[\r\n\t ]+E & operator=\\(E const &\\);\[\r\n\t ]+E\\(E const &\\);\[\r\n\t \]+E\\(void\\);\r\n\[\t \]*int efoo\\(void\\);\r\n\[\t \]*int foo\\(void\\);\r\n\}.*$gdb_prompt $" { pass "ptype e_instance" }
+ -re "type = class E : public A, private B, private C \{\r\n\[\t \]*public:\r\n\[\t \]*int e;\r\n\[\t \]*int ee;\[\r\n\t \]+E\\(void\\);\r\n\[\t \]*int efoo\\(void\\);\r\n\[\t \]*int foo\\(void\\);\r\n\}.*$gdb_prompt $" { pass "ptype e_instance" }
-re ".*$gdb_prompt $" { fail "ptype e_instance" }
timeout { fail "(timeout) ptype e_instance" }
}
@@ -302,6 +304,7 @@ gdb_expect {
timeout { fail "(timeout) print value of g_instance.c" }
}
+if { $gcc_compiled } { setup_xfail "hppa*-hp-hpux*" }
send_gdb "print g_instance.afoo()\n"
gdb_expect {
-re ".\[0-9\]* = 1.*$gdb_prompt $" {
@@ -311,6 +314,7 @@ gdb_expect {
timeout { fail "(timeout) print value of g_instance.afoo()" }
}
+if { $gcc_compiled } { setup_xfail "hppa*-hp-hpux*" }
send_gdb "print g_instance.bfoo()\n"
gdb_expect {
-re ".\[0-9\]* = 2.*$gdb_prompt $" {
@@ -320,6 +324,7 @@ gdb_expect {
timeout { fail "(timeout) print value of g_instance.bfoo()" }
}
+if { $gcc_compiled } { setup_xfail "hppa*-hp-hpux*" }
send_gdb "print g_instance.cfoo()\n"
gdb_expect {
-re ".\[0-9\]* = 3.*$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.c++/inherit.exp b/gdb/testsuite/gdb.c++/inherit.exp
index 8c7a90c9153..b1c28ed8fb1 100644
--- a/gdb/testsuite/gdb.c++/inherit.exp
+++ b/gdb/testsuite/gdb.c++/inherit.exp
@@ -43,15 +43,6 @@ if [get_compiler_info ${binfile} "c++"] {
return -1
}
-# if we are on HPUX and we are not compiled with gcc, then skip these tests.
-
-if [istarget hppa*-*-hpux*] {
- if {!$gcc_compiled} {
- continue
- }
-}
-
-
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
@@ -120,6 +111,7 @@ proc test_ptype_si {} {
global gdb_prompt
global ws
global nl
+ global hp_aCC_compiler
# Print class A as a type.
@@ -144,7 +136,7 @@ proc test_ptype_si {} {
pass "ptype class A (FIXME)"
}
-re "type = struct A \{$nl\[ \]*int a;$nl\[ \]*int x;$nl\[ \]*\}$nl$gdb_prompt $" {
- setup_xfail "*-*-*"
+ if {!$hp_aCC_compiler} {setup_xfail "*-*-*"}
fail "ptype class A (FIXME)"
}
-re ".*$gdb_prompt $" { fail "ptype class A" }
@@ -159,7 +151,7 @@ proc test_ptype_si {} {
pass "ptype g_A (FIXME)"
}
-re "type = struct A \{$nl\[ \]*int a;$nl\[ \]*int x;$nl\[ \]*\}$nl$gdb_prompt $" {
- setup_xfail "*-*-*"
+ if {!$hp_aCC_compiler} {setup_xfail "*-*-*"}
fail "ptype g_A (FIXME)"
}
-re ".*$gdb_prompt $" { fail "ptype g_A" }
@@ -243,12 +235,12 @@ proc test_print_si_classes {} {
# Print all members of g_B.
setup_xfail_format "DWARF 1"
- gdb_test "print g_B" ".* = \{\<A\> = \{a = 3, x = 4\}, b = 5, x = 6\}" "print g_B"
+ gdb_test "print g_B" ".* = \{\<(class |)A\> = \{a = 3, x = 4\}, b = 5, x = 6\}" "print g_B"
# Print all members of g_C.
setup_xfail_format "DWARF 1"
- gdb_test "print g_C" ".* = \{\<A\> = \{a = 7, x = 8\}, c = 9, x = 10\}" "print g_C"
+ gdb_test "print g_C" ".* = \{\<(class |)A\> = \{a = 7, x = 8\}, c = 9, x = 10\}" "print g_C"
}
#
@@ -270,10 +262,10 @@ proc test_print_anon_union {} {
setup_xfail_format "DWARF 1"
send_gdb "print g_anon_union\n"
gdb_expect {
- -re ".* = \{one = 1, = \{a = 2, b = 2\}\}$nl$gdb_prompt $" {
+ -re ".* = \{one = 1, ( = |)\{a = 2, b = 2\}\}$nl$gdb_prompt $" {
pass "print variable of type anonymous union"
}
- -re ".* = .*\{one = 1, = \{a = 2, b = .*\}\}$nl$gdb_prompt $" {
+ -re ".* = .*\{one = 1, ( = |)\{a = 2, b = .*\}\}$nl$gdb_prompt $" {
pass "print variable of type anonymous union (obsolete gcc or gdb)"
}
-re ".*$nl$gdb_prompt $" {
@@ -308,6 +300,7 @@ proc test_print_anon_union {} {
proc test_print_mi_members {} {
global gdb_prompt
global nl
+ global hp_aCC_compiler
# Print all members of g_A.
@@ -341,15 +334,21 @@ proc test_print_mi_members {} {
# For now, accept gdb's behavior as an expected failure if it
# simply prints either member correctly.
- setup_xfail "*-*-*"
+ if {!$hp_aCC_compiler} {setup_xfail "*-*-*"}
send_gdb "print g_D.A::a\n"
- gdb_expect {
- -re ".* = 11$nl$gdb_prompt $" {
- fail "print g_D.A::a (FIXME)"
+ gdb_expect {
+ -re "warning: A ambiguous; using D::C::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 15$nl$gdb_prompt $" {
+ pass "print g_D.A::a"
+ }
+ -re "warning: A ambiguous; using D::B::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 11$nl$gdb_prompt $" {
+ pass "print g_D.A::a (using B)"
}
-re ".* = 15$nl$gdb_prompt $" {
fail "print g_D.A::a (FIXME)"
}
+ -re ".* = 11$nl$gdb_prompt $" {
+ fail "print g_D.A::a (FIXME)"
+ }
-re ".*$gdb_prompt $" { fail "print g_D.A::a" }
timeout { fail "print g_D.A::a (timeout)" ; return }
}
@@ -358,15 +357,21 @@ proc test_print_mi_members {} {
# For now, accept gdb's behavior as an expected failure if it
# simply prints either member correctly.
- setup_xfail "*-*-*"
+ if {!$hp_aCC_compiler} {setup_xfail "*-*-*"}
send_gdb "print g_D.A::x\n"
gdb_expect {
- -re ".* = 12$nl$gdb_prompt $" {
- fail "print g_D.A::x (FIXME)"
+ -re "warning: A ambiguous; using D::C::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 16$nl$gdb_prompt $" {
+ pass "print g_D.A::x"
+ }
+ -re "warning: A ambiguous; using D::B::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 12$nl$gdb_prompt $" {
+ pass "print g_D.A::x (using B)"
}
-re ".* = 16$nl$gdb_prompt $" {
fail "print g_D.A::x (FIXME)"
}
+ -re ".* = 12$nl$gdb_prompt $" {
+ fail "print g_D.A::x (FIXME)"
+ }
-re ".*$gdb_prompt $" { fail "print g_D.A::x" }
timeout { fail "print g_D.A::x (timeout)" ; return }
}
@@ -408,15 +413,21 @@ proc test_print_mi_members {} {
# For now, accept gdb's behavior as an expected failure if it
# simply prints either member correctly.
- setup_xfail "*-*-*"
+ if {!$hp_aCC_compiler} {setup_xfail "*-*-*"}
send_gdb "print g_E.A::x\n"
gdb_expect {
- -re ".* = 22$nl$gdb_prompt $" {
- fail "print g_E.A::x (FIXME)"
+ -re "warning: A ambiguous; using E::D::C::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 26$nl$gdb_prompt $" {
+ pass "print g_E.A::x"
+ }
+ -re "warning: A ambiguous; using E::D::B::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 22$nl$gdb_prompt $" {
+ pass "print g_E.A::x (using B)"
}
-re ".* = 26$nl$gdb_prompt $" {
fail "print g_E.A::x (FIXME)"
}
+ -re ".* = 22$nl$gdb_prompt $" {
+ fail "print g_E.A::x (FIXME)"
+ }
-re ".*$gdb_prompt $" { fail "print g_E.A::x" }
timeout { fail "print g_E.A::x (timeout)" ; return }
}
@@ -474,12 +485,12 @@ proc test_print_mi_classes {} {
# Print all members of g_D.
setup_xfail_format "DWARF 1"
- gdb_test "print g_D" ".* = \{\<B\> = \{\<A\> = \{a = 11, x = 12\}, b = 13, x = 14\}, \<C\> = \{\<A\> = \{a = 15, x = 16\}, c = 17, x = 18\}, d = 19, x = 20\}" "print g_D"
+ gdb_test "print g_D" ".* = \{\<(class |)B\> = \{\<(class |)A\> = \{a = 11, x = 12\}, b = 13, x = 14\}, \<(class |)C\> = \{\<(class |)A\> = \{a = 15, x = 16\}, c = 17, x = 18\}, d = 19, x = 20\}" "print g_D"
# Print all members of g_E.
setup_xfail_format "DWARF 1"
- gdb_test "print g_E" ".* = \{\<D\> = \{\<B\> = \{\<A\> = \{a = 21, x = 22\}, b = 23, x = 24\}, \<C\> = \{\<A\> = \{a = 25, x = 26\}, c = 27, x = 28\}, d = 29, x = 30\}, e = 31, x = 32\}" "print g_E"
+ gdb_test "print g_E" ".* = \{\<(class |)D\> = \{\<(class |)B\> = \{\<(class |)A\> = \{a = 21, x = 22\}, b = 23, x = 24\}, \<(class |)C\> = \{\<(class |)A\> = \{a = 25, x = 26\}, c = 27, x = 28\}, d = 29, x = 30\}, e = 31, x = 32\}" "print g_E"
}
#
@@ -563,6 +574,7 @@ proc test_print_svi_members {} {
proc test_ptype_vi {} {
global gdb_prompt
+ global ws
global nl
# This class does not use any C++-specific features, so it's fine for
@@ -608,22 +620,82 @@ proc test_ptype_vi {} {
}
setup_xfail_format "DWARF 1"
- gdb_test "ptype vB" "ptype vB\[\r\n\]+type = class vB : public virtual vA \{$nl private:$nl\[ \]+vA \[*\]+_vb\[\\\$\.\]+vA;$nl public:$nl\[ \]+int vb;$nl\[ \]+int vx;$nl.*\}" "ptype vB"
+ send_gdb "ptype vB\n"
+ gdb_expect {
+ -re "ptype vB${nl}type = class vB : public virtual vA \{$nl private:${ws}vA \[*\]+_vb\[\\\$\.\]+vA;$nl public:${ws}int vb;${ws}int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype vB"
+ }
+ -re "ptype vB${nl}type = class vB : public virtual vA \{$nl public:${ws}int vb;${ws}int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype vB (aCC)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype vB" }
+ timeout { fail "ptype vB (timeout)" }
+ }
setup_xfail_format "DWARF 1"
- gdb_test "ptype class vB" "type = class vB : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \[*\]+_vb\[\\\$\.\]vA;$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}" "ptype class vB"
+ send_gdb "ptype class vB\n"
+ gdb_expect {
+ -re "type = class vB : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \[*\]+_vb\[\\\$\.\]vA;$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class vB"
+ }
+ -re "type = class vB : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class vB (aCC)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class vB" }
+ timeout { fail "ptype class vB (timeout)" }
+ }
setup_xfail_format "DWARF 1"
- gdb_test "ptype g_vB" "type = class vB : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \[*\]+_vb\[\\\$\.\]vA;$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}" "ptype g_vB"
+ send_gdb "ptype g_vB\n"
+ gdb_expect {
+ -re "type = class vB : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \[*\]+_vb\[\\\$\.\]vA;$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype g_vB"
+ }
+ -re "type = class vB : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype g_vB (aCC)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype g_vB" }
+ timeout { fail "ptype g_vB (timeout)" }
+ }
setup_xfail_format "DWARF 1"
- gdb_test "ptype vC" "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \[*\]+_vb\[\\\$\.\]vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}" "ptype vC"
+ send_gdb "ptype vC\n"
+ gdb_expect {
+ -re "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \[*\]+_vb\[\\\$\.\]vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype vC"
+ }
+ -re "type = class vC : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype vC (aCC)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype vC" }
+ timeout { fail "ptype vC (timeout)" }
+ }
setup_xfail_format "DWARF 1"
- gdb_test "ptype class vC" "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \[*\]+_vb\[\\\$\.\]vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}" "ptype class vC"
+ send_gdb "ptype class vC\n"
+ gdb_expect {
+ -re "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \[*\]+_vb\[\\\$\.\]vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class vC"
+ }
+ -re "type = class vC : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class vC (aCC)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class vC" }
+ timeout { fail "ptype class vC (timeout)" }
+ }
setup_xfail_format "DWARF 1"
- gdb_test "ptype g_vC" "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \[*\]+_vb\[\\\$\.\]vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}" "ptype g_vC"
+ send_gdb "ptype g_vC\n"
+ gdb_expect {
+ -re "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \[*\]+_vb\[\\\$\.\]vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype g_vC"
+ }
+ -re "type = class vC : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype g_vC (aCC)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype g_vC" }
+ timeout { fail "ptype g_vC (timeout)" }
+ }
}
#
@@ -645,6 +717,12 @@ proc test_print_svi_classes {} {
setup_xfail_format "DWARF 1"
send_gdb "print g_vB\n"
gdb_expect {
+ -re ".* = \{\<class vA\> = \{va = 3, vx = 4\}, vb = 5, vx = 6, Virtual table at $hex\}$nl$gdb_prompt $" {
+ pass "print g_vB (aCC)"
+ }
+ -re ".* = \{\<class vA\> = \{va = 3, vx = 4\}, vb = 5, vx = 6, __vfp = $hex\}$nl$gdb_prompt $" {
+ pass "print g_vB (aCC)"
+ }
-re ".* = \{\<vA\> = \{va = 3, vx = 4\}, _vb\[\\\$\.\]vA = $hex, vb = 5, vx = 6\}$nl$gdb_prompt $" {
pass "print g_vB"
}
@@ -661,7 +739,20 @@ proc test_print_svi_classes {} {
# Print all members of g_vC.
setup_xfail_format "DWARF 1"
- gdb_test "print g_vC" ".* = \{\<vA\> = \{va = 7, vx = 8\}, _vb\[\\\$\.\]vA = $hex, vc = 9, vx = 10\}" "print g_vC"
+ send_gdb "print g_vC\n"
+ gdb_expect {
+ -re ".* = \{\<class vA\> = \{va = 7, vx = 8\}, vc = 9, vx = 10, Virtual table at $hex\}$nl$gdb_prompt $" {
+ pass "print g_vC (aCC)"
+ }
+ -re ".* = \{\<class vA\> = \{va = 7, vx = 8\}, vc = 9, vx = 10, __vfp = $hex\}$nl$gdb_prompt $" {
+ pass "print g_vC (aCC)"
+ }
+ -re ".* = \{\<vA\> = \{va = 7, vx = 8\}, _vb\[\\\$\.\]vA = $hex, vc = 9, vx = 10\}$nl$gdb_prompt $" {
+ pass "print g_vC"
+ }
+ -re ".*$gdb_prompt $" { fail "print g_vC" }
+ timeout { fail "print g_vC (timeout)" }
+ }
}
#
@@ -743,25 +834,87 @@ proc test_print_mvi_members {} {
#
proc test_ptype_mvi {} {
+ global gdb_prompt
+ global ws
global nl
setup_xfail_format "DWARF 1"
- gdb_test "ptype vD" "type = class vD : public virtual vB, public virtual vC \{$nl\[ \]*private:$nl\[ \]*vC \[*\]+_vb\[\\\$\.\]vC;$nl\[ \]*vB \[*\]+_vb\[\\\$\.\]vB;$nl\[ \]*public:$nl\[ \]*int vd;$nl\[ \]*int vx;$nl.*\}" "ptype vD"
+ send_gdb "ptype vD\n"
+ gdb_expect {
+ -re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \[*\]+_vb\[\\\$\.\]vC;${ws}vB \[*\]+_vb\[\\\$\.\]vB;${ws}public:${ws}int vd;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
+ pass "ptype vD"
+ }
+ -re ".*class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;.*\}.*$gdb_prompt $" {
+ pass "ptype vD"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype vD" }
+ timeout { fail "(timeout) ptype vD" }
+ }
setup_xfail_format "DWARF 1"
- gdb_test "ptype class vD" "type = class vD : public virtual vB, public virtual vC \{$nl\[ \]*private:$nl\[ \]*vC \[*\]+_vb\[\\\$\.\]vC;$nl\[ \]*vB \[*\]+_vb\[\\\$\.\]vB;$nl\[ \]*public:$nl\[ \]*int vd;$nl\[ \]*int vx;$nl.*\}" "ptype class vD"
+ send_gdb "ptype class vD\n"
+ gdb_expect {
+ -re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \[*\]+_vb\[\\\$\.\]vC;${ws}vB \[*\]+_vb\[\\\$\.\]vB;${ws}public:${ws}int vd;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
+ pass "ptype class vD"
+ }
+ -re ".*class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;.*\}.*$gdb_prompt $" {
+ pass "ptype class vD"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class vD" }
+ timeout { fail "(timeout) ptype class vD" }
+ }
setup_xfail_format "DWARF 1"
- gdb_test "ptype g_vD" "type = class vD : public virtual vB, public virtual vC \{$nl\[ \]*private:$nl\[ \]*vC \[*\]+_vb\[\\\$\.\]vC;$nl\[ \]*vB \[*\]+_vb\[\\\$\.\]vB;$nl\[ \]*public:$nl\[ \]*int vd;$nl\[ \]*int vx;$nl.*\}" "ptype g_vD"
+ send_gdb "ptype g_vD\n"
+ gdb_expect {
+ -re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \[*\]+_vb\[\\\$\.\]vC;${ws}vB \[*\]+_vb\[\\\$\.\]vB;${ws}public:${ws}int vd;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
+ pass "ptype g_vD"
+ }
+ -re ".*class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;\r\n.*\}.*$gdb_prompt $" {
+ pass "ptype g_vD"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype g_vD" }
+ timeout { fail "(timeout) ptype g_vD" }
+ }
setup_xfail_format "DWARF 1"
- gdb_test "ptype vE" "type = class vE : public virtual vD \{$nl\[ \]*private:$nl\[ \]*vD \[*\]+_vb\[\\\$\.\]vD;$nl\[ \]*public:$nl\[ \]*int ve;$nl\[ \]*int vx;$nl.*\}" "ptype vE"
+ send_gdb "ptype vE\n"
+ gdb_expect {
+ -re "type = class vE : public virtual vD \{${ws}private:${ws}vD \[*\]+_vb\[\\\$\.\]vD;${ws}public:${ws}int ve;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
+ pass "ptype vE"
+ }
+ -re ".*class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;\r\n.*\}.*$gdb_prompt $" {
+ pass "ptype vE"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype vE" }
+ timeout { fail "(timeout) ptype vE" }
+ }
setup_xfail_format "DWARF 1"
- gdb_test "ptype class vE" "type = class vE : public virtual vD \{$nl\[ \]*private:$nl\[ \]*vD \[*\]+_vb\[\\\$\.\]vD;$nl\[ \]*public:$nl\[ \]*int ve;$nl\[ \]*int vx;$nl.*\}" "ptype class vE"
+ send_gdb "ptype class vE\n"
+ gdb_expect {
+ -re "type = class vE : public virtual vD \{${ws}private:${ws}vD \[*\]+_vb\[\\\$\.\]vD;${ws}public:${ws}int ve;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
+ pass "ptype class vE"
+ }
+ -re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;\r\n.*\}.*$gdb_prompt $" {
+ pass "ptype class vE"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class vE" }
+ timeout { fail "(timeout) ptype class vE" }
+ }
setup_xfail_format "DWARF 1"
- gdb_test "ptype g_vE" "type = class vE : public virtual vD \{$nl\[ \]*private:$nl\[ \]*vD \[*\]+_vb\[\\\$\.\]vD;$nl\[ \]*public:$nl\[ \]*int ve;$nl\[ \]*int vx;$nl.*\}" "ptype g_vE"
+ send_gdb "ptype g_vE\n"
+ gdb_expect {
+ -re "type = class vE : public virtual vD \{${ws}private:${ws}vD \[*\]+_vb\[\\\$\.\]vD;${ws}public:${ws}int ve;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
+ pass "ptype g_vE"
+ }
+ -re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;\r\n.*\}.*$gdb_prompt $" {
+ pass "ptype g_vE"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype g_vE" }
+ timeout { fail "(timeout) ptype g_vE" }
+ }
}
#
@@ -779,6 +932,12 @@ proc test_print_mvi_classes {} {
setup_xfail_format "DWARF 1"
send_gdb "print g_vD\n"
gdb_expect {
+ -re ".* = \{\<class vB\> = \{\<class vA\> = \{va = 19, vx = 20\}, vb = 21, vx = 22, Virtual table at $hex\}, \<class vC\> = \{vc = 23, vx = 24, Virtual table at $hex\}, vd = 25, vx = 26, Virtual table at $hex\}$nl$gdb_prompt $" {
+ pass "print g_vD (aCC)"
+ }
+ -re ".* = \{\<class vB\> = \{\<class vA\> = \{va = 19, vx = 20\}, vb = 21, vx = 22, __vfp = $hex\}, \<class vC\> = \{vc = 23, vx = 24, __vfp = $hex\}, vd = 25, vx = 26, __vfp = $hex\}$nl$gdb_prompt $" {
+ pass "print g_vD (aCC)"
+ }
-re ".* = \{\<vB\> = \{\<vA\> = \{va = 19, vx = 20\}, _vb\[\\\$\.\]vA = $hex, vb = 21, vx = 22\}, \<vC\> = \{_vb\[\\\$\.\]vA = $hex, vc = 23, vx = 24\}, _vb\[\\\$\.\]vC = $hex, _vb\[\\\$\.\]vB = $hex, vd = 25, vx = 26\}$nl$gdb_prompt $" {
pass "print g_vD"
}
@@ -795,7 +954,20 @@ proc test_print_mvi_classes {} {
# Print all members of g_vE.
setup_xfail_format "DWARF 1"
- gdb_test "print g_vE" ".* = \{\<vD\> = \{\<vB\> = \{\<vA\> = \{va = 0, vx = 0\}, _vb\[\\\$\.\]vA = $hex, vb = 0, vx = 0\}, \<vC\> = \{_vb\[\\\$\.\]vA = $hex, vc = 0, vx = 0\}, _vb\[\\\$\.\]vC = $hex, _vb\[\\\$\.\]vB = $hex, vd = 0, vx = 0\}, _vb\[\\\$\.\]vD = $hex, ve = 27, vx = 28\}" "print g_vE"
+ send_gdb "print g_vE\n"
+ gdb_expect {
+ -re ".* = \{\<class vD\> = \{\<class vB\> = \{\<class vA\> = \{va = 0, vx = 0\}, vb = 0, vx = 0, Virtual table at $hex\}, \<class vC\> = \{vc = 0, vx = 0, Virtual table at $hex\}, vd = 0, vx = 0, Virtual table at $hex\}, ve = 27, vx = 28, Virtual table at $hex\}$nl$gdb_prompt $" {
+ pass "print g_vE (aCC)"
+ }
+ -re ".* = \{\<class vD\> = \{\<class vB\> = \{\<class vA\> = \{va = 0, vx = 0\}, vb = 0, vx = 0, __vfp = $hex\}, \<class vC\> = \{vc = 0, vx = 0, __vfp = $hex\}, vd = 0, vx = 0, __vfp = $hex\}, ve = 27, vx = 28, __vfp = $hex\}$nl$gdb_prompt $" {
+ pass "print g_vE (aCC)"
+ }
+ -re ".* = \{\<vD\> = \{\<vB\> = \{\<vA\> = \{va = 0, vx = 0\}, _vb\[\\\$\.\]vA = $hex, vb = 0, vx = 0\}, \<vC\> = \{_vb\[\\\$\.\]vA = $hex, vc = 0, vx = 0\}, _vb\[\\\$\.\]vC = $hex, _vb\[\\\$\.\]vB = $hex, vd = 0, vx = 0\}, _vb\[\\\$\.\]vD = $hex, ve = 27, vx = 28\}$nl$gdb_prompt $" {
+ pass "print g_vE"
+ }
+ -re ".*$gdb_prompt $" { fail "print g_vE" }
+ timeout { fail "print g_vE (timeout)" }
+ }
}
proc do_tests {} {
diff --git a/gdb/testsuite/gdb.c++/local.exp b/gdb/testsuite/gdb.c++/local.exp
index 0aa84683d80..03357966306 100644
--- a/gdb/testsuite/gdb.c++/local.exp
+++ b/gdb/testsuite/gdb.c++/local.exp
@@ -41,6 +41,9 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
+if [get_compiler_info $binfile "c++"] {
+ return -1
+}
gdb_exit
gdb_start
@@ -71,38 +74,72 @@ send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
timeout { fail "(timeout) continue to marker1" }
}
+# srikanth, These tests have always been run only with aCC. Now in
+# the new scheme of things, we run it twice, once with aCC, and once
+# with g++. Flag these tests as expected failures when run with g++.
+# as these are failing now and were never known to pass with g++.
+global gcc_compiled
+if {$gcc_compiled} then {
+setup_xfail "*-*-*"
+}
+
send_gdb "ptype Local\n"
gdb_expect {
- -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*.char loc_foo\\(char\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.C:10\\).*$gdb_prompt $" { pass "ptype Local" }
- -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*.char loc_foo\\(char\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.C:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype Local (incorrect line number?)" }
+ -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*.char loc_foo\\(char\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:10\\).*$gdb_prompt $" { pass "ptype Local" }
+ -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*.char loc_foo\\(char\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype Local (incorrect line number?)" }
+ -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*Local & Local::operator=\\(foobar__Fi___0::Local const &\\);\r\n\[\t \]*Local::Local\\(foobar__Fi___0::Local const &\\);\r\n\[\t \]*Local::Local\\(void\\);\r\n\[\t \]*char Local::loc_foo\\(char\\);\r\n\[\t \]*\}*.*$gdb_prompt $" { pass "ptype Local" }
+ -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*Local & Local const &\\);\r\n\[\t \]*Local const &\\);\r\n\[\t \]*Local\\(void\\);\r\n\[\t \]*char loc_foo\\(char\\);\r\n\[\t \]*\}\[\t \]*.*$gdb_prompt $" { pass "ptype Local" }
+ -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*char loc_foo\\(char\\);\r\n\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\)\r\n\}.*$gdb_prompt $" { pass "ptype Local (aCC)" }
-re ".*$gdb_prompt $" { fail "ptype Local" }
timeout { fail "(timeout) ptype Local" }
}
+# DTS CLLbs14316 and CLLbs17058
+# coulter - I added a clause for HP's aCC compiler. We print out the type
+# as xx instead of const unsigned char, but we still have an expected failure
+# because of two reasons:
+# There is a number at the end of InnerLocal4 which should not be there,
+# DTS CLLbs14316
+# The line number for the class
+setup_xfail "hppa*-*-*" CLLbs14316
send_gdb "ptype InnerLocal\n"
gdb_expect {
- -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(const unsigned char &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.C:36\\).*$gdb_prompt $" { pass "ptype InnerLocal" }
- -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*class InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(const unsigned char &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.C:36\\).*$gdb_prompt $" { pass "ptype InnerLocal" }
- -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(const unsigned char &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.C:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype InnerLocal (incorrect line number?" }
- -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*class InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(const unsigned char &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.C:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype InnerLocal (incorrect line number?" }
+ -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(const unsigned char &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:36\\).*$gdb_prompt $" { pass "ptype InnerLocal" }
+ -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*class InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(const unsigned char &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:36\\).*$gdb_prompt $" { pass "ptype InnerLocal" }
+ -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(const unsigned char &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype InnerLocal (incorrect line number?" }
+ -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*class InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(const unsigned char &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype InnerLocal (incorrect line number?" }
+ -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(unsigned char const &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:36\\).*$gdb_prompt $" { pass "ptype InnerLocal HP aCC" }
+ -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*NestedInnerLocal nest1;\r\n\r\n\[\t \]*InnerLocal & InnerLocal::operator=\\(main___0::InnerLocal const &\\);\r\n\[\t \]*InnerLocal::InnerLocal\\(main___0::InnerLocal const &\\);\r\n\[\t \]*InnerLocal::InnerLocal\\(void\\);\r\n\[\t \]*int InnerLocal::il_foo\\(unsigned char const &\\);\r\n\*\}\r\n*.*$gdb_prompt $" { pass "ptype InnerLocal" }
+ -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*NestedInnerLocal nest1;\r\n\r\n\[\t \]*InnerLocal & InnerLocal const &\\);\r\n\[\t \]*InnerLocal const &\\);\r\n\[\t \]*InnerLocal\\(void\\);\r\n\[\t \]*.int il_foo\\(unsigned char const &\\);\r\n\[\t \]*\}\[\t \]*.*$gdb_prompt $" { pass "ptype InnerLocal" }
+ -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*class InnerLocal4::NestedInnerLocal nest1;\r\n\r\n\[\t \]*int il_foo\\(unsigned char const &\\);\r\n\[\t \]*\\(Local at.*local\.cc:\[0-9\]+\\)\r\n\}.*$gdb_prompt $" { pass "ptype InnerLocal (aCC)" }
-re ".*$gdb_prompt $" { fail "ptype InnerLocal" }
timeout { fail "(timeout) ptype InnerLocal" }
}
+if {$gcc_compiled} then {
+setup_xfail "*-*-*"
+}
+
send_gdb "ptype NestedInnerLocal\n"
gdb_expect {
- -re "type = class InnerLocal::NestedInnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*int nil;\r\n\r\n\[\t \]*.int nil_foo\\(int\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.C:44\\).*$gdb_prompt $" { pass "ptype NestedInnerLocal" }
- -re "type = class InnerLocal::NestedInnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*int nil;\r\n\r\n\[\t \]*.int nil_foo\\(int\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.C:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype NestedInnerLocal (incorrect line number?)" }
+ -re "type = class InnerLocal::NestedInnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*int nil;\r\n\r\n\[\t \]*.int nil_foo\\(int\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:44\\).*$gdb_prompt $" { pass "ptype NestedInnerLocal" }
+ -re "type = class InnerLocal::NestedInnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*int nil;\r\n\r\n\[\t \]*.int nil_foo\\(int\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype NestedInnerLocal (incorrect line number?)" }
+ -re "type = class NestedInnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*int nil;\r\n\r\n\[\t \]*NestedInnerLocal & InnerLocal::NestedInnerLocal::operator=\\(main___1::InnerLocal::NestedInnerLocal const &\\);\r\n\[\t \]*InnerLocal::NestedInnerLocal::NestedInnerLocal\\(main___1::InnerLocal::NestedInnerLocal const &\\);\r\n\[\t \]*InnerLocal::NestedInnerLocal::NestedInnerLocal\\(void\\);\r\n\[\t \]*int InnerLocal::NestedInnerLocal::nil_foo\\(int\\);\r\n\}\r\n*.*$gdb_prompt $" { pass "ptype NestedInnerLocal" }
+ -re "type = class NestedInnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*int nil;\r\n\r\n\[\t \]*NestedInnerLocal & NestedInnerLocal const &\\);\r\n\[\t \]*NestedInnerLocal const &\\);\r\n\[\t \]*NestedInnerLocal\\(void\\);\r\n\[\t \]*int nil_foo\\(int\\);\r\n\[\t \]*\}\r\n*.*$gdb_prompt $" { pass "ptype NestedInnerLocal" }
-re "No symbol.*in current context.*$gdb_prompt $" { pass "ptype NestedInnerLocal (known aCC limitation)" }
-re ".*$gdb_prompt $" { fail "ptype NestedInnerLocal" }
timeout { fail "(timeout) ptype NestedInnerLocal" }
}
+# gdb incorrectly interprets the NestedInnerLocal in
+# InnerLocal::NestedInnerLocal as field name instead of a type name;
+# See CLLbs14784.
+setup_xfail hppa*-*-* CLLbs14784
send_gdb "ptype InnerLocal::NestedInnerLocal\n"
gdb_expect {
- -re "type = class InnerLocal::NestedInnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*int nil;\r\n\r\n\[\t \]*.int nil_foo\\(int\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.C:44\\).*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal" }
- -re "type = class InnerLocal::NestedInnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*int nil;\r\n\r\n\[\t \]*.int nil_foo\\(int\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.C:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal (incorrect line number?)" }
+ -re "type = class InnerLocal::NestedInnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*int nil;\r\n\r\n\[\t \]*.int nil_foo\\(int\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:44\\).*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal" }
+ -re "type = class InnerLocal::NestedInnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*int nil;\r\n\r\n\[\t \]*.int nil_foo\\(int\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal (incorrect line number?)" }
-re ".*$gdb_prompt $" { fail "ptype InnerLocal::NestedInnerLocal" }
timeout { fail "(timeout) ptype InnerLocal::NestedInnerLocal" }
}
diff --git a/gdb/testsuite/gdb.c++/member-ptr.exp b/gdb/testsuite/gdb.c++/member-ptr.exp
index 9bf2431c7f0..d1de66325ca 100644
--- a/gdb/testsuite/gdb.c++/member-ptr.exp
+++ b/gdb/testsuite/gdb.c++/member-ptr.exp
@@ -103,6 +103,7 @@ gdb_expect {
# print pointer to data member
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print pmi\n"
gdb_expect {
-re "\\$\[0-9\]* = \\(int \\( A::\\*\\)\\) &A::j\r\n$gdb_prompt $" {
@@ -115,6 +116,7 @@ gdb_expect {
# print dereferenced pointer to data member
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print a.*pmi\n"
gdb_expect {
-re "\\$\[0-9\]* = 121\r\n$gdb_prompt $" {
@@ -127,6 +129,7 @@ gdb_expect {
# print dereferenced pointer to data member
# this time, dereferenced through a pointer
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print a_p->*pmi\n"
gdb_expect {
-re "\\$\[0-9\]* = 121\r\n$gdb_prompt $" {
@@ -212,6 +215,7 @@ gdb_expect {
}
# Double-check by printing a.
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print a\n"
gdb_expect {
-re "\\$\[0-9\]* = \{c = 120 'x', j = 33, jj = 1331, static s = 10, Virtual table at $hex\}\r\n$gdb_prompt $" {
@@ -244,6 +248,7 @@ gdb_expect {
}
# Double-check by printing a.
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print a\n"
gdb_expect {
-re "\\$\[0-9\]* = \{c = 120 'x', j = 44, jj = 1331, static s = 10, Virtual table at $hex\}\r\n$gdb_prompt $" {
@@ -290,6 +295,7 @@ gdb_expect {
# Ptype a pointer to a method.
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "ptype pmf\n"
gdb_expect {
-re "type = int \\( A::\\*\\)\\(\\.\\.\\.\\)\r\n$gdb_prompt $" {
@@ -301,6 +307,7 @@ gdb_expect {
# print a pointer to a method
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print pmf\n"
gdb_expect {
-re "\\$\[0-9\]* = \\(int \\( A::\\*\\)\\(\\.\\.\\.\\)\\) \\?\\? <not supported with HP aCC>\r\n$gdb_prompt $" {
@@ -313,6 +320,7 @@ gdb_expect {
# Ptype a pointer to a pointer to a method
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "ptype pmf_p\n"
gdb_expect {
-re "type = int \\( A::\\*\\*\\)\\(\\.\\.\\.\\)\r\n$gdb_prompt $" {
@@ -324,6 +332,7 @@ gdb_expect {
# print a pointer to a pointer to a method
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print pmf_p\n"
gdb_expect {
-re "\\$\[0-9\]* = \\(int \\( A::\\*\\*\\)\\(\\.\\.\\.\\)\\) $hex\r\n$gdb_prompt $" {
@@ -335,39 +344,43 @@ gdb_expect {
# print dereferenced pointer to method
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print a.*pmf\n"
gdb_expect {
-re "Pointers to methods not supported with HP aCC\r\n$gdb_prompt $" {
pass "print a.*pmf (known aCC limitation)"
}
- -re ".*$gdb_prompt $" { fail "print a.*pmf -- ??" }
+ -re ".*$gdb_prompt $" { fail "print a.*pmf" }
timeout { fail "(timeout) print a.*pmf" }
}
# print dereferenced pointer to method, using ->*
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print a_p->*pmf\n"
gdb_expect {
-re "Pointers to methods not supported with HP aCC\r\n$gdb_prompt $" {
pass "print a_p->*pmf (known aCC limitation)"
}
- -re ".*$gdb_prompt $" { fail "print a_p->*pmf -- ??" }
+ -re ".*$gdb_prompt $" { fail "print a_p->*pmf" }
timeout { fail "(timeout) print a_p->*pmf" }
}
# set the pointer to data member
+setup_xfail "hppa*-*-*"
send_gdb "set var pmf = &A::foo\n"
gdb_expect {
-re "Assignment to pointers to methods not implemented with HP aCC\r\n$gdb_prompt $" {
pass "set var pmf (known aCC limitation)"
}
- -re ".*$gdb_prompt $" { fail "set var pmf -- ??" }
+ -re ".*$gdb_prompt $" { fail "set var pmf" }
timeout { fail "(timeout) set var pmf" }
}
# Try to dereference the pointer to method without any object
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print *pmf\n"
gdb_expect {
-re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
@@ -389,6 +402,7 @@ gdb_expect {
}
# Check cast of pointer to member to integer
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print (int) pmi\n"
gdb_expect {
-re "\\$\[0-9\]* = 8\r\n$gdb_prompt $" {
@@ -399,37 +413,41 @@ gdb_expect {
}
# Check cast of pointer to method to integer
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print (int) pmf\n"
gdb_expect {
-re "Pointers to methods not supported with HP aCC\r\n$gdb_prompt $" {
pass "casting pmf to int (known aCC limitation)"
}
- -re ".*$gdb_prompt $" { fail "casting pmf to int -- ??" }
+ -re ".*$gdb_prompt $" { fail "casting pmf to int" }
timeout { fail "(timeout) casting pmf to int" }
}
# Try to invoke a function through a pointer to data member
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print (a.*pmi)(3)\n"
gdb_expect {
-re "Not implemented: function invocation through pointer to method with HP aCC\r\n$gdb_prompt $" {
pass "print (a.*pmi)(3) -- error message should be different"
}
- -re ".*$gdb_prompt $" { fail "print (a.*pmi)(3) -- ???" }
+ -re ".*$gdb_prompt $" { fail "print (a.*pmi)(3)" }
timeout { fail "(timeout) print (a.*pmi)(3)" }
}
# Try to invoke a function through a pointer to a method
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print (a.*pmf)(3)\n"
gdb_expect {
-re "Not implemented: function invocation through pointer to method with HP aCC\r\n$gdb_prompt $" {
pass "print (a.*pmi)(3) -- known aCC limitation"
}
- -re ".*$gdb_prompt $" { fail "print (a.*pmf)(3) -- ???" }
+ -re ".*$gdb_prompt $" { fail "print (a.*pmf)(3)" }
timeout { fail "(timeout) print (a.*pmf)(3)" }
}
# Go past assignment of NULL to pmi
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "next\n"
gdb_expect {
-re "\r\n85\[ \t\]*k = \\(a.\\*pmf\\)\\(3\\);\r\n$gdb_prompt $" {
@@ -449,6 +467,7 @@ gdb_expect {
#}
# Dereference the null pointer to member
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print a.*pmi\n"
gdb_expect {
-re "Attempted dereference of null pointer-to-member\r\n$gdb_prompt $" {
@@ -469,6 +488,7 @@ gdb_expect {
timeout { fail "(timeout) set break at 91" }
}
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "continue\n"
gdb_expect {
-re "Continuing\\.\r\n\r\nBreakpoint.*at.*member-ptr\\.cc:91\r\n91\[ \t]*k = \\(a.\\*pmf\\)\\(4\\);\r\n$gdb_prompt $" {
@@ -482,6 +502,7 @@ gdb_expect {
# Now check again that pmi works even when not set to
# something that's at the beginning of the object
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print pmi\n"
gdb_expect {
-re "\\$\[0-9\]* = \\(int \\( A::\\*\\)\\) &A::jj\r\n$gdb_prompt $" {
@@ -494,6 +515,7 @@ gdb_expect {
# print dereferenced pointer to data member
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print a.*pmi\n"
gdb_expect {
-re "\\$\[0-9\]* = 1331\r\n$gdb_prompt $" {
@@ -506,6 +528,7 @@ gdb_expect {
# print dereferenced pointer to data member
# this time, dereferenced through a pointer
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "print a_p->*pmi\n"
gdb_expect {
-re "\\$\[0-9\]* = 1331\r\n$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.c++/method.exp b/gdb/testsuite/gdb.c++/method.exp
index edfa689d901..a0d005bb491 100644
--- a/gdb/testsuite/gdb.c++/method.exp
+++ b/gdb/testsuite/gdb.c++/method.exp
@@ -50,7 +50,9 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-
+if [get_compiler_info $binfile "c++"] {
+ return -1
+}
gdb_exit
gdb_start
@@ -143,7 +145,20 @@ gdb_expect {
send_gdb "print this\n"
gdb_expect {
-re "\\$\[0-9\]* = \\(const class A \\*\\) $hex\r\n$gdb_prompt $" {
+ global gcc_compiled
+ if {$gcc_compiled} {
+ xfail "print this (in bar)"
+ } else {
+ pass "print this (in bar)"
+ }
+ }
+ -re "\\$\[0-9\]* = \\(A \\*\\) $hex\r\n$gdb_prompt $" {
+ global gcc_compiled
+ if {$gcc_compiled} {
pass "print this (in bar)"
+ } else {
+ xfail "print this (in bar)"
+ }
}
-re ".*$gdb_prompt $" { fail "print this (in bar)" }
timeout { fail "(timeout) print this (in bar)" }
@@ -209,7 +224,7 @@ gdb_expect {
send_gdb "ptype A\n"
gdb_expect {
- -re "type = class A \{\r\n\[ \]*public:\r\n\[ \]*int x;\r\n\[ \]*int y;\r\n\r\n\\[ \]*A & operator=\\(A const &\\);\r\n\[ \]*A\\(A const &\\)\r\n\[ \]*A\\(void\\)\r\n[ \]*int foo\\(int\\);\r\n\[ \]*int bar\\(int\\) const;\r\n\[ \]*int baz\\(int, char\\) volatile;\r\n\[ \]*int qux\\(int, float\\) const volatile;\r\n\}\r\n$gdb_prompt $" {
+ -re "type = class A \{\r\n\[ \]*public:\r\n\[ \]*int x;\r\n\[ \]*int y;\r\n\r\n\[ \]*A & operator=\\(A const &\\);\r\n\[ \]*A\\(A const &\\);\r\n\[ \]*A\\(void\\);\r\n\[ \]*int foo\\(int\\);\r\n\[ \]*int bar\\(int\\) const;\r\n\[ \]*int baz\\(int, char\\) volatile;\r\n\[ \]*int qux\\(int, float\\) const volatile;\r\n\}\r\n$gdb_prompt $" {
pass "ptype A"
}
-re "type = class A \{\r\n\[ \]*public:\r\n\[ \]*int x;\r\n\[ \]*int y;\r\n\r\n\[ \]*int foo\\(int\\);\r\n\[ \]*int bar\\(int\\) const;\r\n\[ \]*int baz\\(int, char\\);\r\n\[ \]*int qux\\(int, float\\) const;\r\n\}\r\n$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.c++/misc.cc b/gdb/testsuite/gdb.c++/misc.cc
index 4cf93180139..7c212cc5f1c 100644
--- a/gdb/testsuite/gdb.c++/misc.cc
+++ b/gdb/testsuite/gdb.c++/misc.cc
@@ -1,5 +1,9 @@
// Test various -*- C++ -*- things.
+// ====================== basic C++ types =======================
+bool v_bool;
+bool v_bool_array[2];
+
typedef struct fleep fleep;
struct fleep { int a; } s;
@@ -477,6 +481,14 @@ register_class ()
return v.x + 5;
}
+void dummy()
+{
+ v_bool = true;
+ v_bool_array[0] = false;
+ v_bool_array[1] = v_bool;
+}
+
+
int
main()
{
@@ -484,6 +496,7 @@ main()
set_debug_traps();
breakpoint();
#endif
+ dummy();
inheritance1 ();
inheritance3 ();
register_class ();
diff --git a/gdb/testsuite/gdb.c++/misc.exp b/gdb/testsuite/gdb.c++/misc.exp
index 6090fbb3c2a..7d64e4a7fea 100644
--- a/gdb/testsuite/gdb.c++/misc.exp
+++ b/gdb/testsuite/gdb.c++/misc.exp
@@ -79,6 +79,23 @@ proc deduce_language_of_main {} {
}
}
+proc test_expr { args } {
+ if { [llength $args] % 2 } {
+ warning "an even # of arguments should be passed to test_expr"
+ }
+ set last_ent [expr [llength $args] - 1];
+ set testname [lindex $args $last_ent];
+ if [gdb_test [lindex $args 0] "" "$testname (setup)"] {
+ gdb_suppress_tests;
+ }
+ for {set x 1} {$x < $last_ent} {set x [expr $x + 2]} {
+ if [gdb_test [lindex $args $x] [lindex $args [expr $x + 1]] "$testname ([lindex $args $x])"] {
+ gdb_suppress_tests;
+ }
+ }
+ gdb_stop_suppressing_tests;
+}
+
proc do_tests {} {
global prms_id
global bug_id
@@ -104,3 +121,41 @@ proc do_tests {} {
}
do_tests
+
+test_expr "set language c++" \
+ "print 1 == 1" "print.*\\$\[0-9\]* = true" \
+ "print 1 == 2" "print.*\\$\[0-9\]* = false" \
+ "print as bool"
+
+# Test bool type printing, etc.
+# Note: Language is already set to C++ above!
+gdb_test "print v_bool" "\\$\[0-9\]* = false" "print a bool var"
+
+# set a bool variable
+test_expr "set variable v_bool = true" \
+ "print v_bool" "\\$\[0-9\]* = true" \
+ "set a bool var"
+
+# next print an array of bool
+gdb_test "print v_bool_array" "\\$\[0-9\]* = \\{false, false\\}" "print a bool array"
+
+# set elements of a bool array
+test_expr "set variable v_bool_array\[1\] = true" \
+ "print v_bool_array" "\\$\[0-9\]* = \\{false, true\\}" \
+ "set a bool array elem"
+
+# bool constants
+gdb_test "print true" "\\$\[0-9\]* = true" "print true"
+gdb_test "print false" "\\$\[0-9\]* = false" "print false"
+
+# arithmetic conversions
+gdb_test "print 1 + true" "\\$\[0-9\]* = 2" "1 + true"
+gdb_test "print 3 + false" "\\$\[0-9\]* = 3" "3 + false"
+gdb_test "print 1 < 2 < 3" "\\$\[0-9\]* = true" "1 < 2 < 3"
+gdb_test "print 2 < 1 > 4" "\\$\[0-9\]* = false" "2 < 1 > 4"
+gdb_test "print (bool)43" "\\$\[0-9\]* = true" "(bool)43"
+gdb_test "print (bool)0" "\\$\[0-9\]* = false" "(bool)0"
+gdb_test "print (bool)17.93" "\\$\[0-9\]* = true" "(bool)17.93"
+gdb_test "print (bool)0.0" "\\$\[0-9\]* = false" "(bool)0.0"
+gdb_test "print (int)true" "\\$\[0-9\]* = 1" "(int)true"
+gdb_test "print (int)false" "\\$\[0-9\]* = 0" "(int)false"
diff --git a/gdb/testsuite/gdb.c++/overload.exp b/gdb/testsuite/gdb.c++/overload.exp
index e77d2dc9704..c49d76a6edb 100644
--- a/gdb/testsuite/gdb.c++/overload.exp
+++ b/gdb/testsuite/gdb.c++/overload.exp
@@ -43,9 +43,6 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-# Create and source the file that provides information about the compiler
-# used to compile the test case.
-
if [get_compiler_info ${binfile} "c++"] {
return -1
}
@@ -88,6 +85,7 @@ gdb_expect {
}
+setup_xfail "hppa*-*-*" CLLbs16901
send_gdb "ptype foo_instance1\n"
gdb_expect {
-re "type = class foo \{.*public:.*int ifoo;.*const char \\*ccpfoo;.*foo\\(int\\);.*foo\\(int, (const char|char const) \\*\\);.*foo\\(foo &\\);.*~foo\\(void\\);.*void foofunc\\(int\\);.*void foofunc\\(int, signed char \\*\\);.*int overload1arg\\(void\\);.*int overload1arg\\(char\\);.*int overload1arg\\(signed char\\);.*int overload1arg\\(unsigned char\\);.*int overload1arg\\(short\\);.*int overload1arg\\(unsigned short\\);.*int overload1arg\\(int\\);.*int overload1arg\\(unsigned int\\);.*int overload1arg\\(long\\);.*int overload1arg\\(unsigned long\\);.*int overload1arg\\(float\\);.*int overload1arg\\(double\\);.*int overloadargs\\(int\\);.*int overloadargs\\(int, int\\);.*int overloadargs\\(int, int, int\\);.*int overloadargs\\(int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int, int, int\\);\r\n\}\r\n$gdb_prompt $" {
@@ -123,8 +121,8 @@ gdb_expect {
# work right for G++ output, since the list of parameters seems not to
# be filled in correctly. Until this gets fixed, don't expect to pass
# these tests.
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overloadargs(1)\n"
gdb_expect {
-re ".\[0-9\]* = 1\r\n$gdb_prompt $" {
@@ -135,7 +133,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overloadargs(1, 2)\n"
gdb_expect {
@@ -147,7 +145,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overloadargs(1, 2, 3)\n"
gdb_expect {
@@ -159,7 +157,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4)\n"
gdb_expect {
@@ -171,7 +169,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5)\n"
gdb_expect {
@@ -183,7 +181,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6)\n"
gdb_expect {
@@ -195,7 +193,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7)\n"
gdb_expect {
@@ -207,7 +205,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8)\n"
gdb_expect {
@@ -219,7 +217,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9)\n"
gdb_expect {
@@ -231,7 +229,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n"
gdb_expect {
@@ -243,7 +241,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)\n"
gdb_expect {
@@ -255,7 +253,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overload1arg()\n"
gdb_expect {
@@ -267,7 +265,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overload1arg((char)arg2)\n"
gdb_expect {
@@ -279,7 +277,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overload1arg((signed char)arg3)\n"
gdb_expect {
@@ -291,7 +289,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overload1arg((unsigned char)arg4)\n"
gdb_expect {
@@ -303,7 +301,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overload1arg((short)arg5)\n"
gdb_expect {
@@ -315,7 +313,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overload1arg((unsigned short)arg6)\n"
gdb_expect {
@@ -327,7 +325,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overload1arg((int)arg7)\n"
gdb_expect {
@@ -339,7 +337,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overload1arg((unsigned int)arg8)\n"
gdb_expect {
@@ -351,7 +349,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overload1arg((long)arg9)\n"
gdb_expect {
@@ -363,7 +361,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overload1arg((unsigned long)arg10)\n"
gdb_expect {
@@ -375,7 +373,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overload1arg((float)arg11)\n"
gdb_expect {
@@ -387,7 +385,7 @@ gdb_expect {
}
-if {$gcc_compiled} then { setup_xfail "*-*-*" }
+setup_xfail "*-*-*" CLLbs16901
send_gdb "print foo_instance1.overload1arg((double)arg12)\n"
gdb_expect {
diff --git a/gdb/testsuite/gdb.c++/ref-types.cc b/gdb/testsuite/gdb.c++/ref-types.cc
index 8ee5c405d87..23cc51095e3 100644
--- a/gdb/testsuite/gdb.c++/ref-types.cc
+++ b/gdb/testsuite/gdb.c++/ref-types.cc
@@ -1,3 +1,5 @@
+int main2(void);
+
void marker1 (void)
{
@@ -25,6 +27,53 @@ int main(void)
breakpoint();
#endif
marker1();
-
+
+ main2();
+
+ return 0;
+}
+
+int f()
+{
+ int f1;
+ f1 = 1;
+ return f1;
+}
+
+int main2(void)
+{
+ char C;
+ unsigned char UC;
+ short S;
+ unsigned short US;
+ int I;
+ unsigned int UI;
+ long L;
+ unsigned long UL;
+ float F;
+ double D;
+ char &rC = C;
+ unsigned char &rUC = UC;
+ short &rS = S;
+ unsigned short &rUS = US;
+ int &rI = I;
+ unsigned int &rUI = UI;
+ long &rL = L;
+ unsigned long &rUL = UL;
+ float &rF = F;
+ double &rD = D;
+ C = 'A';
+ UC = 21;
+ S = -14;
+ US = 7;
+ I = 102;
+ UI = 1002;
+ L = -234;
+ UL = 234;
+ F = 1.25E10;
+ D = -1.375E-123;
+ I = f();
+
return 0;
+
}
diff --git a/gdb/testsuite/gdb.c++/ref-types.exp b/gdb/testsuite/gdb.c++/ref-types.exp
index 2a9d337cbb9..611dc6fedf0 100644
--- a/gdb/testsuite/gdb.c++/ref-types.exp
+++ b/gdb/testsuite/gdb.c++/ref-types.exp
@@ -276,3 +276,414 @@ gdb_expect {
-re ".*$gdb_prompt $" { fail "print value of ras\[3\]" }
timeout { fail "(timeout) print value of ras\[3\]" }
}
+
+
+send_gdb "break f\n" ; gdb_expect -re ".*$gdb_prompt $"
+
+ send_gdb "cont\n"
+ gdb_expect {
+ -re "Break.* f \\(\\) at .*:$decimal.*$gdb_prompt $" {
+ send_gdb "up\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "up from f" }
+ }
+ }
+ -re "$gdb_prompt $" { fail "continue to f" }
+ timeout { fail "(timeout) continue to f" }
+ }
+
+
+send_gdb "print C\n"
+gdb_expect {
+ -re ".\[0-9\]* = 65 \'A\'.*$gdb_prompt $" {
+ pass "print value of C"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of C" }
+ timeout { fail "(timeout) print value of C" }
+ }
+
+
+send_gdb "ptype C\n"
+gdb_expect {
+ -re "type = char.*$gdb_prompt $" { pass "ptype C" }
+ -re ".*$gdb_prompt $" { fail "ptype C" }
+ timeout { fail "(timeout) ptype C" }
+}
+
+
+send_gdb "print UC\n"
+gdb_expect {
+ -re ".\[0-9\]* = 21 '\.025'\.*$gdb_prompt $" {
+ pass "print value of UC"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of UC" }
+ timeout { fail "(timeout) print value of UC" }
+ }
+
+
+send_gdb "ptype UC\n"
+gdb_expect {
+ -re "type = unsigned char.*$gdb_prompt $" { pass "ptype UC" }
+ -re ".*$gdb_prompt $" { fail "ptype UC" }
+ timeout { fail "(timeout) ptype UC" }
+}
+
+
+send_gdb "print S\n"
+gdb_expect {
+ -re ".\[0-9\]* = -14.*$gdb_prompt $" {
+ pass "print value of S"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of S" }
+ timeout { fail "(timeout) print value of S" }
+ }
+
+
+send_gdb "ptype S\n"
+gdb_expect {
+ -re "type = short.*$gdb_prompt $" { pass "ptype S" }
+ -re ".*$gdb_prompt $" { fail "ptype S" }
+ timeout { fail "(timeout) ptype S" }
+}
+
+
+send_gdb "print US\n"
+gdb_expect {
+ -re ".\[0-9\]* = 7.*$gdb_prompt $" {
+ pass "print value of US"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of US" }
+ timeout { fail "(timeout) print value of US" }
+ }
+
+
+send_gdb "ptype US\n"
+gdb_expect {
+ -re "type = unsigned short.*$gdb_prompt $" { pass "ptype US" }
+ -re "type = short unsigned.*$gdb_prompt $" { pass "ptype US" }
+ -re ".*$gdb_prompt $" { fail "ptype US" }
+ timeout { fail "(timeout) ptype US" }
+}
+
+
+send_gdb "print I\n"
+gdb_expect {
+ -re ".\[0-9\]* = 102.*$gdb_prompt $" {
+ pass "print value of I"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of I" }
+ timeout { fail "(timeout) print value of I" }
+ }
+
+
+send_gdb "ptype I\n"
+gdb_expect {
+ -re "type = int.*$gdb_prompt $" { pass "ptype I" }
+ -re ".*$gdb_prompt $" { fail "ptype I" }
+ timeout { fail "(timeout) ptype I" }
+}
+
+
+send_gdb "print UI\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1002.*$gdb_prompt $" {
+ pass "print value of UI"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of UI" }
+ timeout { fail "(timeout) print value of UI" }
+ }
+
+
+send_gdb "ptype UI\n"
+gdb_expect {
+ -re "type = unsigned int.*$gdb_prompt $" { pass "ptype UI" }
+ -re ".*$gdb_prompt $" { fail "ptype UI" }
+ timeout { fail "(timeout) ptype UI" }
+}
+
+
+send_gdb "print L\n"
+gdb_expect {
+ -re ".\[0-9\]* = -234.*$gdb_prompt $" {
+ pass "print value of L"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of L" }
+ timeout { fail "(timeout) print value of L" }
+ }
+
+
+send_gdb "ptype L\n"
+gdb_expect {
+ -re "type = long.*$gdb_prompt $" { pass "ptype L" }
+ -re ".*$gdb_prompt $" { fail "ptype L" }
+ timeout { fail "(timeout) ptype L" }
+}
+
+
+send_gdb "print UL\n"
+gdb_expect {
+ -re ".\[0-9\]* = 234.*$gdb_prompt $" {
+ pass "print value of UL"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of UL" }
+ timeout { fail "(timeout) print value of UL" }
+ }
+
+
+send_gdb "ptype UL\n"
+gdb_expect {
+ -re "type = unsigned long.*$gdb_prompt $" { pass "ptype UL" }
+ -re "type = long unsigned.*$gdb_prompt $" { pass "ptype UL" }
+ -re ".*$gdb_prompt $" { fail "ptype UL" }
+ timeout { fail "(timeout) ptype UL" }
+}
+
+
+send_gdb "print F\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.2\[0-9\]*e\\+10.*$gdb_prompt $" {
+ pass "print value of F"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of F" }
+ timeout { fail "(timeout) print value of F" }
+ }
+
+
+
+send_gdb "ptype F\n"
+gdb_expect {
+ -re "type = float.*$gdb_prompt $" { pass "ptype F" }
+ -re ".*$gdb_prompt $" { fail "ptype F" }
+ timeout { fail "(timeout) ptype F" }
+}
+
+
+send_gdb "print D\n"
+gdb_expect {
+ -re ".\[0-9\]* = -1.375e-123.*$gdb_prompt $" {
+ pass "print value of D"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of D" }
+ timeout { fail "(timeout) print value of D" }
+ }
+
+
+send_gdb "ptype D\n"
+gdb_expect {
+ -re "type = double.*$gdb_prompt $" { pass "ptype D" }
+ -re ".*$gdb_prompt $" { fail "ptype D" }
+ timeout { fail "(timeout) ptype D" }
+}
+
+
+
+#
+# test reference types
+#
+
+
+
+
+send_gdb "ptype rC\n"
+gdb_expect {
+ -re "type = char &.*$gdb_prompt $" { pass "ptype rC" }
+ -re ".*$gdb_prompt $" { fail "ptype rC" }
+ timeout { fail "(timeout) ptype rC" }
+}
+
+
+
+
+send_gdb "ptype rUC\n"
+gdb_expect {
+ -re "type = unsigned char &.*$gdb_prompt $" { pass "ptype rUC" }
+ -re ".*$gdb_prompt $" { fail "ptype rUC" }
+ timeout { fail "(timeout) ptype rUC" }
+}
+
+
+
+send_gdb "ptype rS\n"
+gdb_expect {
+ -re "type = short &.*$gdb_prompt $" { pass "ptype rS" }
+ -re "type = short int &.*$gdb_prompt $" { pass "ptype rS" }
+ -re ".*$gdb_prompt $" { fail "ptype rS" }
+ timeout { fail "(timeout) ptype rS" }
+}
+
+
+
+send_gdb "ptype rUS\n"
+gdb_expect {
+ -re "type = unsigned short &.*$gdb_prompt $" { pass "ptype rUS" }
+ -re "type = short unsigned int &.*$gdb_prompt $" { pass "ptype rUS" }
+ -re ".*$gdb_prompt $" { fail "ptype rUS" }
+ timeout { fail "(timeout) ptype rUS" }
+}
+
+
+send_gdb "ptype rI\n"
+gdb_expect {
+ -re "type = int &.*$gdb_prompt $" { pass "ptype rI" }
+ -re ".*$gdb_prompt $" { fail "ptype rI" }
+ timeout { fail "(timeout) ptype rI" }
+}
+
+
+
+send_gdb "ptype rUI\n"
+gdb_expect {
+ -re "type = unsigned int &.*$gdb_prompt $" { pass "ptype rUI" }
+ -re ".*$gdb_prompt $" { fail "ptype rUI" }
+ timeout { fail "(timeout) ptype rUI" }
+}
+
+
+
+send_gdb "ptype rL\n"
+gdb_expect {
+ -re "type = long &.*$gdb_prompt $" { pass "ptype rL" }
+ -re "type = long int &.*$gdb_prompt $" { pass "ptype rL" }
+ -re ".*$gdb_prompt $" { fail "ptype rL" }
+ timeout { fail "(timeout) ptype rL" }
+}
+
+
+send_gdb "ptype rUL\n"
+gdb_expect {
+ -re "type = unsigned long &.*$gdb_prompt $" { pass "ptype rUL" }
+ -re "type = long unsigned int &.*$gdb_prompt $" { pass "ptype rUL" }
+ -re ".*$gdb_prompt $" { fail "ptype rUL" }
+ timeout { fail "(timeout) ptype rUL" }
+}
+
+
+send_gdb "ptype rF\n"
+gdb_expect {
+ -re "type = float &.*$gdb_prompt $" { pass "ptype rF" }
+ -re ".*$gdb_prompt $" { fail "ptype rF" }
+ timeout { fail "(timeout) ptype rF" }
+}
+
+
+send_gdb "ptype rD\n"
+gdb_expect {
+ -re "type = double &.*$gdb_prompt $" { pass "ptype rD" }
+ -re ".*$gdb_prompt $" { fail "ptype rD" }
+ timeout { fail "(timeout) ptype rD" }
+}
+
+
+send_gdb "print rC\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(char &\\) @$hex: 65 \'A\'.*$gdb_prompt $" {
+ pass "print value of rC"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rC" }
+ timeout { fail "(timeout) print value of rC" }
+ }
+
+
+send_gdb "print rUC\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(unsigned char &\\) @$hex: 21 \'.025\'.*$gdb_prompt $" {
+ pass "print value of rUC"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rUC" }
+ timeout { fail "(timeout) print value of rUC" }
+ }
+
+
+send_gdb "print rS\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(short &\\) @$hex: -14.*$gdb_prompt $" {
+ pass "print value of rS"
+ }
+ -re ".\[0-9\]* = \\(short int &\\) @$hex: -14.*$gdb_prompt $" {
+ pass "print value of rS"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rS" }
+ timeout { fail "(timeout) print value of rS" }
+ }
+
+
+send_gdb "print rUS\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(unsigned short &\\) @$hex: 7.*$gdb_prompt $" {
+ pass "print value of rUS"
+ }
+ -re ".\[0-9\]* = \\(short unsigned int &\\) @$hex: 7.*$gdb_prompt $" {
+ pass "print value of rUS"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rUS" }
+ timeout { fail "(timeout) print value of rUS" }
+ }
+
+
+send_gdb "print rI\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(int &\\) @$hex: 102.*$gdb_prompt $" {
+ pass "print value of rI"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rI" }
+ timeout { fail "(timeout) print value of rI" }
+ }
+
+
+send_gdb "print rUI\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(unsigned int &\\) @$hex: 1002.*$gdb_prompt $" {
+ pass "print value of UI"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rUI" }
+ timeout { fail "(timeout) print value of rUI" }
+ }
+
+
+send_gdb "print rL\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(long &\\) @$hex: -234.*$gdb_prompt $" {
+ pass "print value of rL"
+ }
+ -re ".\[0-9\]* = \\(long int &\\) @$hex: -234.*$gdb_prompt $" {
+ pass "print value of rL"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rL" }
+ timeout { fail "(timeout) print value of rL" }
+ }
+
+
+
+send_gdb "print rUL\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(unsigned long &\\) @$hex: 234.*$gdb_prompt $" {
+ pass "print value of rUL"
+ }
+ -re ".\[0-9\]* = \\(long unsigned int &\\) @$hex: 234.*$gdb_prompt $" {
+ pass "print value of rUL"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rUL" }
+ timeout { fail "(timeout) print value of rUL" }
+ }
+
+
+send_gdb "print rF\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(float &\\) @$hex: 1.2\[0-9\]*e\\+10.*$gdb_prompt $" {
+ pass "print value of rF"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rF" }
+ timeout { fail "(timeout) print value of rF" }
+ }
+
+
+send_gdb "print rD\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(double &\\) @$hex: -1.375e-123.*$gdb_prompt $" {
+ pass "print value of rD"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rD" }
+ timeout { fail "(timeout) print value of rD" }
+ }
+
diff --git a/gdb/testsuite/gdb.c++/templates.cc b/gdb/testsuite/gdb.c++/templates.cc
index 470024cbdae..e1d6810930d 100644
--- a/gdb/testsuite/gdb.c++/templates.cc
+++ b/gdb/testsuite/gdb.c++/templates.cc
@@ -516,7 +516,7 @@ public:
int (*manage[5])(double,
void *(*malloc)(unsigned size),
void (*free)(void *pointer));
- int (*device[5])(int open(const char *, unsigned mode, unsigned perms, int extra = 0),
+ int (*device[5])(int open(const char *, unsigned mode, unsigned perms, int extra),
int *(*read)(int fd, void *place, unsigned size),
int *(*write)(int fd, void *place, unsigned size),
void (*close)(int fd));
@@ -716,7 +716,7 @@ int main()
Foo<int> fint;
Foo<char> fchar;
- Foo<volatile char *> fvpchar;
+ Foo<volatile char *> fvpchar = {0, 0};
Bar<int, 33> bint;
Bar<int, (4 > 3)> bint2;
diff --git a/gdb/testsuite/gdb.c++/templates.exp b/gdb/testsuite/gdb.c++/templates.exp
index ee25eaa9ad7..6c643b1f647 100644
--- a/gdb/testsuite/gdb.c++/templates.exp
+++ b/gdb/testsuite/gdb.c++/templates.exp
@@ -36,20 +36,10 @@ if [get_compiler_info ${binfile} "c++"] {
}
source ${binfile}.ci
-# if we are on HPUX and we are not compiled with gcc, then skip these tests.
-
-if [istarget hppa*-*-hpux*] {
- if {!$gcc_compiled} {
- continue
- }
-}
-
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-source ${binfile}.ci
-
#
# Test printing of the types of templates.
#
@@ -63,6 +53,8 @@ proc test_ptype_of_templates {} {
-re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5\\<int> & operator=\\(T5<int> const &\\);${ws}T5\\(int\\);${ws}T5\\(T5<int> const &\\);${ws}~T5\\(void\\);${ws}static void \\* operator new\\(unsigned (int|long)\\);${ws}static void operator delete\\(void \\*\\);${ws}int value\\(void\\);${ws}\}\r\n$gdb_prompt $" {
pass "ptype T5<int>"
}
+ -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned int\\);${ws}static void delete \\(void \\*\\);${ws}int value \\(void\\);${ws}\\}${ws}$gdb_prompt $" { pass "ptype T5<int> -- new with unsigned int" }
+ -re "type = class T5<int> \\{.*public:.*static int X;.*int x;.*int val;.*T5 \\(int\\);.*T5 \\(const class T5<int> &\\);.*void ~T5 \\(int\\);.*static void \\* new \\(unsigned long\\);.*static void delete \\(void \\*\\);.*int value \\(void\\);.*\\}\r\n$gdb_prompt $" { pass "ptype T5<int> -- new with unsigned long" }
-re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5\\<int> & operator=\\(T5<int> const &\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\(T5<int> const &\\);)|(${ws}~T5\\(void\\);)|(${ws}static void \\* operator new\\(unsigned (int|long)\\);)|(${ws}static void operator delete\\(void \\*\\);)|(${ws}int value\\(void\\);))*${ws}\}\r\n$gdb_prompt $" {
pass "ptype T5<int> (obsolescent gcc or gdb)"
}
@@ -76,6 +68,12 @@ proc test_ptype_of_templates {} {
send_gdb "ptype t5i\n"
gdb_expect {
+ -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5\\(int\\);${ws}T5\\(T5<int> const &\\);${ws}~T5\\(void\\);${ws}static void \\* operator new\\(unsigned int\\);${ws}static void operator delete\\(void \\*\\);${ws}int value\\(void\\);${ws}\\}\r\n$gdb_prompt $" { pass "ptype T5<int> -- with several fixes from 4.17" }
+ -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned int\\);${ws}static void delete \\(void \\*\\);${ws}int value \\(void\\);${ws}\\}\r\n$gdb_prompt $" { pass "ptype t5i<int> -- new with unsigned int" }
+ -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned long\\);${ws}static void delete \\(void \\*\\);${ws}int value \\(void\\);${ws}\\}\r\n$gdb_prompt $" { pass "ptype t5i<int> -- new with unsigned long" }
+ -re "type = class T5<int> \{.*public:.*static int X;.*int x;.*int val;.*.*T5 \\(int\\);.*.*void ~T5 \\(int\\).*.*.*int value \\(void\\);.*\}.*$gdb_prompt $" {
+ pass "ptype t5i"
+ }
-re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5<int> & operator=\\(T5<int> const &\\);${ws}T5\\(int\\);${ws}T5\\(T5<int> const &\\);${ws}~T5\\(void\\);${ws}static void \\* operator new\\(unsigned (int|long)\\);${ws}static void operator delete\\(void \\*\\);${ws}int value\\(void\\);${ws}\}\r\n$gdb_prompt $" {
pass "ptype t5i"
}
@@ -99,6 +97,7 @@ proc test_template_breakpoints {} {
global gdb_prompt
global testfile
global srcdir
+ global hp_aCC_compiler
send_gdb "break T5<int>::T5\n"
gdb_expect {
@@ -116,7 +115,9 @@ proc test_template_breakpoints {} {
default { fail "constructor breakpoint (timeout)" }
}
- gdb_test "break T5<int>::~T5" \
+# See CLLbs14792
+ if {$hp_aCC_compiler} {setup_xfail hppa*-*-* CLLbs14792}
+ gdb_test "break T5<int>::~T5" \
"Breakpoint.*at.* file .*${testfile}.cc, line.*" \
"destructor breakpoint"
@@ -133,6 +134,7 @@ proc test_template_breakpoints {} {
proc test_template_calls {} {
global gdb_prompt
+ global hp_aCC_compiler
if [target_info exists gdb,cannot_call_functions] {
setup_xfail "*-*-*" 2416
@@ -140,14 +142,19 @@ proc test_template_calls {} {
return
}
+ if {!$hp_aCC_compiler} {setup_xfail hppa*-*-*}
send_gdb "print t5i.value()\n"
gdb_expect {
-re ".* = 2\[\r\n\]*$gdb_prompt $" { pass "print t5i.value()" }
-re "Cannot invoke functions on this machine.*$gdb_prompt $" {
fail "print t5i.value()"
}
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ xfail "print t5i.value"
+ }
-re ".*$gdb_prompt $" { fail "print t5i.value()" }
- default { fail "print t5i.value() (timeout)" }
+ timeout { fail "print t5i.value() (timeout)" }
}
}
@@ -200,3 +207,218 @@ proc do_tests {} {
do_tests
+if {!$hp_aCC_compiler} {continue}
+
+# More tests for different kinds of template parameters,
+# templates with partial specializations, nested templates, etc.
+# These have been tested only with HP aCC. They probably won't
+# work with other compilers because of differences in mangling
+# schemes.
+# Added by Satish Pai <pai@apollo.hp.com> 1997-09-25
+
+send_gdb "print fint\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\{x = 0, t = 0\\}\r\n$gdb_prompt $" { pass "print fint" }
+ -re "$gdb_prompt $" { fail "print fint" }
+ timeout { fail "(timeout) print fint" }
+}
+
+send_gdb "print fvpchar\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\{x = 0, t = 0x0\\}\r\n$gdb_prompt $" { pass "print fvpchar" }
+ -re "$gdb_prompt $" { fail "print fvpchar" }
+ timeout { fail "(timeout) print fvpchar" }
+}
+
+# Template Foo<T>
+
+setup_xfail hppa2.0w-*-* CLLbs16092
+send_gdb "ptype Foo\n"
+gdb_expect {
+ -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Foo<volatile char \\*>\r\n\[ \t\]*(class |)Foo<char>\r\n\[ \t\]*(class |)Foo<int>\r\n$gdb_prompt $" { pass "ptype Foo" }
+ -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Foo" }
+ -re "$gdb_prompt $" { fail "ptype Foo" }
+ timeout { fail "(timeout) ptype Foo" }
+}
+
+# ptype Foo<int>
+
+send_gdb "ptype fint\n"
+gdb_expect {
+ -re "type = (class |)Foo<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int foo\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fint" }
+ -re "$gdb_prompt $" { fail "ptype fint" }
+ timeout { fail "(timeout) ptype fint" }
+}
+
+# ptype Foo<char>
+
+send_gdb "ptype fchar\n"
+gdb_expect {
+ -re "type = (class |)Foo<char> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char foo\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fchar" }
+ -re "$gdb_prompt $" { fail "ptype fchar" }
+ timeout { fail "(timeout) ptype fchar" }
+}
+
+# ptype Foo<volatile char *>
+
+send_gdb "ptype fvpchar\n"
+gdb_expect {
+ -re "type = (class |)Foo<volatile char \\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*volatile char \\*t;\r\n\r\n\[ \t\]*volatile char \\* foo\\(int, volatile char \\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" }
+ -re "$gdb_prompt $" { fail "ptype fvpchar" }
+ timeout { fail "(timeout) ptype fvpchar" }
+}
+
+# print a function from Foo<volatile char *>
+
+send_gdb "print Foo<volatile char *>::foo\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\{volatile char \\*\\((class |)Foo<volatile char \\*> \\*, int, volatile char \\*\\)\\} $hex <Foo<volatile char \\*>::foo\\(int, volatile char \\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char *>::foo" }
+ -re "$gdb_prompt $" { fail "print Foo<volatile char *>::foo" }
+ timeout { fail "(timeout) print Foo<volatile char *>::foo" }
+}
+
+# Template Bar<T, int>
+
+setup_xfail hppa2.0w-*-* CLLbs16092
+send_gdb "ptype Bar\n"
+gdb_expect {
+ -re "type = template <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)1>\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)33>\r\n$gdb_prompt $" { pass "ptype Bar" }
+ -re "type = <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Bar" }
+ -re "$gdb_prompt $" { fail "ptype Bar" }
+ timeout { fail "(timeout) ptype Bar" }
+}
+
+
+# ptype Bar<int,33>
+
+send_gdb "ptype bint\n"
+gdb_expect {
+ -re "type = (class |)Bar<int,(\\(int\\)|)33> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bint" }
+ -re "$gdb_prompt $" { fail "ptype bint" }
+ timeout { fail "(timeout) ptype bint" }
+}
+
+# ptype Bar<int, (4>3)>
+
+send_gdb "ptype bint2\n"
+gdb_expect {
+ -re "type = (class |)Bar<int,(\\(int\\)|)1> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bint2" }
+ -re "$gdb_prompt $" { fail "ptype bint2" }
+ timeout { fail "(timeout) ptype bint2" }
+}
+
+# Template Baz<T, char>
+
+setup_xfail hppa2.0w-*-* CLLbs16092
+send_gdb "ptype Baz\n"
+gdb_expect {
+ -re "type = template <(class |)T, (class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Baz<char,(\\(char\\)|)97>\r\n\[ \t\]*(class |)Baz<int,(\\(char\\)|)115>\r\n$gdb_prompt $" { pass "ptype Baz" }
+ -re "type = <(class |)T, (class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Baz" }
+ -re "$gdb_prompt $" { fail "ptype Baz" }
+ timeout { fail "(timeout) ptype Baz" }
+}
+
+
+# ptype Baz<int, 's'>
+
+send_gdb "ptype bazint\n"
+gdb_expect {
+ -re "type = (class |)Baz<int,(\\(char\\)|)115> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int baz\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint" }
+ -re "$gdb_prompt $" { fail "ptype bazint" }
+ timeout { fail "(timeout) ptype bazint" }
+}
+
+# ptype Baz<char, 'a'>
+
+send_gdb "ptype bazint2\n"
+gdb_expect {
+ -re "type = (class |)Baz<char,(\\(char\\)|)97> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char baz\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint2" }
+ -re "$gdb_prompt $" { fail "ptype bazint2" }
+ timeout { fail "(timeout) ptype bazint2" }
+}
+
+# Template Qux<T, int (*f)(int) >
+
+send_gdb "ptype Qux\n"
+gdb_expect {
+ -re "type = template <(class |)T, (class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Qux<int,&string>\r\n\[ \t\]*(class |)Qux<char,&string>\r\n$gdb_prompt $" { pass "ptype Qux" }
+ -re ".*type = template <(class |)T.*, (class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}.*$gdb_prompt $" { pass "ptype Qux" }
+ -re "$gdb_prompt $" { fail "ptype Qux" }
+ timeout { fail "(timeout) ptype Qux" }
+}
+
+# pt Qux<int,&string>
+
+send_gdb "ptype quxint\n"
+gdb_expect {
+ -re "type = class Qux<int,&string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
+ -re "$gdb_prompt $" { fail "ptype quxint" }
+ timeout { fail "(timeout) ptype quxint" }
+}
+
+# pt Qux<char,0>
+
+# commented out this as quxint2 declaration was commented out in
+# templates.exp -- ovidiu
+# send_gdb "ptype quxint2\n"
+# gdb_expect {
+# -re "type = class Qux<char,&string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char qux\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint2" }
+# -re "$gdb_prompt $" { fail "ptype quxint2" }
+# timeout { fail "(timeout) ptype quxint2" }
+# }
+
+# Template Spec<T1, T2>
+
+setup_xfail hppa2.0w-*-* CLLbs16092
+send_gdb "ptype Spec\n"
+gdb_expect {
+ -re "type = template <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Spec<int,int \\*>\r\n\[ \t\]*(class |)Spec<int,char>\r\n$gdb_prompt $" { pass "ptype Spec" }
+ -re "type = <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Spec" }
+ -re "$gdb_prompt $" { fail "ptype Spec" }
+ timeout { fail "(timeout) ptype Spec" }
+}
+
+# pt Spec<char,0>
+
+send_gdb "ptype siip\n"
+gdb_expect {
+ -re "type = class Spec<int,int \\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*int spec\\(int \\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype siip" }
+ -re "$gdb_prompt $" { fail "ptype siip" }
+ timeout { fail "(timeout) ptype siip" }
+}
+
+# pt Garply<int>
+
+send_gdb "ptype Garply<int>\n"
+gdb_expect {
+ -re "type = class Garply<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int garply\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype Garply<int>" }
+ -re "$gdb_prompt $" { fail "ptype Garply<int>" }
+ timeout { fail "(timeout) ptype Garply<int>" }
+}
+
+# ptype of nested template name
+
+send_gdb "ptype Garply<Garply<char> >\n"
+gdb_expect {
+ -re "type = (class |)Garply<Garply<char> > \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*(class |)Garply<char> t;\r\n\r\n\[ \t\]*(class |)Garply<char> garply\\(int, (class |)Garply<char>\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype Garply<Garply<char> >" }
+ -re "$gdb_prompt $" { fail "ptype Garply<Garply<char> >" }
+ timeout { fail "(timeout) ptype Garply<Garply<char> >" }
+}
+
+# print out a function from a nested template name
+
+send_gdb "print Garply<Garply<char> >::garply\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\{(class |)Garply<char> \\((class |)Garply<Garply<char> > \\*, int, (class |)Garply<char>\\)\\} $hex <Garply<Garply<char>>::garply\\(int, (class |)Garply<char>\\)>\r\n$gdb_prompt $" { pass "print Garply<Garply<char> >::garply" }
+ -re ".*$gdb_prompt $" { fail "print Garply<Garply<char> >::garply" }
+ timeout { fail "print Garply<Garply<char> >::garply (timeout)" }
+}
+
+# UNFORTUNATELY, "break Garply<Garply<char> >::garply" doesn't yet work.
+
+#send_gdb "break Garply<Garply<char> >::garply
+#gdb_expect {
+# -re "Breakpoint \[0-9\]* at $hex: file .*templates.cc, line.*\r\n$gdb_prompt $" { pass "break Garply<Garply<char> >::garply" }
+# -re ".*$gdb_prompt $" { fail "break Garply<Garply<char> >::garply" }
+# timeout { fail "break Garply<Garply<char> >::garply (timeout)" }
+#}
diff --git a/gdb/testsuite/gdb.c++/userdef.exp b/gdb/testsuite/gdb.c++/userdef.exp
index c9bb0530f37..055ff0da5ab 100644
--- a/gdb/testsuite/gdb.c++/userdef.exp
+++ b/gdb/testsuite/gdb.c++/userdef.exp
@@ -68,7 +68,7 @@ send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
}
- setup_xfail hppa_*_*
+setup_xfail "hppa*-*-*"
send_gdb "print one+two\n"
gdb_expect {
-re "FIXME.*$gdb_prompt $" {
@@ -78,6 +78,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one two" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one-two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -87,6 +88,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one - two" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one*two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -96,6 +98,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one * two" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one/two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -105,6 +108,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one / two" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one%two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -114,6 +118,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one % two" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one&&two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -123,6 +128,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one && two" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one||two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -132,6 +138,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one|| two" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one&two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -141,6 +148,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one & two" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one|two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -150,6 +158,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one | two" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one ^ two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -159,6 +168,8 @@ gdb_expect {
timeout { fail "(timeout) print value of one ^ two" }
}
+
+setup_xfail "hppa*-*-*"
send_gdb "print one < two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -168,6 +179,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one < two" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one <= two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -177,6 +189,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one <= two" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one > two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -186,6 +199,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one > two" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one >= two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -196,6 +210,7 @@ gdb_expect {
}
+setup_xfail "hppa*-*-*"
send_gdb "print one==two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -205,6 +220,8 @@ gdb_expect {
timeout { fail "(timeout) print value of one == two" }
}
+
+setup_xfail "hppa*-*-*"
send_gdb "print one!=two\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -214,6 +231,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one != two" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one<<31\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -223,6 +241,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one<<31" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one>>31\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -232,6 +251,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one>>31" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print !one\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -241,6 +261,7 @@ gdb_expect {
timeout { fail "(timeout) print value of !one" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print ~one\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -250,6 +271,7 @@ gdb_expect {
timeout { fail "(timeout) print value of ~one" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print -one\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -259,6 +281,7 @@ gdb_expect {
timeout { fail "(timeout) print value of -one" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one++\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -268,6 +291,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one++" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print ++one\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -277,6 +301,7 @@ gdb_expect {
timeout { fail "(timeout) print value of ++one" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one--\n"
gdb_expect {
-re ".*.FIXME*$gdb_prompt $" {
@@ -286,6 +311,8 @@ gdb_expect {
timeout { fail "(timeout) print value of one-->>31" }
}
+
+setup_xfail "hppa*-*-*"
send_gdb "print --one\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -295,6 +322,7 @@ gdb_expect {
timeout { fail "(timeout) print value of --one" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print one+=7\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
@@ -304,6 +332,7 @@ gdb_expect {
timeout { fail "(timeout) print value of one+=7" }
}
+setup_xfail "hppa*-*-*"
send_gdb "print two=one\n"
gdb_expect {
-re ".*FIXME.*$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.c++/virtfunc.cc b/gdb/testsuite/gdb.c++/virtfunc.cc
index 883d502ea11..005de9d0ea6 100644
--- a/gdb/testsuite/gdb.c++/virtfunc.cc
+++ b/gdb/testsuite/gdb.c++/virtfunc.cc
@@ -170,7 +170,7 @@ extern "C" {
};
#endif
-main()
+int main()
{
#ifdef usestubs
set_debug_traps();
@@ -182,6 +182,8 @@ main()
e.vb = 11;
test_calls();
+ return 0;
+
}
int A::f() {return 1;}
diff --git a/gdb/testsuite/gdb.c++/virtfunc.exp b/gdb/testsuite/gdb.c++/virtfunc.exp
index d0db7557fd1..e182744c167 100644
--- a/gdb/testsuite/gdb.c++/virtfunc.exp
+++ b/gdb/testsuite/gdb.c++/virtfunc.exp
@@ -34,15 +34,6 @@ if [get_compiler_info ${binfile} "c++"] {
return -1
}
-# if we are on HPUX and we are not compiled with gcc, then skip these tests.
-
-if [istarget hppa*-*-hpux*] {
- if {!$gcc_compiled} {
- continue
- }
-}
-
-
# Check to see if we have an executable to test. If not, then either we
# haven't tried to compile one, or the compilation failed for some reason.
@@ -106,6 +97,9 @@ proc test_ptype_of_classes {} {
-re "type = class VB \{${ws}public:${ws}int vb;${ws}VB & operator=\\(VB const &\\);${ws}VB\\(VB const &\\);${ws}VB\\(void\\);${ws}int fvb\\(void\\);${ws}virtual int vvb\\(void\\);${ws}\}.*$gdb_prompt $" {
pass "ptype VB"
}
+ -re "type = class VB \{${ws}public:${ws}int vb;${ws}int fvb \\(void\\);${ws}virtual int vvb \\(void\\);${ws}\}.*$gdb_prompt $" {
+ pass "ptype VB (aCC)"
+ }
-re "type = class VB \{${ws}public:${ws}int vb;((${ws}VB & operator=\\(VB const &\\);)|(${ws}VB\\(VB const &\\);)|(${ws}VB\\(void\\);)|(${ws}int fvb\\(void\\);)|(${ws}virtual int vvb\\(void\\);))*${ws}\}.*$gdb_prompt $" {
pass "ptype VB (obsolescent gcc or gdb)"
}
@@ -122,6 +116,9 @@ proc test_ptype_of_classes {} {
-re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}V & operator=\\(V const &\\);${ws}V\\(V const &\\);${ws}V\\(void\\);${ws}int f\\(void\\);${ws}virtual int vv\\(void\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype V"
}
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}int f \\(void\\);${ws}virtual int vv \\(void\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype V (aCC)"
+ }
-re "type = class V : public VA, public VB \{${ws}public:${ws}int w;((${ws}V & operator=\\(V const &\\);)|(${ws}V\\(V const &\\);)|(${ws}V\\(void\\);)|(${ws}int f\\(void\\);)|(${ws}virtual int vv\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype V (obsolescent gcc or gdb)"
}
@@ -138,6 +135,9 @@ proc test_ptype_of_classes {} {
-re "type = class A : public virtual V \{${ws}private:${ws}V \[*\]+_vb\[\\\$\.\]+V;${ws}int a;${ws}public:${ws}A & operator=\\(A const &\\);${ws}A\\(int, A const &\\);${ws}A\\(int\\);${ws}virtual int f\\(void\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype A"
}
+ -re "type = class A : public virtual V \{${ws}private:${ws}int a;${ws}public:${ws}virtual int f\\(void\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype A (aCC)"
+ }
-re "type = class A : public virtual V \{${ws}private:${ws}V \[*\]+_vb\[\\\$\.\]+V;${ws}int a;${ws}public:((${ws}A & operator=\\(A const &\\);)|(${ws}A\\(int, A const &\\);)|(${ws}A\\(int\\);)|(${ws}virtual int f\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype A (obsolescent gcc or gdb)"
}
@@ -161,6 +161,9 @@ proc test_ptype_of_classes {} {
-re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}B & operator=\\(B const &\\);${ws}B\\(int, B const &\\);${ws}B\\(int\\);${ws}virtual int f\\(void\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype B"
}
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}virtual int f \\(void\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype B (aCC)"
+ }
-re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:((${ws}B & operator=\\(B const &\\);)|(${ws}B\\(int, B const &\\);)|(${ws}B\\(int\\);)|(${ws}virtual int f\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype B (obsolescent gcc or gdb)"
}
@@ -177,6 +180,9 @@ proc test_ptype_of_classes {} {
-re "type = class C : public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int c;${ws}C & operator=\\(C const &\\);${ws}C\\(int, C const &\\);${ws}C\\(int\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype C"
}
+ -re "type = class C : public virtual V \{${ws}public:${ws}int c;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype C (aCC)"
+ }
-re "type = class C : public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int c;((${ws}C & operator=\\(C const &\\);)|(${ws}C\\(int, C const &\\);)|(${ws}C\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype C (obsolescent gcc or gdb)"
}
@@ -193,6 +199,9 @@ proc test_ptype_of_classes {} {
-re "type = class AD \{${ws}public:${ws}AD & operator=\\(AD const &\\);${ws}AD\\(AD const &\\);${ws}AD\\(void\\);${ws}virtual int vg\\(void\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype AD"
}
+ -re "type = class AD \{${ws}public:${ws}virtual int vg \\(void\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype AD (aCC)"
+ }
-re "type = class AD \{${ws}public:((${ws}AD & operator=\\(AD const &\\);)|(${ws}AD\\(AD const &\\);)|(${ws}AD\\(void\\);)|(${ws}virtual int vg\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype AD (obsolescent gcc or gdb)"
}
@@ -209,6 +218,9 @@ proc test_ptype_of_classes {} {
-re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int d;${ws}D & operator=\\(D const &\\);${ws}D\\(int, D const &\\);${ws}D\\(int\\);${ws}static void s\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vd\\(void\\);${ws}int fd\\(void\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype D"
}
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}static void s\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vd\\(void\\);${ws}int fd\\(void\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype D (aCC)"
+ }
-re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int d;((${ws}D & operator=\\(D const &\\);)|(${ws}D\\(int, D const &\\);)|(${ws}D\\(int\\);)|(${ws}static void s\\(void\\);)|(${ws}virtual int vg\\(void\\);)|(${ws}virtual int vd\\(void\\);)|(${ws}int fd\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype D (obsolescent gcc or gdb)"
}
@@ -225,6 +237,9 @@ proc test_ptype_of_classes {} {
-re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}E & operator=\\(E const &\\);${ws}E\\(int, E const &\\);${ws}E\\(int\\);${ws}virtual int f\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vv\\(void\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype E"
}
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}virtual int f \\(void\\);${ws}virtual int vg \\(void\\);${ws}virtual int vv \\(void\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype E (aCC)"
+ }
-re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;((${ws}E & operator=\\(E const &\\);)|(${ws}E\\(int, E const &\\);)|(${ws}E\\(int\\);)|(${ws}virtual int f\\(void\\);)|(${ws}virtual int vg\\(void\\);)|(${ws}virtual int vv\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype E (obsolescent gcc or gdb)"
}
@@ -241,6 +256,9 @@ proc test_ptype_of_classes {} {
-re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int d;${ws}D & operator=\\(D const &\\);${ws}D\\(int, D const &\\);${ws}D\\(int\\);${ws}static void s\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vd\\(void\\);${ws}int fd\\(void\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype dd"
}
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}static void s\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vd\\(void\\);${ws}int fd\\(void\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype dd (aCC)"
+ }
-re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int d;((${ws}D & operator=\\(D const &\\);)|(${ws}D\\(int, D const &\\);)|(${ws}D\\(int\\);)|(${ws}static void s\\(void\\);)|(${ws}virtual int vg\\(void\\);)|(${ws}virtual int vd\\(void\\);)|(${ws}int fd\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype dd (obsolescent gcc or gdb)"
}
@@ -257,6 +275,9 @@ proc test_ptype_of_classes {} {
-re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int d;${ws}D & operator=\\(D const &\\);${ws}D\\(int, D const &\\);${ws}D\\(int\\);${ws}static void s\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vd\\(void\\);${ws}int fd\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype ppd"
}
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}static void s\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vd\\(void\\);${ws}int fd\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype ppd (aCC)"
+ }
-re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int d;((${ws}D & operator=\\(D const &\\);)|(${ws}D\\(int, D const &\\);)|(${ws}D\\(int\\);)|(${ws}static void s\\(void\\);)|(${ws}virtual int vg\\(void\\);)|(${ws}virtual int vd\\(void\\);)|(${ws}int fd\\(void\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype ppd (obsolescent gcc or gdb)"
}
@@ -273,6 +294,9 @@ proc test_ptype_of_classes {} {
-re "type = class AD \{${ws}public:${ws}AD & operator=\\(AD const &\\);${ws}AD\\(AD const &\\);${ws}AD\\(void\\);${ws}virtual int vg\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pAd"
}
+ -re "type = class AD \{${ws}public:${ws}virtual int vg \\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pAd (aCC)"
+ }
-re "type = class AD \{${ws}public:((${ws}AD & operator=\\(AD const &\\);)|(${ws}AD\\(AD const &\\);)|(${ws}AD\\(void\\);)|(${ws}virtual int vg\\(void\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pAd (obsolescent gcc or gdb)"
}
@@ -289,6 +313,9 @@ proc test_ptype_of_classes {} {
-re "type = class A : public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}int a;${ws}public:${ws}A & operator=\\(A const &\\);${ws}A\\(int, A const &\\);${ws}A\\(int\\);${ws}virtual int f\\(void\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype a"
}
+ -re "type = class A : public virtual V \{${ws}private:${ws}int a;${ws}public:${ws}virtual int f\\(void\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype a (aCC)"
+ }
-re "type = class A : public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}int a;${ws}public:((${ws}A & operator=\\(A const &\\);)|(${ws}A\\(int, A const &\\);)|(${ws}A\\(int\\);)|(${ws}virtual int f\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype a (obsolescent gcc or gdb)"
}
@@ -305,6 +332,9 @@ proc test_ptype_of_classes {} {
-re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}B & operator=\\(B const &\\);${ws}B\\(int, B const &\\);${ws}B\\(int\\);${ws}virtual int f\\(void\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype b"
}
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}virtual int f \\(void\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype b (aCC)"
+ }
-re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:((${ws}B & operator=\\(B const &\\);)|(${ws}B\\(int, B const &\\);)|(${ws}B\\(int\\);)|(${ws}virtual int f\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype b (obsolescent gcc or gdb)"
}
@@ -321,6 +351,9 @@ proc test_ptype_of_classes {} {
-re "type = class C : public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int c;${ws}C & operator=\\(C const &\\);${ws}C\\(int, C const &\\);${ws}C\\(int\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype c"
}
+ -re "type = class C : public virtual V \{${ws}public:${ws}int c;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype c (aCC)"
+ }
-re "type = class C : public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int c;((${ws}C & operator=\\(C const &\\);)|(${ws}C\\(int, C const &\\);)|(${ws}C\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype c (obsolescent gcc or gdb)"
}
@@ -337,6 +370,9 @@ proc test_ptype_of_classes {} {
-re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int d;${ws}D & operator=\\(D const &\\);${ws}D\\(int, D const &\\);${ws}D\\(int\\);${ws}static void s\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vd\\(void\\);${ws}int fd\\(void\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype d"
}
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}static void s\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vd\\(void\\);${ws}int fd\\(void\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype d (aCC)"
+ }
-re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int d;((${ws}D & operator=\\(D const &\\);)|(${ws}D\\(int, D const &\\);)|(${ws}D\\(int\\);)|(${ws}static void s\\(void\\);)|(${ws}virtual int vg\\(void\\);)|(${ws}virtual int vd\\(void\\);)|(${ws}int fd\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype d (obsolescent gcc or gdb)"
}
@@ -353,6 +389,9 @@ proc test_ptype_of_classes {} {
-re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}E & operator=\\(E const &\\);${ws}E\\(int, E const &\\);${ws}E\\(int\\);${ws}virtual int f\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vv\\(void\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype e"
}
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}virtual int f \\(void\\);${ws}virtual int vg \\(void\\);${ws}virtual int vv \\(void\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype e (aCC)"
+ }
-re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;((${ws}E & operator=\\(E const &\\);)|(${ws}E\\(int, E const &\\);)|(${ws}E\\(int\\);)|(${ws}virtual int f\\(void\\);)|(${ws}virtual int vg\\(void\\);)|(${ws}virtual int vv\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype e (obsolescent gcc or gdb)"
}
@@ -369,6 +408,9 @@ proc test_ptype_of_classes {} {
-re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}V & operator=\\(V const &\\);${ws}V\\(V const &\\);${ws}V\\(void\\);${ws}int f\\(void\\);${ws}virtual int vv\\(void\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype v"
}
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}int f \\(void\\);${ws}virtual int vv \\(void\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype v (aCC)"
+ }
-re "type = class V : public VA, public VB \{${ws}public:${ws}int w;((${ws}V & operator=\\(V const &\\);)|(${ws}V\\(V const &\\);)|(${ws}V\\(void\\);)|(${ws}int f\\(void\\);)|(${ws}virtual int vv\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype v (obsolescent gcc or gdb)"
}
@@ -385,6 +427,9 @@ proc test_ptype_of_classes {} {
-re "type = class VB \{${ws}public:${ws}int vb;${ws}VB & operator=\\(VB const &\\);${ws}VB\\(VB const &\\);${ws}VB\\(void\\);${ws}int fvb\\(void\\);${ws}virtual int vvb\\(void\\);${ws}\}$nl$gdb_prompt $" {
pass "ptype vb"
}
+ -re "type = class VB \{${ws}public:${ws}int vb;${ws}int fvb \\(void\\);${ws}virtual int vvb \\(void\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype vb (aCC)"
+ }
-re "type = class VB \{${ws}public:${ws}int vb;((${ws}VB & operator=\\(VB const &\\);)|(${ws}VB\\(VB const &\\);)|(${ws}VB\\(void\\);)|(${ws}int fvb\\(void\\);)|(${ws}virtual int vvb\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
pass "ptype vb (obsolescent gcc or gdb)"
}
@@ -401,6 +446,9 @@ proc test_ptype_of_classes {} {
-re "type = class A : public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}int a;${ws}public:${ws}A & operator=\\(A const &\\);${ws}A\\(int, A const &\\);${ws}A\\(int\\);${ws}virtual int f\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pAa"
}
+ -re "type = class A : public virtual V \{${ws}private:${ws}int a;${ws}public:${ws}virtual int f\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pAa (aCC)"
+ }
-re "type = class A : public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}int a;${ws}public:((${ws}A & operator=\\(A const &\\);)|(${ws}A\\(int, A const &\\);)|(${ws}A\\(int\\);)|(${ws}virtual int f\\(void\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pAa (obsolescent gcc or gdb)"
}
@@ -417,6 +465,9 @@ proc test_ptype_of_classes {} {
-re "type = class A : public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}int a;${ws}public:${ws}A & operator=\\(A const &\\);${ws}A\\(int, A const &\\);${ws}A\\(int\\);${ws}virtual int f\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pAe"
}
+ -re "type = class A : public virtual V \{${ws}private:${ws}int a;${ws}public:${ws}virtual int f\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pAe (aCC)"
+ }
-re "type = class A : public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}int a;${ws}public:((${ws}A & operator=\\(A const &\\);)|(${ws}A\\(int, A const &\\);)|(${ws}A\\(int\\);)|(${ws}virtual int f\\(void\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pAe (obsolescent gcc or gdb)"
}
@@ -433,6 +484,9 @@ proc test_ptype_of_classes {} {
-re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}B & operator=\\(B const &\\);${ws}B\\(int, B const &\\);${ws}B\\(int\\);${ws}virtual int f\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pBe"
}
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}virtual int f \\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pBe (aCC)"
+ }
-re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:((${ws}B & operator=\\(B const &\\);)|(${ws}B\\(int, B const &\\);)|(${ws}B\\(int\\);)|(${ws}virtual int f\\(void\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pBe (obsolescent gcc or gdb)"
}
@@ -449,6 +503,9 @@ proc test_ptype_of_classes {} {
-re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int d;${ws}D & operator=\\(D const &\\);${ws}D\\(int, D const &\\);${ws}D\\(int\\);${ws}static void s\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vd\\(void\\);${ws}int fd\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pDd"
}
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}static void s\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vd\\(void\\);${ws}int fd\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pDd (aCC)"
+ }
-re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int d;((${ws}D & operator=\\(D const &\\);)|(${ws}D\\(int, D const &\\);)|(${ws}D\\(int\\);)|(${ws}static void s\\(void\\);)|(${ws}virtual int vg\\(void\\);)|(${ws}virtual int vd\\(void\\);)|(${ws}int fd\\(void\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pDd (obsolescent gcc or gdb)"
}
@@ -465,6 +522,9 @@ proc test_ptype_of_classes {} {
-re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int d;${ws}D & operator=\\(D const &\\);${ws}D\\(int, D const &\\);${ws}D\\(int\\);${ws}static void s\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vd\\(void\\);${ws}int fd\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pDe"
}
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}static void s\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vd\\(void\\);${ws}int fd\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pDe (aCC)"
+ }
-re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \[*\]+_vb.V;${ws}public:${ws}int d;((${ws}D & operator=\\(D const &\\);)|(${ws}D\\(int, D const &\\);)|(${ws}D\\(int\\);)|(${ws}static void s\\(void\\);)|(${ws}virtual int vg\\(void\\);)|(${ws}virtual int vd\\(void\\);)|(${ws}int fd\\(void\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pDe (obsolescent gcc or gdb)"
}
@@ -481,6 +541,9 @@ proc test_ptype_of_classes {} {
-re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}V & operator=\\(V const &\\);${ws}V\\(V const &\\);${ws}V\\(void\\);${ws}int f\\(void\\);${ws}virtual int vv\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pVa"
}
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}int f \\(void\\);${ws}virtual int vv \\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVa (aCC)"
+ }
-re "type = class V : public VA, public VB \{${ws}public:${ws}int w;((${ws}V & operator=\\(V const &\\);)|(${ws}V\\(V const &\\);)|(${ws}V\\(void\\);)|(${ws}int f\\(void\\);)|(${ws}virtual int vv\\(void\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pVa (obsolescent gcc or gdb)"
}
@@ -497,6 +560,9 @@ proc test_ptype_of_classes {} {
-re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}V & operator=\\(V const &\\);${ws}V\\(V const &\\);${ws}V\\(void\\);${ws}int f\\(void\\);${ws}virtual int vv\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pVv"
}
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}int f \\(void\\);${ws}virtual int vv \\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVv (aCC)"
+ }
-re "type = class V : public VA, public VB \{${ws}public:${ws}int w;((${ws}V & operator=\\(V const &\\);)|(${ws}V\\(V const &\\);)|(${ws}V\\(void\\);)|(${ws}int f\\(void\\);)|(${ws}virtual int vv\\(void\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pVv (obsolescent gcc or gdb)"
}
@@ -513,6 +579,9 @@ proc test_ptype_of_classes {} {
-re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}V & operator=\\(V const &\\);${ws}V\\(V const &\\);${ws}V\\(void\\);${ws}int f\\(void\\);${ws}virtual int vv\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pVe"
}
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}int f \\(void\\);${ws}virtual int vv \\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVe (aCC)"
+ }
-re "type = class V : public VA, public VB \{${ws}public:${ws}int w;((${ws}V & operator=\\(V const &\\);)|(${ws}V\\(V const &\\);)|(${ws}V\\(void\\);)|(${ws}int f\\(void\\);)|(${ws}virtual int vv\\(void\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pVe (obsolescent gcc or gdb)"
}
@@ -529,6 +598,9 @@ proc test_ptype_of_classes {} {
-re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}V & operator=\\(V const &\\);${ws}V\\(V const &\\);${ws}V\\(void\\);${ws}int f\\(void\\);${ws}virtual int vv\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pVd"
}
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}int f \\(void\\);${ws}virtual int vv \\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVd (aCC)"
+ }
-re "type = class V : public VA, public VB \{${ws}public:${ws}int w;((${ws}V & operator=\\(V const &\\);)|(${ws}V\\(V const &\\);)|(${ws}V\\(void\\);)|(${ws}int f\\(void\\);)|(${ws}virtual int vv\\(void\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pVd (obsolescent gcc or gdb)"
}
@@ -545,6 +617,9 @@ proc test_ptype_of_classes {} {
-re "type = class AD \{${ws}public:${ws}AD & operator=\\(AD const &\\);${ws}AD\\(AD const &\\);${ws}AD\\(void\\);${ws}virtual int vg\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pADe"
}
+ -re "type = class AD \{${ws}public:${ws}virtual int vg \\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pADe (aCC)"
+ }
-re "type = class AD \{${ws}public:((${ws}AD & operator=\\(AD const &\\);)|(${ws}AD\\(AD const &\\);)|(${ws}AD\\(void\\);)|(${ws}virtual int vg\\(void\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pADe (obsolescent gcc or gdb)"
}
@@ -561,6 +636,9 @@ proc test_ptype_of_classes {} {
-re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}E & operator=\\(E const &\\);${ws}E\\(int, E const &\\);${ws}E\\(int\\);${ws}virtual int f\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vv\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pEe"
}
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}virtual int f \\(void\\);${ws}virtual int vg \\(void\\);${ws}virtual int vv \\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pEe (aCC)"
+ }
-re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;((${ws}E & operator=\\(E const &\\);)|(${ws}E\\(int, E const &\\);)|(${ws}E\\(int\\);)|(${ws}virtual int f\\(void\\);)|(${ws}virtual int vg\\(void\\);)|(${ws}virtual int vv\\(void\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pEe (obsolescent gcc or gdb)"
}
@@ -577,6 +655,9 @@ proc test_ptype_of_classes {} {
-re "type = class VB \{${ws}public:${ws}int vb;${ws}VB & operator=\\(VB const &\\);${ws}VB\\(VB const &\\);${ws}VB\\(void\\);${ws}int fvb\\(void\\);${ws}virtual int vvb\\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pVB"
}
+ -re "type = class VB \{${ws}public:${ws}int vb;${ws}int fvb \\(void\\);${ws}virtual int vvb \\(void\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVB (aCC)"
+ }
-re "type = class VB \{${ws}public:${ws}int vb;((${ws}VB & operator=\\(VB const &\\);)|(${ws}VB\\(VB const &\\);)|(${ws}VB\\(void\\);)|(${ws}int fvb\\(void\\);)|(${ws}virtual int vvb\\(void\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
pass "ptype pVB (obsolescent gcc or gdb)"
}
@@ -616,6 +697,10 @@ proc test_virtual_calls {} {
(known failure with gcc cygnus-2.4.5-930417, skipping virtual calls)"
return 0
}
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pAe->f()"
+ }
-re ".*$gdb_prompt $" { fail "print pAe->f()" }
timeout { fail "print pAe->f() (timeout)" }
eof { fail "print pAe->f() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
@@ -624,15 +709,22 @@ proc test_virtual_calls {} {
send_gdb "print pAa->f()\n"
gdb_expect {
-re ".* = 1$nl$gdb_prompt $" { pass "print pAa->f()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pAa->f()"
+ }
-re ".*$gdb_prompt $" { fail "print pAa->f()" }
timeout { fail "print pAa->f() (timeout)" }
eof { fail "print pAa->f() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
send_gdb "print pDe->vg()\n"
-# setup_xfail "*-*-*"
gdb_expect {
-re ".* = 202$nl$gdb_prompt $" { pass "print pDe->vg()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pDe->vg()"
+ }
-re ".*$gdb_prompt $" { fail "print pDe->vg()" }
timeout { fail "print pDe->vg() (timeout)" }
eof { fail "print pDe->vg() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
@@ -641,24 +733,34 @@ proc test_virtual_calls {} {
send_gdb "print pADe->vg()\n"
gdb_expect {
-re ".* = 202$nl$gdb_prompt $" { pass "print pADe->vg()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pADe->vg()"
+ }
-re ".*$gdb_prompt $" { fail "print pADe->vg()" }
timeout { fail "print pADe->vg() (timeout)" }
eof { fail "print pADe->vg() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
send_gdb "print pDd->vg()\n"
-# setup_xfail "*-*-*"
gdb_expect {
-re ".* = 101$nl$gdb_prompt $" { pass "print pDd->vg()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pDd->vg()"
+ }
-re ".*$gdb_prompt $" { fail "print pDd->vg()" }
timeout { fail "print pDd->vg() (timeout)" }
eof { fail "print pDd->vg() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
send_gdb "print pEe->vvb()\n"
-# setup_xfail "*-*-*"
gdb_expect {
-re ".* = 411$nl$gdb_prompt $" { pass "print pEe->vvb()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pEe->vvb()"
+ }
-re ".*$gdb_prompt $" { fail "print pEe->vvb()" }
timeout { fail "print pEe->vvb() (timeout)" }
eof { fail "print pEe->vvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
@@ -667,42 +769,58 @@ proc test_virtual_calls {} {
send_gdb "print pVB->vvb()\n"
gdb_expect {
-re ".* = 407$nl$gdb_prompt $" { pass "print pVB->vvb()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pVB->vvb()"
+ }
-re ".*$gdb_prompt $" { fail "print pVB->vvb()" }
timeout { fail "print pVB->vvb() (timeout)" }
eof { fail "print pVB->vvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
send_gdb "print pBe->vvb()\n"
-# setup_xfail "*-*-*"
gdb_expect {
-re ".* = 411$nl$gdb_prompt $" { pass "print pBe->vvb()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pBe->vvb()"
+ }
-re ".*$gdb_prompt $" { fail "print pBe->vvb()" }
timeout { fail "print pBe->vvb() (timeout)" }
eof { fail "print pBe->vvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
send_gdb "print pDe->vvb()\n"
-# setup_xfail "*-*-*"
gdb_expect {
-re ".* = 411$nl$gdb_prompt $" { pass "print pDe->vvb()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pDe->vvb()"
+ }
-re ".*$gdb_prompt $" { fail "print pDe->vvb()" }
timeout { fail "print pDe->vvb() (timeout)" }
eof { fail "print pDe->vvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
send_gdb "print pEe->vd()\n"
-# setup_xfail "*-*-*"
gdb_expect {
-re ".* = 282$nl$gdb_prompt $" { pass "print pEe->vd()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pEe->vd()"
+ }
-re ".*$gdb_prompt $" { fail "print pEe->vd()" }
timeout { fail "print pEe->vd() (timeout)" }
eof { fail "print pEe->vd() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
}
send_gdb "print pEe->fvb()\n"
-# setup_xfail "*-*-*"
gdb_expect {
-re ".* = 311$nl$gdb_prompt $" { pass "print pEe->fvb()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pEe->fvb()"
+ }
-re ".*$gdb_prompt $" { fail "print pEe->fvb()" }
timeout { fail "print pEe->fvb() (timeout)" }
eof { fail "print pEe->fvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 3e71adcae6b..ad1e5ad7b29 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -131,8 +131,11 @@ proc gdb_unload {} {
proc delete_breakpoints {} {
global gdb_prompt
+ # we need a larger timeout value here or this thing just confuses
+ # itself. May need a better implementation if possible. - guo
+ #
send_gdb "delete breakpoints\n"
- gdb_expect 30 {
+ gdb_expect 100 {
-re "Delete all breakpoints.*y or n.*$" {
send_gdb "y\n";
exp_continue
@@ -142,7 +145,7 @@ proc delete_breakpoints {} {
timeout { perror "Delete all breakpoints in delete_breakpoints (timeout)" ; return }
}
send_gdb "info breakpoints\n"
- gdb_expect 30 {
+ gdb_expect 100 {
-re "No breakpoints or watchpoints..*$gdb_prompt $" {}
-re "$gdb_prompt $" { perror "breakpoints not deleted" ; return }
-re "Delete all breakpoints.*or n.*$" {
@@ -376,7 +379,12 @@ proc gdb_test { args } {
fail "$message";
return $result;
}
- gdb_expect 2 {
+ # since we're checking if each line of the multi-line
+ # command are 'accepted' by GDB here,
+ # we need to set -notransfer expect option so that
+ # command output is not lost for pattern matching
+ # - guo
+ gdb_expect -notransfer 2 {
-re "\[\r\n\]" { }
timeout { }
}
@@ -885,7 +893,7 @@ proc get_compiler_info {binfile args} {
return 1;
}
}
- } else {
+ } elseif { $args != "f77" } {
if { [eval gdb_preprocess \
[list "${srcdir}/${subdir}/compiler.c" "${binfile}.ci"] \
$args] != "" } {
@@ -932,53 +940,70 @@ proc get_compiler_info {binfile args} {
return 0;
}
-proc gdb_preprocess {source dest args} {
- global CC_FOR_TARGET
- global CXX_FOR_TARGET
+proc get_compiler {args} {
+ global CC CC_FOR_TARGET CXX CXX_FOR_TARGET F77_FOR_TARGET
- if { [llength $args] == 0 } {
+ if { [llength $args] == 0
+ || ([llength $args] == 1 && [lindex $args 0] == "") } {
set which_compiler "c"
} else {
if { $args =="c++" } {
set which_compiler "c++"
+ } elseif { $args =="f77" } {
+ set which_compiler "f77"
} else {
perror "Unknown compiler type supplied to gdb_preprocess"
- return 1;
+ return ""
}
}
if [info exists CC_FOR_TARGET] {
- if { $which_compiler == "c"} {
- set compiler $CC_FOR_TARGET;
+ if {$which_compiler == "c"} {
+ set compiler $CC_FOR_TARGET
}
}
if [info exists CXX_FOR_TARGET] {
- if { $which_compiler == "c++"} {
- set compiler $CXX_FOR_TARGET;
+ if {$which_compiler == "c++"} {
+ set compiler $CXX_FOR_TARGET
+ }
+ }
+
+ if [info exists F77_FOR_TARGET] {
+ if {$which_compiler == "f77"} {
+ set compiler $F77_FOR_TARGET
}
}
if { ![info exists compiler] } {
if { $which_compiler == "c" } {
if {[info exists CC]} {
- set compiler $CC;
+ set compiler $CC
}
}
if { $which_compiler == "c++" } {
if {[info exists CXX]} {
- set compiler $CXX;
+ set compiler $CXX
}
}
if {![info exists compiler]} {
set compiler [board_info [target_info name] compiler];
if { $compiler == "" } {
- puts "default_target_compile: No compiler to compile with";
- return "default_target_compile: No compiler to compile with";
+ perror "get_compiler: No compiler found"
+ return ""
}
}
}
+ return $compiler
+}
+
+proc gdb_preprocess {source dest args} {
+ set compiler [get_compiler "$args"]
+ if { $compiler == "" } {
+ return 1
+ }
+
set cmdline "$compiler -E $source > $dest"
verbose "Invoking $compiler -E $source > $dest"
@@ -1034,6 +1059,20 @@ proc send_gdb { string } {
#
proc gdb_expect { args } {
+ # allow -notransfer expect flag specification,
+ # used by gdb_test routine for multi-line commands.
+ # packed with gtimeout when fed to remote_expect routine,
+ # which is a hack but due to what looks like a res and orig
+ # parsing problem in remote_expect routine (dejagnu/lib/remote.exp):
+ # what's fed into res is not removed from orig.
+ # - guo
+ if { [lindex $args 0] == "-notransfer" } {
+ set notransfer -notransfer;
+ set args [lrange $args 1 end];
+ } else {
+ set notransfer "";
+ }
+
if { [llength $args] == 2 && [lindex $args 0] != "-re" } {
set gtimeout [lindex $args 0];
set expcode [list [lindex $args 1]];
@@ -1073,7 +1112,8 @@ proc gdb_expect { args } {
set remote_suppress_flag 1;
}
}
- set code [catch {uplevel remote_expect host $gtimeout $expcode} string];
+ set code [catch \
+ {uplevel remote_expect host "$gtimeout $notransfer" $expcode} string];
if [info exists old_val] {
set remote_suppress_flag $old_val;
} else {
diff --git a/gdb/top.c b/gdb/top.c
index 525e0a3fe37..55359375711 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -680,6 +680,12 @@ gdb_init (argv0)
getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
current_directory = gdb_dirbuf;
+#ifdef __MSDOS__
+ /* Make sure we return to the original directory upon exit, come
+ what may, since the OS doesn't do that for us. */
+ make_final_cleanup ((make_cleanup_func) chdir, strsave (current_directory));
+#endif
+
init_cmd_lists (); /* This needs to be done first */
initialize_targets (); /* Setup target_terminal macros for utils.c */
initialize_utils (); /* Make errors and warnings possible */
@@ -3362,13 +3368,32 @@ cd_command (dir, from_tty)
if (chdir (dir) < 0)
perror_with_name (dir);
+#if defined(_WIN32) || defined(__MSDOS__)
+ /* There's too much mess with DOSish names like "d:", "d:.",
+ "d:./foo" etc. Instead of having lots of special #ifdef'ed code,
+ simply get the canonicalized name of the current directory. */
+ dir = getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
+#endif
+
len = strlen (dir);
- dir = savestring (dir, len - (len > 1 && SLASH_P (dir[len - 1])));
+ if (SLASH_P (dir[len-1]))
+ {
+ /* Remove the trailing slash unless this is a root directory
+ (including a drive letter on non-Unix systems). */
+ if (!(len == 1) /* "/" */
+#if defined(_WIN32) || defined(__MSDOS__)
+ && !(!SLASH_P (*dir) && ROOTED_P (dir) && len <= 3) /* "d:/" */
+#endif
+ )
+ len--;
+ }
+
+ dir = savestring (dir, len);
if (ROOTED_P (dir))
current_directory = dir;
else
{
- if (SLASH_P (current_directory[0]) && current_directory[1] == '\0')
+ if (SLASH_P (current_directory[strlen (current_directory) - 1]))
current_directory = concat (current_directory, dir, NULL);
else
current_directory = concat (current_directory, SLASH_STRING, dir, NULL);
@@ -3755,7 +3780,12 @@ init_history ()
/* We include the current directory so that if the user changes
directories the file written will be the same as the one
that was read. */
+#ifdef __MSDOS__
+ /* No leading dots in file names are allowed on MSDOS. */
+ history_filename = concat (current_directory, "/_gdb_history", NULL);
+#else
history_filename = concat (current_directory, "/.gdb_history", NULL);
+#endif
}
read_history (history_filename);
}
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index cb040bbf9c7..ef73399978f 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -1827,7 +1827,7 @@ xcoff_psymtab_to_symtab_1 (pst)
/* Init stuff necessary for reading in symbols. */
stabsread_init ();
buildsym_init ();
- old_chain = make_cleanup ((make_cleanup_func) really_free_pendings, 0);
+ old_chain = make_cleanup (really_free_pendings, 0);
read_xcoff_symtab (pst);
sort_symtab_syms (pst->symtab);
@@ -2743,7 +2743,7 @@ xcoff_initial_scan (objfile, section_offsets, mainline)
init_psymbol_list (objfile, num_symbols);
free_pending_blocks ();
- back_to = make_cleanup ((make_cleanup_func) really_free_pendings, 0);
+ back_to = make_cleanup (really_free_pendings, 0);
init_minimal_symbol_collection ();
make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0);
diff --git a/readline/CHANGELOG b/readline/CHANGELOG
index 8094590945c..479e6c042ac 100644
--- a/readline/CHANGELOG
+++ b/readline/CHANGELOG
@@ -75,3 +75,142 @@ examples/Makefile.in
---
configure.in
- bumped LIBVERSION up to 2.2
+
+ 4/18
+ ----
+[readline-2.2 released]
+
+ 4/20
+ ----
+Makefile.in
+ - make `libhistory.a' a dependency of `install'
+ - fixed a typo in the recipe for `install' that copied libreadline.a
+ to libhistory.old right after installing it
+
+ 4/27
+ ----
+doc/Makefile.in
+ - install {readline,history}.info out of the source directory if
+ they are not found in the current (build) directory -- only an
+ issue if the libraries are built in a different directory than
+ the source directory
+
+ 5/1
+ ---
+support/shobj-conf
+ - script from the bash distribution to do shared object and library
+ configuration
+
+shlib/Makefile.in
+ - new directory and makefile to handle building shared versions of
+ libreadline and libhistory, controlled by support/shobj-conf
+
+ 5/7
+ ---
+doc/Makefile.in
+ - set SHELL to /bin/sh, rather than relying on make to be correct
+
+ 5/14
+ ----
+savestring.c
+ - new file, moved from shell.c, for backwards compatibility
+
+Makefile.in, shlib/Makefile.in
+ - make sure savestring.c is compiled and added to libreadline and
+ libhistory
+
+[THERE ARE NO MORE #ifdef SHELL LINES IN THE C SOURCE FILES.]
+
+ 5/15
+ ----
+README
+ - updated description of shared library creation for the new scheme
+
+[THERE ARE NO MORE #ifdef SHELL LINES IN ANY OF THE SOURCE FILES.]
+
+Makefile.in
+ - bumped SHLIB_MAJOR up to 4 since we've augmented the library
+ API
+ - rlconf.h is now one of the installed headers, so applications can
+ find out whether things like vi-mode are available in the installed
+ libreadline
+
+ 5/20
+ ----
+configure.in
+ - changed RL_LIBRARY_VERSION to 4.0 to match the version of the
+ installed shared libraries
+
+ 6/5
+ ---
+rlstdc.h
+ - new file
+
+Makefile.in
+ - rlstdc.h is now one of the installed headers
+
+ 8/3
+ ---
+shlib/Makefile.in
+ - made the suffix rule that creates xx.so from xx.c write the
+ compiler output to `a.o', which is then mv'd to xx.so, because
+ some compilers (Sun WSpro 4.2, for example) don't allow any
+ suffixes other than `.o' for `cc -c' (not even `a.out')
+
+ 9/15
+ ----
+
+Makefile.in
+ - AR and ARFLAGS are now substituted by configure, used in recipes
+ that build the libraries
+
+configure.in
+ - use AC_CHECK_PROG to check for ar
+ - set ARFLAGS if it has not already been set in the environment
+
+ 10/5
+ ----
+Makefile.in
+ - removed savestring.o from object file list
+
+ 10/28
+ -----
+shlib/Makefile.in
+ - don't use a fixed filename in the .c.so suffix rule to avoid
+ problems with parallel makes
+
+ 12/21
+ -----
+support/shlib-install
+ - new script to install shared readline and history libraries
+
+shlib/Makefile.in
+ - changed to call shlib-install for install and uninstall targets
+
+[readline-4.0-beta1 frozen]
+
+ 12/22
+ -----
+configure.in
+ - call AC_SUBST for SHOBJ_XLDFLAGS and SHLIB_LIBS
+
+shlib/Makefile.in
+ - SHOBJ_XLDFLAGS and SHLIB_LIBS are now substituted by configure
+ - add $(SHLIB_LIBS) at end of command line that builds the shared
+ libraries (currently needed only by AIX 4.2)
+
+ 12/31
+ -----
+MANIFEST, MANIFEST.doc
+ - the TOC html files are no longer generated and no longer part of
+ the distribution
+
+ 2/18/1999
+ ---------
+configure.in
+ - set MAKE_SHELL to /bin/sh and substitute into the Makefiles
+
+Makefile.in,{doc,examples,shlib}/Makefile.in
+ - set SHELL from @MAKE_SHELL@
+
+[readline-4.0 released]
diff --git a/readline/CHANGES b/readline/CHANGES
index 382406e30db..65339c2e036 100644
--- a/readline/CHANGES
+++ b/readline/CHANGES
@@ -1,22 +1,131 @@
-This document details the changes between this version, readline-2.2.1,
+This document details the changes between this version, readline-4.0,
and the previous version, readline-2.2.
1. Changes to Readline
-a. The `make install' target was corrected so that it did not move the
- newly-installed libreadline.a to libhistory.old
+a. The version number is now 4.0, to match the major and minor version
+ numbers on the shared readline and history libraries. Future
+ releases will maintain the identical numbering.
-b. The `make install' target for the documentation will now install the
- info files from the source directory if they do not appear in the
- build directory, since they are shipped in the readline tar file.
+b. Fixed a typo in the `make install' recipe that copied libreadline.a
+ to libhistory.old right after installing it.
-c. Fixed a problem with redisplay that showed up when the prompt string was
- longer than the screen width and the prompt contained invisible characters.
+c. The readline and history info files are now installed out of the source
+ directory if they are not found in the build directory.
-d. Fixed a problem with the paren matching code -- the blink was far too
- short (it's specified in microseconds, not milliseconds, Chet!).
+d. The library no longer exports a function named `savestring' -- backwards
+ compatibility be damned.
-------------------------------------------------------------------------------
+e. There is no longer any #ifdef SHELL code in the source files.
+
+f. Some changes were made to the key binding code to fix memory leaks and
+ better support Win32 systems.
+
+g. Fixed a silly typo in the paren matching code -- it's microseconds, not
+ milliseconds.
+
+h. The readline library should be compilable by C++ compilers.
+
+i. The readline.h public header file now includes function prototypes for
+ all readline functions, and some changes were made to fix errors in the
+ source files uncovered by the use of prototypes.
+
+j. The maximum numeric argument is now clamped at 1000000.
+
+k. Fixes to rl_yank_last_arg to make it behave better.
+
+l. Fixed a bug in the display code that caused core dumps if the prompt
+ string length exceeded 1024 characters.
+
+m. The menu completion code was fixed to properly insert a single completion
+ if there is only one match.
+
+n. A bug was fixed that caused the display code to improperly display tabs
+ after newlines.
+
+o. A fix was made to the completion code in which a typo caused the wrong
+ value to be passed to the function that computed the longest common
+ prefix of the list of matches.
+
+p. The completion code now checks the value of rl_filename_completion_desired,
+ which is set by application-supplied completion functions to indicate
+ that filename completion is being performed, to decide whether or not to
+ call an application-supplied `ignore completions' function.
+
+q. Code was added to the history library to catch history substitutions
+ using `&' without a previous history substitution or search having been
+ performed.
+
+
+2. New Features in Readline
+
+a. There is a new script, support/shobj-conf, to do system-specific shared
+ object and library configuration. It generates variables for configure
+ to substitute into makefiles. The README file provides a detailed
+ explanation of the shared library creation process.
+
+b. Shared libraries and objects are now built in the `shlib' subdirectory.
+ There is a shlib/Makefile.in to control the build process. `make shared'
+ from the top-level directory is still the right way to build shared
+ versions of the libraries.
+
+c. rlconf.h is now installed, so applications can find out which features
+ have been compiled into the installed readline and history libraries.
+
+d. rlstdc.h is now an installed header file.
+
+e. Many changes to the signal handling:
+ o Readline now catches SIGQUIT and cleans up the tty before returning;
+ o A new variable, rl_catch_signals, is available to application writers
+ to indicate to readline whether or not it should install its own
+ signal handlers for SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP,
+ SIGTTIN, and SIGTTOU;
+ o A new variable, rl_catch_sigwinch, is available to application
+ writers to indicate to readline whether or not it should install its
+ own signal handler for SIGWINCH, which will chain to the calling
+ applications's SIGWINCH handler, if one is installed;
+ o There is a new function, rl_free_line_state, for application signal
+ handlers to call to free up the state associated with the current
+ line after receiving a signal;
+ o There is a new function, rl_cleanup_after_signal, to clean up the
+ display and terminal state after receiving a signal;
+ o There is a new function, rl_reset_after_signal, to reinitialize the
+ terminal and display state after an application signal handler
+ returns and readline continues
+
+f. There is a new function, rl_resize_terminal, to reset readline's idea of
+ the screen size after a SIGWINCH.
+
+g. New public functions: rl_save_prompt and rl_restore_prompt. These were
+ previously private functions with a `_' prefix. These functions are
+ used when an application wants to write a message to the `message area'
+ with rl_message and have the prompt restored correctly when the message
+ is erased.
+
+h. New function hook: rl_pre_input_hook, called just before readline starts
+ reading input, after initialization.
+
+i. New function hook: rl_display_matches_hook, called when readline would
+ display the list of completion matches. The new function
+ rl_display_match_list is what readline uses internally, and is available
+ for use by application functions called via this hook.
+
+j. New bindable function, delete-char-or-list, like tcsh.
+
+k. A new variable, rl_erase_empty_line, which, if set by an application using
+ readline, will cause readline to erase, prompt and all, lines on which the
+ only thing typed was a newline.
+
+l. There is a new script, support/shlib-install, to install and uninstall
+ the shared readline and history libraries.
+
+m. A new bindable variable, `isearch-terminators', which is a string
+ containing the set of characters that should terminate an incremental
+ search without being executed as a command.
+
+n. A new bindable function, forward-backward-delete-char.
+
+-------------------------------------------------------------------------------
This document details the changes between this version, readline-2.2,
and the previous version, readline-2.1.
diff --git a/readline/MANIFEST b/readline/MANIFEST
index e9e1c4005f9..f23ff41aff8 100644
--- a/readline/MANIFEST
+++ b/readline/MANIFEST
@@ -4,6 +4,7 @@
doc d
examples d
support d
+shlib d
COPYING f
README f
MANIFEST f
@@ -27,6 +28,7 @@ posixstat.h f
readline.h f
rlconf.h f
rldefs.h f
+rlstdc.h f
rltty.h f
rlwinsize.h f
tcap.h f
@@ -45,6 +47,7 @@ nls.c f
parens.c f
readline.c f
rltty.c f
+savestring.c f
search.c f
shell.c f
signals.c f
@@ -60,13 +63,17 @@ history.c f
histexpand.c f
histfile.c f
histsearch.c f
+shlib/Makefile.in f
support/config.guess f
support/config.sub f
support/install.sh f
support/mkdirs f
support/mkdist f
+support/shobj-conf f
+support/shlib-install f
doc/Makefile.in f
doc/texinfo.tex f
+doc/manvers.texinfo f
doc/rlman.texinfo f
doc/rltech.texinfo f
doc/rluser.texinfo f
@@ -81,5 +88,16 @@ examples/fileman.c f
examples/manexamp.c f
examples/rltest.c f
examples/rl.c f
+examples/rlversion.c f
examples/histexamp.c f
examples/Inputrc f
+# formatted documentation, from MANIFEST.doc
+doc/readline.ps f
+doc/history.ps f
+doc/readline.dvi f
+doc/history.dvi f
+doc/readline.info f
+doc/history.info f
+doc/readline.html f
+doc/history.html f
+doc/readline.0 f
diff --git a/readline/Makefile.in b/readline/Makefile.in
index ae402fd047d..5c667ed69f5 100644
--- a/readline/Makefile.in
+++ b/readline/Makefile.in
@@ -28,13 +28,15 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
CC = @CC@
-LD = ld # needed when building shared libraries
RANLIB = @RANLIB@
-AR = ar
+AR = @AR@
+ARFLAGS = @ARFLAGS@
RM = rm -f
CP = cp
MV = mv
+SHELL = @MAKE_SHELL@
+
prefix = @prefix@
exec_prefix = @exec_prefix@
@@ -47,8 +49,6 @@ infodir = @infodir@
man3dir = $(mandir)/man3
-SHELL = /bin/sh
-
# Programs to make tags files.
ETAGS = etags -tw
CTAGS = ctags -tw
@@ -56,7 +56,6 @@ CTAGS = ctags -tw
CFLAGS = @CFLAGS@
LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"'
CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@ @CFLAGS@
DEFS = @DEFS@
LOCAL_DEFS = @LOCAL_DEFS@
@@ -66,34 +65,14 @@ INCLUDES = -I. -I$(srcdir) -I$(includedir)
CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES) $(LOCAL_CFLAGS) $(CFLAGS)
-# these two options need tweaking for compiler/OS versions other than gcc
-# and SunOS4
-PICFLAG= -fpic # -pic for some versions of cc
-SHLIB_OPTS= -assert pure-text -ldl # -Bshareable for some versions of gcc
-
-MAJOR= 3
-# shared library systems like SVR4's do not use minor versions
-MINOR= .0
-
-.SUFFIXES: .so
-
.c.o:
+ ${RM} $@
$(CC) -c $(CCFLAGS) $<
-.c.so:
- -mv $*.o z$*.o
- $(CC) -c $(PICFLAG) $(CCFLAGS) $<
- mv $*.o $@
- -mv z$*.o $*.o
-
# The name of the main library target.
LIBRARY_NAME = libreadline.a
STATIC_LIBS = libreadline.a libhistory.a
-SHARED_READLINE = libreadline.so.$(MAJOR)$(MINOR)
-SHARED_HISTORY = libhistory.so.$(MAJOR)$(MINOR)
-SHARED_LIBS = $(SHARED_READLINE) $(SHARED_HISTORY)
-
# The C code source files for this library.
CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
$(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \
@@ -104,65 +83,50 @@ CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
$(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c \
$(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \
$(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \
- $(srcdir)/shell.c $(srcdir)/tilde.c
+ $(srcdir)/shell.c $(srcdir)/savestring.c $(srcdir)/tilde.c
# The header files for this library.
HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
- ansi_stdlib.h tcap.h
+ ansi_stdlib.h tcap.h rlstdc.h
-HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o
+HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o
TILDEOBJ = tilde.o
OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
rltty.o complete.o bind.o isearch.o display.o signals.o \
util.o kill.o undo.o macro.o input.o callback.o terminal.o \
nls.o xmalloc.o $(HISTOBJ) $(TILDEOBJ)
-SHARED_HISTOBJ = history.so histexpand.so histfile.so histsearch.so shell.so
-SHARED_TILDEOBJ = tilde.so
-SHARED_OBJ = readline.so vi_mode.so funmap.so keymaps.so parens.so search.so \
- rltty.so complete.so bind.so isearch.so display.so signals.so \
- util.so kill.so undo.so macro.so input.so callback.so terminal.so \
- nls.so xmalloc.so $(SHARED_HISTOBJ) $(SHARED_TILDEOBJ)
-
# The texinfo files which document this library.
DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
DOCOBJECT = doc/readline.dvi
DOCSUPPORT = doc/Makefile
DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
-CREATED_MAKEFILES = Makefile doc/Makefile examples/Makefile
+CREATED_MAKEFILES = Makefile doc/Makefile examples/Makefile shlib/Makefile
CREATED_CONFIGURE = config.status config.h config.cache config.log \
stamp-config stamp-h
CREATED_TAGS = TAGS tags
-INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h
+INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \
+ rlstdc.h rlconf.h
##########################################################################
all: static
static: $(STATIC_LIBS)
-shared: $(SHARED_LIBS)
libreadline.a: $(OBJECTS)
$(RM) $@
- $(AR) cr $@ $(OBJECTS)
+ $(AR) $(ARFLAGS) $@ $(OBJECTS)
-test -n "$(RANLIB)" && $(RANLIB) $@
libhistory.a: $(HISTOBJ) xmalloc.o
$(RM) $@
- $(AR) cr $@ $(HISTOBJ) xmalloc.o
+ $(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o
-test -n "$(RANLIB)" && $(RANLIB) $@
-$(SHARED_READLINE): $(SHARED_OBJ)
- $(RM) $@
- $(LD) ${SHLIB_OPTS} -o $@ $(SHARED_OBJ)
-
-$(SHARED_HISTORY): $(SHARED_HISTOBJ) xmalloc.so
- $(RM) $@
- $(LD) ${SHLIB_OPTS} -o $@ $(SHARED_HISTOBJ) xmalloc.so
-
readline: $(OBJECTS) readline.h rldefs.h chardefs.h
$(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a -ltermcap
@@ -187,6 +151,10 @@ stamp-h: config.status $(srcdir)/config.h.in
#$(srcdir)/configure: $(srcdir)/configure.in Comment-me-out in distribution
# cd $(srcdir) && autoconf Comment-me-out in distribution
+shared: force
+ -test -d shlib || mkdir shlib
+ -( cd shlib ; ${MAKE} ${MFLAGS} all )
+
documentation: force
-test -d doc || mkdir doc
-( cd doc && $(MAKE) $(MFLAGS) )
@@ -233,13 +201,10 @@ uninstall:
${RM} libreadline.a libreadline.old libhistory.a libhistory.old $(SHARED_LIBS)
install-shared: installdirs shared
- -$(MV) $(libdir)/$(SHARED_HISTORY) $(libdir)/$(SHARED_HISTORY).old
- $(INSTALL_DATA) $(SHARED_HISTORY) $(libdir)/$(SHARED_HISTORY)
- -$(MV) $(libdir)/$(SHARED_READLINE) $(libdir)/$(SHARED_READLINE).old
- $(INSTALL_DATA) $(SHARED_READLINE) $(libdir)/$(SHARED_READLINE)
+ -( cd shlib ; ${MAKE} ${MFLAGS} install )
uninstall-shared:
- -test -n "$(libdir)" && cd $(libdir) && ${RM} ${SHARED_LIBS}
+ -( cd shlib; ${MAKE} ${MFLAGS} uninstall )
TAGS: force
$(ETAGS) $(CSOURCES) $(HSOURCES)
@@ -249,15 +214,17 @@ tags: force
clean: force
$(RM) $(OBJECTS) $(STATIC_LIBS)
- $(RM) $(SHARED_OBJ) $(SHARED_LIBS)
+ -( cd shlib && $(MAKE) $(MFLAGS) $@ )
-( cd doc && $(MAKE) $(MFLAGS) $@ )
-( cd examples && $(MAKE) $(MFLAGS) $@ )
mostlyclean: clean
+ -( cd shlib && $(MAKE) $(MFLAGS) $@ )
-( cd doc && $(MAKE) $(MFLAGS) $@ )
-( cd examples && $(MAKE) $(MFLAGS) $@ )
distclean maintainer-clean: clean
+ -( cd shlib && $(MAKE) $(MFLAGS) $@ )
-( cd doc && $(MAKE) $(MFLAGS) $@ )
-( cd examples && $(MAKE) $(MFLAGS) $@ )
$(RM) Makefile
@@ -285,89 +252,89 @@ dist: force
# Dependencies
bind.o: ansi_stdlib.h posixstat.h
bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-bind.o: readline.h keymaps.h chardefs.h tilde.h
+bind.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
bind.o: history.h
callback.o: rlconf.h
callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-callback.o: readline.h keymaps.h chardefs.h tilde.h
+callback.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
complete.o: ansi_stdlib.h posixdir.h posixstat.h
complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-complete.o: readline.h keymaps.h chardefs.h tilde.h
+complete.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
display.o: ansi_stdlib.h posixstat.h
display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
display.o: tcap.h
display.o: readline.h keymaps.h chardefs.h tilde.h
-display.o: history.h
+display.o: history.h rlstdc.h
funmap.o: readline.h keymaps.h chardefs.h tilde.h
-funmap.o: rlconf.h ansi_stdlib.h
+funmap.o: rlconf.h ansi_stdlib.h rlstdc.h
funmap.o: ${BUILD_DIR}/config.h
histexpand.o: ansi_stdlib.h
-histexpand.o: history.h histlib.h
+histexpand.o: history.h histlib.h rlstdc.h
histexpand.o: ${BUILD_DIR}/config.h
histfile.o: ansi_stdlib.h
-histfile.o: history.h histlib.h
+histfile.o: history.h histlib.h rlstdc.h
histfile.o: ${BUILD_DIR}/config.h
history.o: ansi_stdlib.h
-history.o: history.h histlib.h
+history.o: history.h histlib.h rlstdc.h
history.o: ${BUILD_DIR}/config.h
histsearch.o: ansi_stdlib.h
-histsearch.o: history.h histlib.h
+histsearch.o: history.h histlib.h rlstdc.h
histsearch.o: ${BUILD_DIR}/config.h
input.o: ansi_stdlib.h
input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-input.o: readline.h keymaps.h chardefs.h tilde.h
+input.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
isearch.o: readline.h keymaps.h chardefs.h tilde.h
-isearch.o: ansi_stdlib.h history.h
+isearch.o: ansi_stdlib.h history.h rlstdc.h
keymaps.o: emacs_keymap.c vi_keymap.c
keymaps.o: keymaps.h chardefs.h rlconf.h ansi_stdlib.h
keymaps.o: readline.h keymaps.h chardefs.h tilde.h
-keymaps.o: ${BUILD_DIR}/config.h
+keymaps.o: ${BUILD_DIR}/config.h rlstdc.h
kill.o: ansi_stdlib.h
kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
kill.o: readline.h keymaps.h chardefs.h tilde.h
-kill.o: history.h
+kill.o: history.h rlstdc.h
macro.o: ansi_stdlib.h
macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
macro.o: readline.h keymaps.h chardefs.h tilde.h
-macro.o: history.h
+macro.o: history.h rlstdc.h
nls.o: ansi_stdlib.h
nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
parens.o: rlconf.h
parens.o: ${BUILD_DIR}/config.h
-parens.o: readline.h keymaps.h chardefs.h tilde.h
+parens.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
readline.o: readline.h keymaps.h chardefs.h tilde.h
readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-readline.o: history.h
+readline.o: history.h rlstdc.h
readline.o: posixstat.h ansi_stdlib.h posixjmp.h
rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
rltty.o: rltty.h
-rltty.o: readline.h keymaps.h chardefs.h tilde.h
+rltty.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
search.o: readline.h keymaps.h chardefs.h tilde.h
-search.o: ansi_stdlib.h history.h
+search.o: ansi_stdlib.h history.h rlstdc.h
shell.o: ${BUILD_DIR}/config.h
shell.o: ansi_stdlib.h
signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
signals.o: readline.h keymaps.h chardefs.h tilde.h
-signals.o: history.h
+signals.o: history.h rlstdc.h
terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
terminal.o: tcap.h
terminal.o: readline.h keymaps.h chardefs.h tilde.h
-terminal.o: history.h
+terminal.o: history.h rlstdc.h
tilde.o: ansi_stdlib.h
tilde.o: ${BUILD_DIR}/config.h
tilde.o: tilde.h
undo.o: ansi_stdlib.h
undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
undo.o: readline.h keymaps.h chardefs.h tilde.h
-undo.o: history.h
+undo.o: history.h rlstdc.h
util.o: posixjmp.h ansi_stdlib.h
util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-util.o: readline.h keymaps.h chardefs.h tilde.h
+util.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
vi_mode.o: readline.h keymaps.h chardefs.h tilde.h
-vi_mode.o: history.h ansi_stdlib.h
+vi_mode.o: history.h ansi_stdlib.h rlstdc.h
xmalloc.o: ${BUILD_DIR}/config.h
xmalloc.o: ansi_stdlib.h
@@ -396,95 +363,10 @@ history.o: $(srcdir)/history.c
histexpand.o: $(srcdir)/histexpand.c
histfile.o: $(srcdir)/histfile.c
histsearch.o: $(srcdir)/histsearch.c
+savestring.o: $(srcdir)/savestring.c
shell.o: $(srcdir)/shell.c
tilde.o: $(srcdir)/tilde.c
-bind.so: ansi_stdlib.h posixstat.h
-bind.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-bind.so: readline.h keymaps.h chardefs.h tilde.h
-bind.so: history.h
-callback.so: rlconf.h
-callback.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-callback.so: readline.h keymaps.h chardefs.h tilde.h
-complete.so: ansi_stdlib.h posixdir.h posixstat.h
-complete.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-complete.so: readline.h keymaps.h chardefs.h tilde.h
-display.so: ansi_stdlib.h posixstat.h
-display.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-display.so: tcap.h
-display.so: readline.h keymaps.h chardefs.h tilde.h
-display.so: history.h
-funmap.so: readline.h keymaps.h chardefs.h tilde.h
-funmap.so: rlconf.h ansi_stdlib.h
-funmap.so: ${BUILD_DIR}/config.h
-histexpand.so: ansi_stdlib.h
-histexpand.so: history.h histlib.h
-histexpand.so: ${BUILD_DIR}/config.h
-histfile.so: ansi_stdlib.h
-histfile.so: history.h histlib.h
-histfile.so: ${BUILD_DIR}/config.h
-history.so: ansi_stdlib.h
-history.so: history.h histlib.h
-history.so: ${BUILD_DIR}/config.h
-histsearch.so: ansi_stdlib.h
-histsearch.so: history.h histlib.h
-histsearch.so: ${BUILD_DIR}/config.h
-input.so: ansi_stdlib.h
-input.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-input.so: readline.h keymaps.h chardefs.h tilde.h
-isearch.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-isearch.so: readline.h keymaps.h chardefs.h tilde.h
-isearch.so: ansi_stdlib.h history.h
-keymaps.so: emacs_keymap.c vi_keymap.c
-keymaps.so: keymaps.h chardefs.h rlconf.h ansi_stdlib.h
-keymaps.so: readline.h keymaps.h chardefs.h tilde.h
-keymaps.so: ${BUILD_DIR}/config.h
-kill.so: ansi_stdlib.h
-kill.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-kill.so: readline.h keymaps.h chardefs.h tilde.h
-kill.so: history.h
-macro.so: ansi_stdlib.h
-macro.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-macro.so: readline.h keymaps.h chardefs.h tilde.h
-macro.so: history.h
-nls.so: ansi_stdlib.h
-nls.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-parens.so: rlconf.h
-parens.so: ${BUILD_DIR}/config.h
-parens.so: readline.h keymaps.h chardefs.h tilde.h
-readline.so: readline.h keymaps.h chardefs.h tilde.h
-readline.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-readline.so: history.h
-readline.so: posixstat.h ansi_stdlib.h posixjmp.h
-rltty.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-rltty.so: rltty.h
-rltty.so: readline.h keymaps.h chardefs.h tilde.h
-search.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-search.so: readline.h keymaps.h chardefs.h tilde.h
-search.so: ansi_stdlib.h history.h
-signals.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-signals.so: readline.h keymaps.h chardefs.h tilde.h
-signals.so: history.h
-terminal.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-terminal.so: tcap.h
-terminal.so: readline.h keymaps.h chardefs.h tilde.h
-terminal.so: history.h
-tilde.so: ansi_stdlib.h
-tilde.so: ${BUILD_DIR}/config.h
-tilde.so: tilde.h
-undo.so: ansi_stdlib.h
-undo.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-undo.so: readline.h keymaps.h chardefs.h tilde.h
-undo.so: history.h
-util.so: posixjmp.h ansi_stdlib.h
-util.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-util.so: readline.h keymaps.h chardefs.h tilde.h
-vi_mode.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
-vi_mode.so: readline.h keymaps.h chardefs.h tilde.h
-vi_mode.so: history.h ansi_stdlib.h
-xmalloc.so: ${BUILD_DIR}/config.h
-xmalloc.so: ansi_stdlib.h
-
readline.o: readline.c
vi_mode.o: vi_mode.c
funmap.o: funmap.c
@@ -510,61 +392,6 @@ history.o: history.c
histexpand.o: histexpand.c
histfile.o: histfile.c
histsearch.o: histsearch.c
+savestring.o: savestring.c
shell.o: shell.c
tilde.o: tilde.c
-
-readline.so: $(srcdir)/readline.c
-vi_mode.so: $(srcdir)/vi_mode.c
-funmap.so: $(srcdir)/funmap.c
-keymaps.so: $(srcdir)/keymaps.c
-parens.so: $(srcdir)/parens.c
-search.so: $(srcdir)/search.c
-rltty.so: $(srcdir)/rltty.c
-complete.so: $(srcdir)/complete.c
-bind.so: $(srcdir)/bind.c
-isearch.so: $(srcdir)/isearch.c
-display.so: $(srcdir)/display.c
-signals.so: $(srcdir)/signals.c
-util.so: $(srcdir)/util.c
-kill.so: $(srcdir)/kill.c
-undo.so: $(srcdir)/undo.c
-macro.so: $(srcdir)/macro.c
-input.so: $(srcdir)/input.c
-callback.so: $(srcdir)/callback.c
-terminal.so: $(srcdir)/terminal.c
-nls.so: $(srcdir)/nls.c
-xmalloc.so: $(srcdir)/xmalloc.c
-history.so: $(srcdir)/history.c
-histexpand.so: $(srcdir)/histexpand.c
-histfile.so: $(srcdir)/histfile.c
-histsearch.so: $(srcdir)/histsearch.c
-shell.so: $(srcdir)/shell.c
-tilde.so: $(srcdir)/tilde.c
-
-readline.so: readline.c
-vi_mode.so: vi_mode.c
-funmap.so: funmap.c
-keymaps.so: keymaps.c
-parens.so: parens.c
-search.so: search.c
-rltty.so: rltty.c
-complete.so: complete.c
-bind.so: bind.c
-isearch.so: isearch.c
-display.so: display.c
-signals.so: signals.c
-util.so: util.c
-kill.so: kill.c
-undo.so: undo.c
-macro.so: macro.c
-input.so: input.c
-callback.so: callback.c
-terminal.so: terminal.c
-nls.so: nls.c
-xmalloc.so: xmalloc.c
-history.so: history.c
-histexpand.so: histexpand.c
-histfile.so: histfile.c
-histsearch.so: histsearch.c
-shell.so: shell.c
-tilde.so: tilde.c
diff --git a/readline/README b/readline/README
index f19f92560a5..56565b2fb80 100644
--- a/readline/README
+++ b/readline/README
@@ -1,7 +1,7 @@
Introduction
============
-This is the Gnu Readline library, version 2.2
+This is the Gnu Readline library, version 4.0.
The Readline library provides a set of functions for use by applications
that allow users to edit command lines as they are typed in. Both
@@ -34,8 +34,8 @@ may work:
Read the file INSTALL in this directory for more information about how
to customize and control the build process.
-The file rlconf.h contains defines that enable and disable certain
-Readline features.
+The file rlconf.h contains C preprocessor defines that enable and disable
+certain Readline features.
Examples
========
@@ -49,32 +49,83 @@ Shared Libraries
================
There is skeletal support for building shared versions of the
-Readline and History libraries.
-
-Typing `make shared' will cause shared versions of the Readline and
-History libraries to be built on SunOS 4.1.x. For versions of Unix
-other than SunOS, you will have to make some changes to Makefile.in.
-The relevant variables are:
-
-PICFLAG Options to give to the compiler to produce position-independent
- code. The value `-fpic' works for most versions of gcc.
-SHLIB_OPTS Options to give to the linker to produce a shared library.
- The value `-assert pure-text -ldl' works on SunOS 4.1.x.
- The value `-Bshareable' works for some versions of GNU ld.
-
-MAJOR The major version number of the shared library. You should
- not need to change this.
-MINOR The minor version number of the shared library. Some systems,
- such as SVR4 and its descendents (e.g., Solaris, Unixware),
- do not use minor version numbers. For those systems, this
- variable should be left unset.
-
-LD The linker. The value of `ld' is correct for SunOS 4.1.x.
- You may need to change it to `gcc'; make sure to change
- SHLIB_OPTS if you do so.
-
-Once you have edited Makefile.in, type `make Makefile' to rebuild the
-Makefile, then `make shared' to build the shared libraries.
+Readline and History libraries. The configure script creates
+a Makefile in the `shlib' subdirectory, and typing `make shared'
+will cause shared versions of the Readline and History libraries
+to be built on supported platforms.
+
+Configure calls the script support/shobj-conf to test whether or
+not shared library creation is supported and to generate the values
+of variables that are substituted into shlib/Makefile. If you
+try to build shared libraries on an unsupported platform, `make'
+will display a message asking you to update support/shobj-conf for
+your platform.
+
+If you need to update support/shobj-conf, you will need to create
+a `stanza' for your operating system and compiler. The script uses
+the value of host_os and ${CC} as determined by configure. For
+instance, FreeBSD 2.2.5 with any version of gcc is identified as
+`freebsd2.2.5-gcc*'.
+
+In the stanza for your operating system-compiler pair, you will need to
+define several variables. They are:
+
+SHOBJ_CC The C compiler used to compile source files into shareable
+ object files. This is normally set to the value of ${CC}
+ by configure, and should not need to be changed.
+
+SHOBJ_CFLAGS Flags to pass to the C compiler ($SHOBJ_CC) to create
+ position-independent code. If you are using gcc, this
+ should probably be set to `-fpic'.
+
+SHOBJ_LD The link editor to be used to create the shared library from
+ the object files created by $SHOBJ_CC. If you are using
+ gcc, a value of `gcc' will probably work.
+
+SHOBJ_LDFLAGS Flags to pass to SHOBJ_LD to enable shared object creation.
+ If you are using gcc, `-shared' may be all that is necessary.
+ These should be the flags needed for generic shared object
+ creation.
+
+SHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library
+ creation. Many systems use the -R option to the link
+ editor to embed a path within the library for run-time
+ library searches. A reasonable value for such systems would
+ be `-R$(libdir)'.
+
+SHLIB_LIBS Any additional libraries that shared libraries should be
+ linked against when they are created.
+
+SHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when
+ generating the filename of the shared library. Many systems
+ use `so'; HP-UX uses `sl'.
+
+SHLIB_LIBVERSION The string to append to the filename to indicate the version
+ of the shared library. It should begin with $(SHLIB_LIBSUFF),
+ and possibly include version information that allows the
+ run-time loader to load the version of the shared library
+ appropriate for a particular program. Systems using shared
+ libraries similar to SunOS 4.x use major and minor library
+ version numbers; for those systems a value of
+ `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is appropriate.
+ Systems based on System V Release 4 don't use minor version
+ numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems.
+ Other Unix versions use different schemes.
+
+SHLIB_STATUS Set this to `supported' when you have defined the other
+ necessary variables. Make uses this to determine whether
+ or not shared library creation should be attempted.
+
+You should look at the existing stanzas in support/shobj-conf for ideas.
+
+Once you have updated support/shobj-conf, re-run configure and type
+`make shared'. The shared libraries will be created in the shlib
+subdirectory.
+
+Since shared libraries are not created on all platforms, `make install'
+will not automatically install the shared libraries. To install them,
+change the current directory to shlib and type `make install'. Running
+`make install-shared' from the top-level build directory will also work.
Documentation
=============
@@ -93,7 +144,7 @@ Bug reports for Readline should be sent to:
When reporting a bug, please include the following information:
- * the version number and release status of Readline (e.g., 2.2-release)
+ * the version number and release status of Readline (e.g., 4.0-release)
* the machine and OS that it is running on
* a list of the compilation flags or the contents of `config.h', if
appropriate
diff --git a/readline/aclocal.m4 b/readline/aclocal.m4
index 822ead0ee84..c277a0c6105 100644
--- a/readline/aclocal.m4
+++ b/readline/aclocal.m4
@@ -26,7 +26,7 @@ main()
exit(fl != 1);
}
], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no,
- [AC_MSG_ERROR(cannot check dup2 if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no)
bash_cv_dup2_broken=no])
])
AC_MSG_RESULT($bash_cv_dup2_broken)
@@ -129,7 +129,7 @@ main()
exit(ok ? 0 : 5);
}
], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes,
- [AC_MSG_ERROR(cannot check pgrp synchronization if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no)
bash_cv_pgrp_pipe=no])
])
AC_MSG_RESULT($bash_cv_pgrp_pipe)
@@ -187,7 +187,7 @@ main()
#endif
exit(1);
}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long,
- [AC_MSG_ERROR(cannot check quad_t if cross compiling -- defaulting to long)
+ [AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long)
bash_cv_type_rlimit=long])])
])
AC_MSG_RESULT($bash_cv_type_rlimit)
@@ -211,7 +211,7 @@ AC_CACHE_VAL(bash_cv_decl_under_sys_siglist,
#include <unistd.h>
#endif], [ char *msg = _sys_siglist[2]; ],
bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no,
- [AC_MSG_ERROR(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl
+ [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl
AC_MSG_RESULT($bash_cv_decl_under_sys_siglist)
if test $bash_cv_decl_under_sys_siglist = yes; then
AC_DEFINE(UNDER_SYS_SIGLIST_DECLARED)
@@ -237,7 +237,7 @@ char *msg = (char *)_sys_siglist[2];
exit(msg == 0);
}],
bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no,
- [AC_MSG_ERROR(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)
bash_cv_under_sys_siglist=no])])
AC_MSG_RESULT($bash_cv_under_sys_siglist)
if test $bash_cv_under_sys_siglist = yes; then
@@ -264,7 +264,7 @@ char *msg = sys_siglist[2];
exit(msg == 0);
}],
bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no,
- [AC_MSG_ERROR(cannot check for sys_siglist if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no)
bash_cv_sys_siglist=no])])
AC_MSG_RESULT($bash_cv_sys_siglist)
if test $bash_cv_sys_siglist = yes; then
@@ -325,7 +325,7 @@ dir = opendir("/tmp/not_a_directory");
unlink("/tmp/not_a_directory");
exit (dir == 0);
}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
- [AC_MSG_ERROR(cannot check opendir if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no)
bash_cv_opendir_not_robust=no]
)])
AC_MSG_RESULT($bash_cv_opendir_not_robust)
@@ -356,109 +356,47 @@ fi
AC_DEFUN(BASH_TYPE_INT32_T,
[
-if test "X$bash_cv_type_int32_t" = "X"; then
-_bash_needmsg=yes
+if test "$ac_cv_sizeof_int" = 4; then
+ AC_CHECK_TYPE(int32_t, int)
+elif test "$ac_cv_sizeof_long" = 4; then
+ AC_CHECK_TYPE(int32_t, long)
else
-AC_MSG_CHECKING(which builtin C type is 32 bits wide)
-_bash_needmsg=
-fi
-AC_CACHE_VAL(bash_cv_type_int32_t,
-[AC_TRY_RUN([
-main()
-{
-#if SIZEOF_INT == 4
-exit (0);
-#else
-# if SIZEOF_LONG == 4
-exit (1);
-# else
-# error cannot find 32 bit type...
-# endif
-#endif
-}], bash_cv_type_int32_t=int, bash_cv_type_int32_t=long,
- [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int)
- bash_cv_type_int32_t=int]
-)])
-if test "X$_bash_needmsg" = "Xyes"; then
-AC_MSG_CHECKING(which builtin C type is 32 bits wide)
-fi
-AC_MSG_RESULT($bash_cv_type_int32_t);
-if test "$bash_cv_type_int32_t" = "int"; then
-AC_DEFINE(int32_t, int)
-else
-AC_DEFINE(int32_t, long)
+ AC_CHECK_TYPE(int32_t, int)
fi
])
AC_DEFUN(BASH_TYPE_U_INT32_T,
[
-if test "X$bash_cv_type_u_int32_t" = "X"; then
-_bash_needmsg=yes
-else
-AC_MSG_CHECKING(which unsigned builtin C type is 32 bits wide)
-_bash_needmsg=
-fi
-AC_CACHE_VAL(bash_cv_type_u_int32_t,
-[AC_TRY_RUN([
-main()
-{
-#if SIZEOF_INT == 4
-exit (0);
-#else
-# if SIZEOF_LONG == 4
-exit (1);
-# else
-# error cannot find 32 bit type...
-# endif
-#endif
-}], bash_cv_type_u_int32_t=int, bash_cv_type_u_int32_t=long,
- [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int)
- bash_cv_type_u_int32_t=int]
-)])
-if test "X$_bash_needmsg" = "Xyes"; then
-AC_MSG_CHECKING(which unsigned builtin C type is 32 bits wide)
-fi
-AC_MSG_RESULT($bash_cv_type_u_int32_t);
-if test "$bash_cv_type_u_int32_t" = "int"; then
-AC_DEFINE(u_int32_t, unsigned int)
+if test "$ac_cv_sizeof_int" = 4; then
+ AC_CHECK_TYPE(u_int32_t, unsigned int)
+elif test "$ac_cv_sizeof_long" = 4; then
+ AC_CHECK_TYPE(u_int32_t, unsigned long)
else
-AC_DEFINE(u_int32_t, unsigned long)
+ AC_CHECK_TYPE(u_int32_t, unsigned int)
fi
])
AC_DEFUN(BASH_TYPE_PTRDIFF_T,
[
-if test "X$bash_cv_type_ptrdiff_t" = "X"; then
-_bash_needmsg=yes
+if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then
+ AC_CHECK_TYPE(ptrdiff_t, int)
+elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then
+ AC_CHECK_TYPE(ptrdiff_t, long)
else
-AC_MSG_CHECKING(which builtin C type is correct for ptrdiff_t)
-_bash_needmsg=
+ AC_CHECK_TYPE(ptrdiff_t, int)
fi
-AC_CACHE_VAL(bash_cv_type_ptrdiff_t,
-[AC_TRY_RUN([
-main()
-{
-#if SIZEOF_CHAR_P == SIZEOF_INT
-exit (0);
-#else
-# if SIZEOF_CHAR_P == SIZEOF_LONG
-exit (1);
-# else
-# error cannot find type for pointer arithmetic...
-# endif
-#endif
-}], bash_cv_type_ptrdiff_t=int, bash_cv_type_ptrdiff_t=long,
- [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int)
- bash_cv_type_ptrdiff_t=int]
-)])
-if test "X$_bash_needmsg" = "Xyes"; then
-AC_MSG_CHECKING(which builtin C type is correct for ptrdiff_t)
-fi
-AC_MSG_RESULT($bash_cv_type_ptrdiff_t);
-if test "$bash_cv_type_ptrdiff_t" = "int"; then
-AC_DEFINE(ptrdiff_t, int)
+])
+
+AC_DEFUN(BASH_TYPE_BITS64_T,
+[
+if test "$ac_sv_sizeof_char_p" = 8; then
+ AC_CHECK_TYPE(bits64_t, char *)
+elif test "$ac_cv_sizeof_double" = 8; then
+ AC_CHECK_TYPE(bits64_t, double)
+elif test "$ac_cv_sizeof_long" = 8; then
+ AC_CHECK_TYPE(bits64_t, long)
else
-AC_DEFINE(ptrdiff_t, long)
+ AC_CHECK_TYPE(bits64_t, double)
fi
])
@@ -548,7 +486,7 @@ s = getenv("ABCDE");
exit(s == 0); /* force optimizer to leave getenv in */
}
], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no,
- [AC_MSG_ERROR(cannot check getenv redefinition if cross compiling -- defaulting to yes)
+ [AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes)
bash_cv_getenv_redef=yes]
)])
AC_MSG_RESULT($bash_cv_getenv_redef)
@@ -574,7 +512,7 @@ pf = (_bashfunc) printf;
exit(pf == 0);
}
], bash_cv_printf_declared=yes, bash_cv_printf_declared=no,
- [AC_MSG_ERROR(cannot check printf declaration if cross compiling -- defaulting to yes)
+ [AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes)
bash_cv_printf_declared=yes]
)])
AC_MSG_RESULT($bash_cv_printf_declared)
@@ -593,7 +531,7 @@ long maxfds = ulimit(4, 0L);
exit (maxfds == -1L);
}
], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no,
- [AC_MSG_ERROR(cannot check ulimit if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no)
bash_cv_ulimit_maxfds=no]
)])
AC_MSG_RESULT($bash_cv_ulimit_maxfds)
@@ -690,7 +628,7 @@ main()
exit (popen_called);
}
], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes,
- [AC_MSG_ERROR(cannot check whether getcwd calls popen if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check whether getcwd calls popen if cross compiling -- defaulting to no)
bash_cv_getcwd_calls_popen=no]
)])
AC_MSG_RESULT($bash_cv_getcwd_calls_popen)
@@ -814,7 +752,7 @@ main()
exit(nsigint != 2);
}
], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes,
- [AC_MSG_ERROR(cannot check signal handling if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check signal handling if cross compiling -- defaulting to no)
bash_cv_must_reinstall_sighandlers=no]
)])
AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers)
@@ -883,7 +821,7 @@ exit(1);
exit(0);
}], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing,
- [AC_MSG_ERROR(cannot check job control if cross-compiling -- defaulting to missing)
+ [AC_MSG_WARN(cannot check job control if cross-compiling -- defaulting to missing)
bash_cv_job_control_missing=missing]
)])
AC_MSG_RESULT($bash_cv_job_control_missing)
@@ -928,7 +866,7 @@ close(fd);
unlink ("/tmp/sh-np-autoconf");
exit(0);
}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
- [AC_MSG_ERROR(cannot check for named pipes if cross-compiling -- defaulting to missing)
+ [AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing)
bash_cv_sys_named_pipes=missing]
)])
AC_MSG_RESULT($bash_cv_sys_named_pipes)
@@ -979,7 +917,7 @@ siglongjmp(xx, 10);
exit(1);
#endif
}], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing,
- [AC_MSG_ERROR(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing)
+ [AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing)
bash_cv_func_sigsetjmp=missing]
)])
AC_MSG_RESULT($bash_cv_func_sigsetjmp)
@@ -1246,7 +1184,7 @@ char *v[];
exit (r1 > 0 && r2 > 0);
}
], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no,
- [AC_MSG_ERROR(cannot check strcoll if cross compiling -- defaulting to no)
+ [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no)
bash_cv_func_strcoll_broken=no]
)])
AC_MSG_RESULT($bash_cv_func_strcoll_broken)
@@ -1336,9 +1274,28 @@ main ()
#endif
}
], bash_cv_sys_restartable_syscalls=yes, bash_cv_sys_restartable_syscalls=no,
- AC_MSG_ERROR(cannot check restartable syscalls if cross compiling))
+ AC_MSG_WARN(cannot check restartable syscalls if cross compiling))
])
if test $bash_cv_sys_restartable_syscalls = yes; then
AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
fi
])
+dnl
+dnl Check for 64-bit off_t -- used for malloc alignment
+dnl
+dnl C does not allow duplicate case labels, so the compile will fail if
+dnl sizeof(off_t) is > 4.
+dnl
+AC_DEFUN(BASH_CHECK_OFF_T_64,
+[AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64,
+AC_TRY_COMPILE([
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+],[
+switch (0) case 0: case (sizeof (off_t) <= 4):;
+], bash_cv_off_t_64=no, bash_cv_off_t_64=yes))
+if test $bash_cv_off_t_64 = yes; then
+ AC_DEFINE(HAVE_OFF_T_64)
+fi])
diff --git a/readline/bind.c b/readline/bind.c
index 300530a0781..f446dc8cd10 100644
--- a/readline/bind.c
+++ b/readline/bind.c
@@ -83,6 +83,7 @@ extern int rl_complete_with_tilde_expansion;
extern int rl_completion_query_items;
extern int rl_inhibit_completion;
extern char *_rl_comment_begin;
+extern unsigned char *_rl_isearch_terminators;
extern int rl_explicit_arg;
extern int rl_editing_mode;
@@ -207,13 +208,17 @@ rl_unbind_function_in_map (func, map)
Function *func;
Keymap map;
{
- register int i;
+ register int i, rval;
- for (i = 0; i < KEYMAP_SIZE; i++)
+ for (i = rval = 0; i < KEYMAP_SIZE; i++)
{
if (map[i].type == ISFUNC && map[i].function == func)
- map[i].function = (Function *)NULL;
+ {
+ map[i].function = (Function *)NULL;
+ rval = 1;
+ }
}
+ return rval;
}
int
@@ -222,7 +227,6 @@ rl_unbind_command_in_map (command, map)
Keymap map;
{
Function *func;
- register int i;
func = rl_named_function (command);
if (func == 0)
@@ -663,7 +667,11 @@ _rl_read_file (filename, sizep)
i = read (file, buffer, file_size);
close (file);
+#if 0
if (i < file_size)
+#else
+ if (i < 0)
+#endif
{
free (buffer);
return ((char *)NULL);
@@ -727,6 +735,8 @@ _rl_read_init_file (filename, include_level)
openname = tilde_expand (filename);
buffer = _rl_read_file (openname, &file_size);
+ free (openname);
+
if (buffer == 0)
return (errno);
@@ -1338,7 +1348,34 @@ rl_variable_bind (name, value)
else
_rl_bell_preference = AUDIBLE_BELL;
}
+ else if (_rl_stricmp (name, "isearch-terminators") == 0)
+ {
+ /* Isolate the value and translate it into a character string. */
+ int beg, end;
+ char *v;
+ v = savestring (value);
+ FREE (_rl_isearch_terminators);
+ if (v[0] == '"' || v[0] == '\'')
+ {
+ int delim = v[0];
+ for (beg = end = 1; v[end] && v[end] != delim; end++)
+ ;
+ }
+ else
+ {
+ for (beg = end = 0; whitespace (v[end]) == 0; end++)
+ ;
+ }
+
+ v[end] = '\0';
+ /* The value starts at v + beg. Translate it into a character string. */
+ _rl_isearch_terminators = (unsigned char *)xmalloc (2 * strlen (v) + 1);
+ rl_translate_keyseq (v + beg, _rl_isearch_terminators, &end);
+ _rl_isearch_terminators[end] = '\0';
+ free (v);
+ }
+
/* For the time being, unknown variable names are simply ignored. */
return 0;
}
@@ -1492,7 +1529,7 @@ _rl_get_keyname (key)
int key;
{
char *keyname;
- int i, c, v;
+ int i, c;
keyname = (char *)xmalloc (8);
@@ -1897,6 +1934,21 @@ rl_variable_dumper (print_readably)
fprintf (rl_outstream, "set keymap %s\n", kname ? kname : "none");
else
fprintf (rl_outstream, "keymap is set to `%s'\n", kname ? kname : "none");
+
+ /* isearch-terminators */
+ if (_rl_isearch_terminators)
+ {
+ char *disp;
+
+ disp = _rl_untranslate_macro_value (_rl_isearch_terminators);
+
+ if (print_readably)
+ fprintf (rl_outstream, "set isearch-terminators \"%s\"\n", disp);
+ else
+ fprintf (rl_outstream, "isearch-terminators is set to \"%s\"\n", disp);
+
+ free (disp);
+ }
}
/* Print all of the current variables and their values to
diff --git a/readline/callback.c b/readline/callback.c
index 34dbc724611..6915be483a4 100644
--- a/readline/callback.c
+++ b/readline/callback.c
@@ -36,7 +36,7 @@
#include "rldefs.h"
#include "readline.h"
-extern void readline_internal_startup ();
+extern void readline_internal_setup ();
extern char *readline_internal_teardown ();
extern int readline_internal_char ();
extern void _rl_init_line_state ();
diff --git a/readline/complete.c b/readline/complete.c
index 985e8981eee..714a2bf49dc 100644
--- a/readline/complete.c
+++ b/readline/complete.c
@@ -85,6 +85,15 @@ extern void _rl_move_vert ();
extern int _rl_vis_botlin;
extern int rl_display_fixed;
+/* If non-zero, then this is the address of a function to call when
+ completing a word would normally display the list of possible matches.
+ This function is called instead of actually doing the display.
+ It takes three arguments: (char **matches, int num_matches, int max_length)
+ where MATCHES is the array of strings that matched, NUM_MATCHES is the
+ number of strings in that array, and MAX_LENGTH is the length of the
+ longest string in that array. */
+VFunction *rl_completion_display_matches_hook = (VFunction *)NULL;
+
/* Forward declarations for functions defined and used in this file. */
char *filename_completion_function ();
char **completion_matches ();
@@ -674,6 +683,7 @@ gen_completion_matches (text, start, end, our_func, found_quote, quote_char)
we are doing filename completion and the application has defined a
filename dequoting function. */
temp = (char *)NULL;
+
if (found_quote && our_func == (Function *)filename_completion_function &&
rl_filename_dequoting_function)
{
@@ -682,7 +692,7 @@ gen_completion_matches (text, start, end, our_func, found_quote, quote_char)
text = temp; /* not freeing text is not a memory leak */
}
- matches = completion_matches (text, our_func);
+ matches = completion_matches (text, (CPFunction *)our_func);
FREE (temp);
return matches;
}
@@ -813,8 +823,7 @@ compute_lcd_of_matches (match_list, matches, text)
}
static int
-postprocess_matches (text, matchesp, matching_filenames)
- char *text;
+postprocess_matches (matchesp, matching_filenames)
char ***matchesp;
int matching_filenames;
{
@@ -845,7 +854,6 @@ postprocess_matches (text, matchesp, matching_filenames)
if (matches == 0 || matches[0] == 0)
{
FREE (matches);
- ding ();
*matchesp = (char **)0;
return 0;
}
@@ -857,7 +865,7 @@ postprocess_matches (text, matchesp, matching_filenames)
if (i > 1 && i < nmatch)
{
t = matches[0];
- compute_lcd_of_matches (matches, i - 1, text);
+ compute_lcd_of_matches (matches, i - 1, t);
FREE (t);
}
}
@@ -867,66 +875,19 @@ postprocess_matches (text, matchesp, matching_filenames)
return (1);
}
-static void
-display_matches (matches)
+/* A convenience function for displaying a list of strings in
+ columnar format on readline's output stream. MATCHES is the list
+ of strings, in argv format, LEN is the number of strings in MATCHES,
+ and MAX is the length of the longest string in MATCHES. */
+void
+rl_display_match_list (matches, len, max)
char **matches;
+ int len, max;
{
- int len, count, limit, max, printed_len;
+ int count, limit, printed_len;
int i, j, k, l;
char *temp;
- /* Move to the last visible line of a possibly-multiple-line command. */
- _rl_move_vert (_rl_vis_botlin);
-
- /* Handle simple case first. What if there is only one answer? */
- if (matches[1] == 0)
- {
- temp = printable_part (matches[0]);
- crlf ();
- print_filename (temp, matches[0]);
- crlf ();
-#if 0
- rl_on_new_line ();
-#else
- rl_forced_update_display ();
- rl_display_fixed = 1;
-#endif
- return;
- }
-
- /* There is more than one answer. Find out how many there are,
- and find the maximum printed length of a single entry. */
- for (max = 0, i = 1; matches[i]; i++)
- {
- temp = printable_part (matches[i]);
- len = strlen (temp);
-
- if (len > max)
- max = len;
- }
-
- len = i - 1;
-
- /* If there are many items, then ask the user if she really wants to
- see them all. */
- if (len >= rl_completion_query_items)
- {
- crlf ();
- fprintf (rl_outstream, "Display all %d possibilities? (y or n)", len);
- fflush (rl_outstream);
- if (get_y_or_n () == 0)
- {
- crlf ();
-#if 0
- rl_on_new_line ();
-#else
- rl_forced_update_display ();
- rl_display_fixed = 1;
-#endif
- return;
- }
- }
-
/* How many items of MAX length can we fit in the screen window? */
max += 2;
limit = screenwidth / max;
@@ -993,13 +954,85 @@ display_matches (matches)
}
crlf ();
}
+}
+
+/* Display MATCHES, a list of matching filenames in argv format. This
+ handles the simple case -- a single match -- first. If there is more
+ than one match, we compute the number of strings in the list and the
+ length of the longest string, which will be needed by the display
+ function. If the application wants to handle displaying the list of
+ matches itself, it sets RL_COMPLETION_DISPLAY_MATCHES_HOOK to the
+ address of a function, and we just call it. If we're handling the
+ display ourselves, we just call rl_display_match_list. We also check
+ that the list of matches doesn't exceed the user-settable threshold,
+ and ask the user if he wants to see the list if there are more matches
+ than RL_COMPLETION_QUERY_ITEMS. */
+static void
+display_matches (matches)
+ char **matches;
+{
+ int len, max, i;
+ char *temp;
+
+ /* Move to the last visible line of a possibly-multiple-line command. */
+ _rl_move_vert (_rl_vis_botlin);
+
+ /* Handle simple case first. What if there is only one answer? */
+ if (matches[1] == 0)
+ {
+ temp = printable_part (matches[0]);
+ crlf ();
+ print_filename (temp, matches[0]);
+ crlf ();
+
+ rl_forced_update_display ();
+ rl_display_fixed = 1;
+
+ return;
+ }
+
+ /* There is more than one answer. Find out how many there are,
+ and find the maximum printed length of a single entry. */
+ for (max = 0, i = 1; matches[i]; i++)
+ {
+ temp = printable_part (matches[i]);
+ len = strlen (temp);
+
+ if (len > max)
+ max = len;
+ }
+
+ len = i - 1;
+
+ /* If the caller has defined a display hook, then call that now. */
+ if (rl_completion_display_matches_hook)
+ {
+ (*rl_completion_display_matches_hook) (matches, len, max);
+ return;
+ }
+
+ /* If there are many items, then ask the user if she really wants to
+ see them all. */
+ if (len >= rl_completion_query_items)
+ {
+ crlf ();
+ fprintf (rl_outstream, "Display all %d possibilities? (y or n)", len);
+ fflush (rl_outstream);
+ if (get_y_or_n () == 0)
+ {
+ crlf ();
+
+ rl_forced_update_display ();
+ rl_display_fixed = 1;
+
+ return;
+ }
+ }
+
+ rl_display_match_list (matches, len, max);
-#if 0
- rl_on_new_line ();
-#else
rl_forced_update_display ();
rl_display_fixed = 1;
-#endif
}
static char *
@@ -1026,11 +1059,8 @@ make_quoted_replacement (match, mtype, qc)
rl_filename_quoting_desired;
if (should_quote)
-#if defined (SHELL)
- should_quote = should_quote && (!qc || !*qc || *qc == '"' || *qc == '\'');
-#else /* !SHELL */
- should_quote = should_quote && (!qc || !*qc);
-#endif /* !SHELL */
+ should_quote = should_quote && (!qc || !*qc ||
+ (rl_completer_quote_characters && strchr (rl_completer_quote_characters, *qc)));
if (should_quote)
{
@@ -1168,6 +1198,17 @@ insert_all_matches (matches, point, qc)
rl_end_undo_group ();
}
+static void
+free_match_list (matches)
+ char **matches;
+{
+ register int i;
+
+ for (i = 0; matches[i]; i++)
+ free (matches[i]);
+ free (matches);
+}
+
/* Complete the word at or before point.
WHAT_TO_DO says what to do with the completion.
`?' means list the possible completions.
@@ -1210,27 +1251,34 @@ rl_complete_internal (what_to_do)
text = rl_copy_text (start, end);
matches = gen_completion_matches (text, start, end, our_func, found_quote, quote_char);
+ free (text);
if (matches == 0)
{
ding ();
FREE (saved_line_buffer);
- free (text);
return (0);
}
+#if 0
/* If we are matching filenames, our_func will have been set to
filename_completion_function */
i = our_func == (Function *)filename_completion_function;
- if (postprocess_matches (text, &matches, i) == 0)
+#else
+ /* If we are matching filenames, the attempted completion function will
+ have set rl_filename_completion_desired to a non-zero value. The basic
+ filename_completion_function does this. */
+ i = rl_filename_completion_desired;
+#endif
+
+ if (postprocess_matches (&matches, i) == 0)
{
+ ding ();
FREE (saved_line_buffer);
- free (text);
+ completion_changed_buffer = 0;
return (0);
}
- free (text);
-
switch (what_to_do)
{
case TAB:
@@ -1277,9 +1325,7 @@ rl_complete_internal (what_to_do)
return 1;
}
- for (i = 0; matches[i]; i++)
- free (matches[i]);
- free (matches);
+ free_match_list (matches);
/* Check to see if the line has changed through all of this manipulation. */
if (saved_line_buffer)
@@ -1358,10 +1404,10 @@ completion_matches (text, entry_function)
character (usually `~'). */
char *
username_completion_function (text, state)
- int state;
char *text;
+ int state;
{
-#if defined (__GO32__) || defined (__WIN32__)
+#if defined (__GO32__) || defined (__WIN32__) || defined (__OPENNT)
return (char *)NULL;
#else /* !__GO32__ */
static char *username = (char *)NULL;
@@ -1415,8 +1461,8 @@ username_completion_function (text, state)
completion for a command. */
char *
filename_completion_function (text, state)
- int state;
char *text;
+ int state;
{
static DIR *directory = (DIR *)NULL;
static char *filename = (char *)NULL;
@@ -1574,7 +1620,7 @@ filename_completion_function (text, state)
strcpy (temp, users_dirname);
}
- strcpy (temp + dirlen, entry->d_name); /* strcat (temp, entry->d_name); */
+ strcpy (temp + dirlen, entry->d_name);
}
else
temp = savestring (entry->d_name);
@@ -1649,10 +1695,17 @@ rl_menu_complete (count, ignore)
matches = gen_completion_matches (orig_text, orig_start, orig_end,
our_func, found_quote, quote_char);
+#if 0
/* If we are matching filenames, our_func will have been set to
filename_completion_function */
matching_filenames = our_func == (Function *)filename_completion_function;
- if (matches == 0 || postprocess_matches (orig_text, &matches, matching_filenames) == 0)
+#else
+ /* If we are matching filenames, the attempted completion function will
+ have set rl_filename_completion_desired to a non-zero value. The basic
+ filename_completion_function does this. */
+ matching_filenames = rl_filename_completion_desired;
+#endif
+ if (matches == 0 || postprocess_matches (&matches, matching_filenames) == 0)
{
ding ();
FREE (matches);
@@ -1686,7 +1739,7 @@ rl_menu_complete (count, ignore)
if (match_list_index < 0)
match_list_index += match_list_size;
- if (match_list_index == 0)
+ if (match_list_index == 0 && match_list_size > 1)
{
ding ();
insert_match (orig_text, orig_start, MULT_MATCH, &quote_char);
diff --git a/readline/configure b/readline/configure
index f22bd1134dc..cdcdf88bae4 100755
--- a/readline/configure
+++ b/readline/configure
@@ -1,7 +1,10 @@
#! /bin/sh
-# From configure.in for Readline 2.2, version 2.07, from autoconf version 2.12.2
-LIBVERSION=2.2
+# From configure.in for Readline 4.0, version 2.14, from autoconf version 2.13
+LIBVERSION=4.0
+
+
+
@@ -89,7 +92,7 @@ LIBVERSION=2.2
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12.2
+# Generated automatically using autoconf version 2.13
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -118,6 +121,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -232,6 +236,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -402,6 +407,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -423,7 +433,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12.2"
+ echo "configure generated by autoconf version 2.13"
exit 0 ;;
-with-* | --with-*)
@@ -567,12 +577,16 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
+else
+ CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -642,7 +656,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:646: checking host system type" >&5
+echo "configure:660: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -683,7 +697,7 @@ test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:687: checking for $ac_word" >&5
+echo "configure:701: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -691,7 +705,8 @@ else
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- for ac_dir in $PATH; do
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="gcc"
@@ -712,7 +727,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:716: checking for $ac_word" >&5
+echo "configure:731: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -721,7 +736,8 @@ else
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_prog_rejected=no
- for ac_dir in $PATH; do
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -762,7 +778,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:766: checking for $ac_word" >&5
+echo "configure:782: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -770,7 +786,8 @@ else
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- for ac_dir in $PATH; do
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="cl"
@@ -793,7 +810,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:797: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:814: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -802,12 +819,14 @@ ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
-cat > conftest.$ac_ext <<EOF
-#line 807 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 825 "configure"
#include "confdefs.h"
+
main(){return(0);}
EOF
-if { (eval echo configure:811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -821,18 +840,24 @@ else
ac_cv_prog_cc_works=no
fi
rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:831: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:856: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:836: checking whether we are using GNU C" >&5
+echo "configure:861: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -841,7 +866,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:845: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -860,7 +885,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:864: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:889: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -892,7 +917,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:896: checking how to run the C preprocessor" >&5
+echo "configure:921: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -907,13 +932,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 911 "configure"
+#line 936 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:917: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -924,13 +949,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 928 "configure"
+#line 953 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:934: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -941,13 +966,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 945 "configure"
+#line 970 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -973,17 +998,17 @@ echo "$ac_t""$CPP" 1>&6
ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:977: checking for minix/config.h" >&5
+echo "configure:1002: checking for minix/config.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 982 "configure"
+#line 1007 "configure"
#include "confdefs.h"
#include <minix/config.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1021,7 +1046,6 @@ EOF
fi
-
if test "x$cross_compiling" = "xyes"; then
case "${host}" in
@@ -1056,20 +1080,18 @@ fi
-
-
# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1067: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:1089: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
-#line 1073 "configure"
+#line 1095 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@@ -1087,7 +1109,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 1091 "configure"
+#line 1113 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@@ -1120,7 +1142,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1124: checking for a BSD compatible install" >&5
+echo "configure:1146: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1168,12 +1190,44 @@ echo "$ac_t""$INSTALL" 1>&6
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+# Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1201: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_AR="ar"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+AR="$ac_cv_prog_AR"
+if test -n "$AR"; then
+ echo "$ac_t""$AR" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$ARFLAGS" || ARFLAGS="cr"
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1177: checking for $ac_word" >&5
+echo "configure:1231: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1181,7 +1235,8 @@ else
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- for ac_dir in $PATH; do
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_RANLIB="ranlib"
@@ -1200,13 +1255,16 @@ else
fi
+MAKE_SHELL=/bin/sh
+
+
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1205: checking return type of signal handlers" >&5
+echo "configure:1263: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1210 "configure"
+#line 1268 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -1223,7 +1281,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:1227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -1243,12 +1301,12 @@ EOF
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:1247: checking whether stat file-mode macros are broken" >&5
+echo "configure:1305: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1252 "configure"
+#line 1310 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -1303,12 +1361,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1307: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1365: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1312 "configure"
+#line 1370 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -1316,7 +1374,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -1341,7 +1399,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:1345: checking for opendir in -ldir" >&5
+echo "configure:1403: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1349,7 +1407,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1353 "configure"
+#line 1411 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1360,7 +1418,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1382,7 +1440,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1386: checking for opendir in -lx" >&5
+echo "configure:1444: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1390,7 +1448,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1394 "configure"
+#line 1452 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1401,7 +1459,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1427,12 +1485,12 @@ fi
for ac_func in strcasecmp select setenv putenv tcgetattr setlocale lstat
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1431: checking for $ac_func" >&5
+echo "configure:1489: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1436 "configure"
+#line 1494 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1455,7 +1513,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1481,7 +1539,7 @@ done
echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:1485: checking for working strcoll" >&5
+echo "configure:1543: checking for working strcoll" >&5
if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1489,7 +1547,7 @@ else
ac_cv_func_strcoll_works=no
else
cat > conftest.$ac_ext <<EOF
-#line 1493 "configure"
+#line 1551 "configure"
#include "confdefs.h"
#include <string.h>
main ()
@@ -1499,7 +1557,7 @@ main ()
strcoll ("123", "456") >= 0);
}
EOF
-if { (eval echo configure:1503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_strcoll_works=yes
else
@@ -1528,17 +1586,17 @@ for ac_hdr in unistd.h stdlib.h varargs.h stdarg.h string.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1532: checking for $ac_hdr" >&5
+echo "configure:1590: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1537 "configure"
+#line 1595 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1542: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1567,13 +1625,13 @@ done
echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6
-echo "configure:1571: checking for type of signal functions" >&5
+echo "configure:1629: checking for type of signal functions" >&5
if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1577 "configure"
+#line 1635 "configure"
#include "confdefs.h"
#include <signal.h>
int main() {
@@ -1586,7 +1644,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_signal_vintage=posix
else
@@ -1595,7 +1653,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 1599 "configure"
+#line 1657 "configure"
#include "confdefs.h"
#include <signal.h>
int main() {
@@ -1605,7 +1663,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_signal_vintage=4.2bsd
else
@@ -1614,7 +1672,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 1618 "configure"
+#line 1676 "configure"
#include "confdefs.h"
#include <signal.h>
@@ -1627,7 +1685,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_signal_vintage=svr3
else
@@ -1668,17 +1726,17 @@ fi
echo $ac_n "checking if signal handlers must be reinstalled when invoked""... $ac_c" 1>&6
-echo "configure:1672: checking if signal handlers must be reinstalled when invoked" >&5
+echo "configure:1730: checking if signal handlers must be reinstalled when invoked" >&5
if eval "test \"`echo '$''{'bash_cv_must_reinstall_sighandlers'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
- { echo "configure: error: cannot check signal handling if cross compiling -- defaulting to no" 1>&2; exit 1; }
+ echo "configure: warning: cannot check signal handling if cross compiling -- defaulting to no" 1>&2
bash_cv_must_reinstall_sighandlers=no
else
cat > conftest.$ac_ext <<EOF
-#line 1682 "configure"
+#line 1740 "configure"
#include "confdefs.h"
#include <signal.h>
@@ -1725,7 +1783,7 @@ main()
}
EOF
-if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
bash_cv_must_reinstall_sighandlers=no
else
@@ -1750,17 +1808,17 @@ fi
echo $ac_n "checking for presence of POSIX-style sigsetjmp/siglongjmp""... $ac_c" 1>&6
-echo "configure:1754: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5
+echo "configure:1812: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5
if eval "test \"`echo '$''{'bash_cv_func_sigsetjmp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
- { echo "configure: error: cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing" 1>&2; exit 1; }
+ echo "configure: warning: cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing" 1>&2
bash_cv_func_sigsetjmp=missing
else
cat > conftest.$ac_ext <<EOF
-#line 1764 "configure"
+#line 1822 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
@@ -1801,7 +1859,7 @@ exit(1);
#endif
}
EOF
-if { (eval echo configure:1805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
bash_cv_func_sigsetjmp=present
else
@@ -1824,12 +1882,12 @@ EOF
fi
echo $ac_n "checking for lstat""... $ac_c" 1>&6
-echo "configure:1828: checking for lstat" >&5
+echo "configure:1886: checking for lstat" >&5
if eval "test \"`echo '$''{'bash_cv_func_lstat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1833 "configure"
+#line 1891 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -1839,7 +1897,7 @@ int main() {
lstat(".",(struct stat *)0);
; return 0; }
EOF
-if { (eval echo configure:1843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_func_lstat=yes
else
@@ -1860,12 +1918,12 @@ EOF
fi
echo $ac_n "checking whether programs are able to redeclare getpw functions""... $ac_c" 1>&6
-echo "configure:1864: checking whether programs are able to redeclare getpw functions" >&5
+echo "configure:1922: checking whether programs are able to redeclare getpw functions" >&5
if eval "test \"`echo '$''{'bash_cv_can_redecl_getpw'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1869 "configure"
+#line 1927 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <pwd.h>
@@ -1876,7 +1934,7 @@ int main() {
struct passwd *z; z = getpwent(); z = getpwuid(0); z = getpwnam("root");
; return 0; }
EOF
-if { (eval echo configure:1880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_can_redecl_getpw=yes
else
@@ -1898,17 +1956,17 @@ fi
echo $ac_n "checking whether or not strcoll and strcmp differ""... $ac_c" 1>&6
-echo "configure:1902: checking whether or not strcoll and strcmp differ" >&5
+echo "configure:1960: checking whether or not strcoll and strcmp differ" >&5
if eval "test \"`echo '$''{'bash_cv_func_strcoll_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
- { echo "configure: error: cannot check strcoll if cross compiling -- defaulting to no" 1>&2; exit 1; }
+ echo "configure: warning: cannot check strcoll if cross compiling -- defaulting to no" 1>&2
bash_cv_func_strcoll_broken=no
else
cat > conftest.$ac_ext <<EOF
-#line 1912 "configure"
+#line 1970 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -1947,7 +2005,7 @@ char *v[];
}
EOF
-if { (eval echo configure:1951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
bash_cv_func_strcoll_broken=yes
else
@@ -1971,12 +2029,12 @@ fi
echo $ac_n "checking whether signal handlers are of type void""... $ac_c" 1>&6
-echo "configure:1975: checking whether signal handlers are of type void" >&5
+echo "configure:2033: checking whether signal handlers are of type void" >&5
if eval "test \"`echo '$''{'bash_cv_void_sighandler'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1980 "configure"
+#line 2038 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -1991,7 +2049,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:1995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_void_sighandler=yes
else
@@ -2011,12 +2069,12 @@ EOF
fi
echo $ac_n "checking for TIOCGWINSZ in sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:2015: checking for TIOCGWINSZ in sys/ioctl.h" >&5
+echo "configure:2073: checking for TIOCGWINSZ in sys/ioctl.h" >&5
if eval "test \"`echo '$''{'bash_cv_tiocgwinsz_in_ioctl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2020 "configure"
+#line 2078 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ioctl.h>
@@ -2024,7 +2082,7 @@ int main() {
int x = TIOCGWINSZ;
; return 0; }
EOF
-if { (eval echo configure:2028: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_tiocgwinsz_in_ioctl=yes
else
@@ -2045,12 +2103,12 @@ EOF
fi
echo $ac_n "checking for TIOCSTAT in sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:2049: checking for TIOCSTAT in sys/ioctl.h" >&5
+echo "configure:2107: checking for TIOCSTAT in sys/ioctl.h" >&5
if eval "test \"`echo '$''{'bash_cv_tiocstat_in_ioctl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2054 "configure"
+#line 2112 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ioctl.h>
@@ -2058,7 +2116,7 @@ int main() {
int x = TIOCSTAT;
; return 0; }
EOF
-if { (eval echo configure:2062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_tiocstat_in_ioctl=yes
else
@@ -2079,12 +2137,12 @@ EOF
fi
echo $ac_n "checking for FIONREAD in sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:2083: checking for FIONREAD in sys/ioctl.h" >&5
+echo "configure:2141: checking for FIONREAD in sys/ioctl.h" >&5
if eval "test \"`echo '$''{'bash_cv_fionread_in_ioctl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2088 "configure"
+#line 2146 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ioctl.h>
@@ -2092,7 +2150,7 @@ int main() {
int x = FIONREAD;
; return 0; }
EOF
-if { (eval echo configure:2096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_fionread_in_ioctl=yes
else
@@ -2113,19 +2171,19 @@ EOF
fi
echo $ac_n "checking for speed_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2117: checking for speed_t in sys/types.h" >&5
+echo "configure:2175: checking for speed_t in sys/types.h" >&5
if eval "test \"`echo '$''{'bash_cv_speed_t_in_sys_types'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2122 "configure"
+#line 2180 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {
speed_t x;
; return 0; }
EOF
-if { (eval echo configure:2129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2187: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_speed_t_in_sys_types=yes
else
@@ -2146,12 +2204,12 @@ EOF
fi
echo $ac_n "checking for struct winsize in sys/ioctl.h and termios.h""... $ac_c" 1>&6
-echo "configure:2150: checking for struct winsize in sys/ioctl.h and termios.h" >&5
+echo "configure:2208: checking for struct winsize in sys/ioctl.h and termios.h" >&5
if eval "test \"`echo '$''{'bash_cv_struct_winsize_header'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2155 "configure"
+#line 2213 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ioctl.h>
@@ -2159,7 +2217,7 @@ int main() {
struct winsize x;
; return 0; }
EOF
-if { (eval echo configure:2163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_struct_winsize_header=ioctl_h
else
@@ -2167,7 +2225,7 @@ else
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 2171 "configure"
+#line 2229 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <termios.h>
@@ -2175,7 +2233,7 @@ int main() {
struct winsize x;
; return 0; }
EOF
-if { (eval echo configure:2179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_struct_winsize_header=termios_h
else
@@ -2208,12 +2266,12 @@ fi
echo $ac_n "checking if struct dirent has a d_ino member""... $ac_c" 1>&6
-echo "configure:2212: checking if struct dirent has a d_ino member" >&5
+echo "configure:2270: checking if struct dirent has a d_ino member" >&5
if eval "test \"`echo '$''{'bash_cv_dirent_has_dino'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2217 "configure"
+#line 2275 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2242,7 +2300,7 @@ struct dirent d; int z; z = d.d_ino;
; return 0; }
EOF
-if { (eval echo configure:2246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_dirent_has_dino=yes
else
@@ -2264,12 +2322,12 @@ fi
echo $ac_n "checking if struct dirent has a d_fileno member""... $ac_c" 1>&6
-echo "configure:2268: checking if struct dirent has a d_fileno member" >&5
+echo "configure:2326: checking if struct dirent has a d_fileno member" >&5
if eval "test \"`echo '$''{'bash_cv_dirent_has_d_fileno'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2273 "configure"
+#line 2331 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2298,7 +2356,7 @@ struct dirent d; int z; z = d.d_fileno;
; return 0; }
EOF
-if { (eval echo configure:2302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_dirent_has_d_fileno=yes
else
@@ -2327,14 +2385,14 @@ if test "X$bash_cv_termcap_lib" = "X"; then
_bash_needmsg=yes
else
echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6
-echo "configure:2331: checking which library has the termcap functions" >&5
+echo "configure:2389: checking which library has the termcap functions" >&5
_bash_needmsg=
fi
if eval "test \"`echo '$''{'bash_cv_termcap_lib'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:2338: checking for tgetent in -ltermcap" >&5
+echo "configure:2396: checking for tgetent in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2342,7 +2400,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2346 "configure"
+#line 2404 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2353,7 +2411,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:2357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2372,7 +2430,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:2376: checking for tgetent in -lcurses" >&5
+echo "configure:2434: checking for tgetent in -lcurses" >&5
ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2380,7 +2438,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2384 "configure"
+#line 2442 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2391,7 +2449,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:2395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2410,7 +2468,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:2414: checking for tgetent in -lncurses" >&5
+echo "configure:2472: checking for tgetent in -lncurses" >&5
ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2418,7 +2476,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2422 "configure"
+#line 2480 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2429,7 +2487,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:2433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2458,7 +2516,7 @@ fi
if test "X$_bash_needmsg" = "Xyes"; then
echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6
-echo "configure:2462: checking which library has the termcap functions" >&5
+echo "configure:2520: checking which library has the termcap functions" >&5
fi
echo "$ac_t""using $bash_cv_termcap_lib" 1>&6
if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
@@ -2488,6 +2546,30 @@ case "$host_os" in
isc*) LOCAL_CFLAGS=-Disc386 ;;
esac
+# shared library configuration section
+#
+# Shared object configuration section. These values are generated by
+# ${srcdir}/support/shobj-conf
+#
+if test -f ${srcdir}/support/shobj-conf; then
+ echo $ac_n "checking configuration for building shared libraries""... $ac_c" 1>&6
+echo "configure:2557: checking configuration for building shared libraries" >&5
+ eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C ${CC} -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+
+
+
+
+
+
+
+
+
+
+
+
+ echo "$ac_t""$SHLIB_STATUS" 1>&6
+fi
+
BUILD_DIR=`pwd`
@@ -2503,6 +2585,9 @@ BUILD_DIR=`pwd`
+
+
+
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@@ -2526,7 +2611,7 @@ EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
@@ -2593,7 +2678,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12.2"
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -2604,7 +2689,7 @@ done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "Makefile doc/Makefile examples/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile doc/Makefile examples/Makefile shlib/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -2617,6 +2702,7 @@ s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
@@ -2645,12 +2731,28 @@ s%@CPP@%$CPP%g
s%@CROSS_COMPILING_FLAG@%$CROSS_COMPILING_FLAG%g
s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
+s%@MAKE_SHELL@%$MAKE_SHELL%g
+s%@SHOBJ_CC@%$SHOBJ_CC%g
+s%@SHOBJ_CFLAGS@%$SHOBJ_CFLAGS%g
+s%@SHOBJ_LD@%$SHOBJ_LD%g
+s%@SHOBJ_LDFLAGS@%$SHOBJ_LDFLAGS%g
+s%@SHOBJ_XLDFLAGS@%$SHOBJ_XLDFLAGS%g
+s%@SHOBJ_LIBS@%$SHOBJ_LIBS%g
+s%@SHOBJ_STATUS@%$SHOBJ_STATUS%g
+s%@SHLIB_STATUS@%$SHLIB_STATUS%g
+s%@SHLIB_XLDFLAGS@%$SHLIB_XLDFLAGS%g
+s%@SHLIB_LIBSUFF@%$SHLIB_LIBSUFF%g
+s%@SHLIB_LIBVERSION@%$SHLIB_LIBVERSION%g
+s%@SHLIB_LIBS@%$SHLIB_LIBS%g
s%@BUILD_DIR@%$BUILD_DIR%g
s%@LOCAL_CFLAGS@%$LOCAL_CFLAGS%g
s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
s%@LOCAL_DEFS@%$LOCAL_DEFS%g
+s%@ARFLAGS@%$ARFLAGS%g
s%@LIBVERSION@%$LIBVERSION%g
s%@TERMCAP_LIB@%$TERMCAP_LIB%g
@@ -2694,7 +2796,7 @@ EOF
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile examples/Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile examples/Makefile shlib/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
diff --git a/readline/configure.in b/readline/configure.in
index 1e8e7754da2..9afdaa70fcf 100644
--- a/readline/configure.in
+++ b/readline/configure.in
@@ -4,8 +4,8 @@ dnl
dnl report bugs to chet@po.cwru.edu
dnl
dnl Process this file with autoconf to produce a configure script.
-AC_REVISION([for Readline 2.2, version 2.07, from autoconf version] AC_ACVERSION)
-LIBVERSION=2.2
+AC_REVISION([for Readline 4.0, version 2.14, from autoconf version] AC_ACVERSION)
+LIBVERSION=4.0
AC_INIT(readline.h)
AC_CONFIG_HEADER(config.h)
@@ -34,7 +34,6 @@ test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
AC_PROG_CC
AC_MINIX
-
dnl BEGIN changes for CYGNUS cross-building for Cygwin
dnl load up the cross-building cache file -- add more cases and cache
@@ -73,15 +72,20 @@ AC_SUBST(CC_FOR_BUILD)
dnl END changes for CYGNUS cross-building for Cygwin
-
-
# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
+AC_CHECK_PROG(AR, ar, ar)
+dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
+dnl This allows people to set it when running configure or make
+test -n "$ARFLAGS" || ARFLAGS="cr"
AC_PROG_RANLIB
+MAKE_SHELL=/bin/sh
+AC_SUBST(MAKE_SHELL)
+
AC_RETSIGTYPE
AC_HEADER_STAT
@@ -129,6 +133,29 @@ case "$host_os" in
isc*) LOCAL_CFLAGS=-Disc386 ;;
esac
+# shared library configuration section
+#
+# Shared object configuration section. These values are generated by
+# ${srcdir}/support/shobj-conf
+#
+if test -f ${srcdir}/support/shobj-conf; then
+ AC_MSG_CHECKING(configuration for building shared libraries)
+ eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C ${CC} -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+ AC_SUBST(SHOBJ_CC)
+ AC_SUBST(SHOBJ_CFLAGS)
+ AC_SUBST(SHOBJ_LD)
+ AC_SUBST(SHOBJ_LDFLAGS)
+ AC_SUBST(SHOBJ_XLDFLAGS)
+ AC_SUBST(SHOBJ_LIBS)
+ AC_SUBST(SHOBJ_STATUS)
+ AC_SUBST(SHLIB_STATUS)
+ AC_SUBST(SHLIB_XLDFLAGS)
+ AC_SUBST(SHLIB_LIBSUFF)
+ AC_SUBST(SHLIB_LIBVERSION)
+ AC_SUBST(SHLIB_LIBS)
+ AC_MSG_RESULT($SHLIB_STATUS)
+fi
+
BUILD_DIR=`pwd`
AC_SUBST(BUILD_DIR)
@@ -137,6 +164,9 @@ AC_SUBST(LOCAL_CFLAGS)
AC_SUBST(LOCAL_LDFLAGS)
AC_SUBST(LOCAL_DEFS)
+AC_SUBST(AR)
+AC_SUBST(ARFLAGS)
+
AC_SUBST(host_cpu)
AC_SUBST(host_os)
@@ -144,7 +174,7 @@ AC_SUBST(LIBVERSION)
AC_SUBST(TERMCAP_LIB)
-AC_OUTPUT([Makefile doc/Makefile examples/Makefile],
+AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile],
[
# Makefile uses this timestamp file to record whether config.h is up to date.
echo > stamp-h
diff --git a/readline/display.c b/readline/display.c
index 00caab69dbd..3f6fe71b023 100644
--- a/readline/display.c
+++ b/readline/display.c
@@ -280,7 +280,7 @@ rl_expand_prompt (prompt)
if (local_prompt_prefix)
free (local_prompt_prefix);
local_prompt = local_prompt_prefix = (char *)0;
- last_invisible = 0;
+ last_invisible = visible_length = 0;
if (prompt == 0 || *prompt == 0)
return (0);
@@ -373,6 +373,13 @@ rl_redisplay ()
if (local_len > 0)
{
+ temp = local_len + out + 2;
+ if (temp >= line_size)
+ {
+ line_size = (temp + 1024) - (temp % 1024);
+ visible_line = xrealloc (visible_line, line_size);
+ line = invisible_line = xrealloc (invisible_line, line_size);
+ }
strncpy (line + out, local_prompt, local_len);
out += local_len;
}
@@ -399,6 +406,13 @@ rl_redisplay ()
}
pmtlen = strlen (prompt_this_line);
+ temp = pmtlen + out + 2;
+ if (temp >= line_size)
+ {
+ line_size = (temp + 1024) - (temp % 1024);
+ visible_line = xrealloc (visible_line, line_size);
+ line = invisible_line = xrealloc (invisible_line, line_size);
+ }
strncpy (line + out, prompt_this_line, pmtlen);
out += pmtlen;
line[out] = '\0';
@@ -407,12 +421,12 @@ rl_redisplay ()
#define CHECK_LPOS() \
do { \
- lpos++; \
- if (lpos >= screenwidth) \
- { \
- inv_lbreaks[++newlines] = out; \
- lpos = 0; \
- } \
+ lpos++; \
+ if (lpos >= screenwidth) \
+ { \
+ inv_lbreaks[++newlines] = out; \
+ lpos = 0; \
+ } \
} while (0)
/* inv_lbreaks[i] is where line i starts in the buffer. */
@@ -481,7 +495,12 @@ rl_redisplay ()
else if (c == '\t')
{
register int temp, newout;
+
+#if 0
newout = (out | (int)7) + 1;
+#else
+ newout = out + 8 - lpos % 8;
+#endif
temp = newout - out;
if (lpos + temp >= screenwidth)
{
@@ -501,11 +520,11 @@ rl_redisplay ()
}
#endif
else if (c == '\n' && _rl_horizontal_scroll_mode == 0 && term_up && *term_up)
- {
- line[out++] = '\0'; /* XXX - sentinel */
- inv_lbreaks[++newlines] = out;
- lpos = 0;
- }
+ {
+ line[out++] = '\0'; /* XXX - sentinel */
+ inv_lbreaks[++newlines] = out;
+ lpos = 0;
+ }
else if (CTRL_CHAR (c) || c == RUBOUT)
{
line[out++] = '^';
@@ -616,11 +635,11 @@ rl_redisplay ()
{
_rl_move_vert (cursor_linenum);
/* If we moved up to the line with the prompt using term_up,
- the physical cursor position on the screen stays the same,
- but the buffer position needs to be adjusted to account
- for invisible characters. */
+ the physical cursor position on the screen stays the same,
+ but the buffer position needs to be adjusted to account
+ for invisible characters. */
if (cursor_linenum == 0 && wrap_offset)
- _rl_last_c_pos += wrap_offset;
+ _rl_last_c_pos += wrap_offset;
}
/* We have to reprint the prompt if it contains invisible
@@ -677,16 +696,16 @@ rl_redisplay ()
ndisp = c_pos - wrap_offset;
nleft = visible_length + wrap_offset;
/* Where the new cursor position will be on the screen. This can be
- longer than SCREENWIDTH; if it is, lmargin will be adjusted. */
+ longer than SCREENWIDTH; if it is, lmargin will be adjusted. */
phys_c_pos = c_pos - (last_lmargin ? last_lmargin : wrap_offset);
t = screenwidth / 3;
/* If the number of characters had already exceeded the screenwidth,
- last_lmargin will be > 0. */
+ last_lmargin will be > 0. */
/* If the number of characters to be displayed is more than the screen
- width, compute the starting offset so that the cursor is about
- two-thirds of the way across the screen. */
+ width, compute the starting offset so that the cursor is about
+ two-thirds of the way across the screen. */
if (phys_c_pos > screenwidth - 2)
{
lmargin = c_pos - (2 * t);
@@ -698,7 +717,7 @@ rl_redisplay ()
lmargin = nleft;
}
else if (ndisp < screenwidth - 2) /* XXX - was -1 */
- lmargin = 0;
+ lmargin = 0;
else if (phys_c_pos < 1)
{
/* If we are moving back towards the beginning of the line and
@@ -708,7 +727,7 @@ rl_redisplay ()
lmargin = nleft;
}
else
- lmargin = last_lmargin;
+ lmargin = last_lmargin;
/* If the first character on the screen isn't the first character
in the display line, indicate this with a special character. */
@@ -716,12 +735,12 @@ rl_redisplay ()
line[lmargin] = '<';
/* If SCREENWIDTH characters starting at LMARGIN do not encompass
- the whole line, indicate that with a special characters at the
- right edge of the screen. If LMARGIN is 0, we need to take the
- wrap offset into account. */
+ the whole line, indicate that with a special character at the
+ right edge of the screen. If LMARGIN is 0, we need to take the
+ wrap offset into account. */
t = lmargin + M_OFFSET (lmargin, wrap_offset) + screenwidth;
if (t < out)
- line[t - 1] = '>';
+ line[t - 1] = '>';
if (!rl_display_fixed || forced_display || lmargin != last_lmargin)
{
@@ -786,7 +805,7 @@ new: eddie> Oh, my little buggy says to me, as lurgid as
\new first difference
All are character pointers for the sake of speed. Special cases for
- no differences, as well as for end of line additions must be handeled.
+ no differences, as well as for end of line additions must be handled.
Could be made even smarter, but this works well enough */
static void
@@ -814,7 +833,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
_rl_last_c_pos = 1; /* XXX */
_rl_last_v_pos++;
if (old[0] && new[0])
- old[0] = new[0];
+ old[0] = new[0];
}
/* Find first difference. */
@@ -903,10 +922,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
lendiff needs to be adjusted. */
if (current_line == 0 && !_rl_horizontal_scroll_mode &&
current_invis_chars != visible_wrap_offset)
- {
- temp = visible_wrap_offset - current_invis_chars;
- lendiff += temp;
- }
+ lendiff += visible_wrap_offset - current_invis_chars;
/* Insert (diff (len (old), len (new)) ch. */
temp = ne - nfd;
@@ -935,7 +951,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
/* At the end of a line the characters do not have to
be "inserted". They can just be placed on the screen. */
/* However, this screws up the rest of this block, which
- assumes you've done the insert because you can. */
+ assumes you've done the insert because you can. */
_rl_output_some_chars (nfd, lendiff);
_rl_last_c_pos += lendiff;
}
@@ -995,10 +1011,13 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
_rl_last_c_pos += temp;
}
lendiff = (oe - old) - (ne - new);
- if (_rl_term_autowrap && current_line < inv_botlin)
- space_to_eol (lendiff);
- else
- _rl_clear_to_eol (lendiff);
+ if (lendiff)
+ {
+ if (_rl_term_autowrap && current_line < inv_botlin)
+ space_to_eol (lendiff);
+ else
+ _rl_clear_to_eol (lendiff);
+ }
}
}
}
@@ -1027,7 +1046,7 @@ rl_forced_update_display ()
register char *temp = visible_line;
while (*temp)
- *temp++ = '\0';
+ *temp++ = '\0';
}
rl_on_new_line ();
forced_display++;
@@ -1088,7 +1107,7 @@ _rl_move_cursor_relative (new, data)
putc (data[i], rl_outstream);
#endif /* HACK_TERMCAP_MOTION */
}
- else if (_rl_last_c_pos != new)
+ else if (_rl_last_c_pos > new)
_rl_backspace (_rl_last_c_pos - new);
_rl_last_c_pos = new;
}
@@ -1253,7 +1272,7 @@ static int saved_last_invisible;
static int saved_visible_length;
void
-_rl_save_prompt ()
+rl_save_prompt ()
{
saved_local_prompt = local_prompt;
saved_local_prefix = local_prompt_prefix;
@@ -1265,7 +1284,7 @@ _rl_save_prompt ()
}
void
-_rl_restore_prompt ()
+rl_restore_prompt ()
{
if (local_prompt)
free (local_prompt);
@@ -1285,14 +1304,14 @@ _rl_make_prompt_for_search (pchar)
int len;
char *pmt;
- _rl_save_prompt ();
+ rl_save_prompt ();
if (saved_local_prompt == 0)
{
len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
pmt = xmalloc (len + 2);
if (len)
- strcpy (pmt, rl_prompt);
+ strcpy (pmt, rl_prompt);
pmt[len] = pchar;
pmt[len+1] = '\0';
}
@@ -1301,7 +1320,7 @@ _rl_make_prompt_for_search (pchar)
len = *saved_local_prompt ? strlen (saved_local_prompt) : 0;
pmt = xmalloc (len + 2);
if (len)
- strcpy (pmt, saved_local_prompt);
+ strcpy (pmt, saved_local_prompt);
pmt[len] = pchar;
pmt[len+1] = '\0';
local_prompt = savestring (pmt);
@@ -1561,6 +1580,15 @@ _rl_clean_up_for_exit ()
_rl_move_vert (_rl_vis_botlin);
_rl_vis_botlin = 0;
fflush (rl_outstream);
- rl_restart_output ();
+ rl_restart_output (1, 0);
}
}
+
+void
+_rl_erase_entire_line ()
+{
+ cr ();
+ _rl_clear_to_eol (0);
+ cr ();
+ fflush (rl_outstream);
+}
diff --git a/readline/doc/Makefile.in b/readline/doc/Makefile.in
index 2eabb410833..103147292d9 100644
--- a/readline/doc/Makefile.in
+++ b/readline/doc/Makefile.in
@@ -10,6 +10,7 @@ infodir = @infodir@
mandir = @mandir@
man3dir = $(mandir)/man3
+SHELL = @MAKE_SHELL@
RM = rm -f
TEXINPUTDIR = $(srcdir)
@@ -25,9 +26,9 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
RLSRC = $(srcdir)/rlman.texinfo $(srcdir)/rluser.texinfo \
- $(srcdir)/rltech.texinfo
+ $(srcdir)/rltech.texinfo $(srcdir)/manvers.texinfo
HISTSRC = $(srcdir)/hist.texinfo $(srcdir)/hsuser.texinfo \
- $(srcdir)/hstech.texinfo
+ $(srcdir)/hstech.texinfo $(srcdir)/manvers.texinfo
# This should be a program that converts troff to an ascii-readable format
NROFF = groff -Tascii
@@ -42,6 +43,8 @@ HTMLOBJ = readline.html history.html
HTMLTOC = readline_toc.html history_toc.html
TEXTOBJ = readline.0
+INTERMEDIATE_OBJ = rlman.dvi hist.dvi
+
CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ) $(HTMLTOC) $(TEXTOBJ)
.SUFFIXES: .0 .3 .ps .txt .dvi
@@ -76,16 +79,14 @@ history.ps: history.dvi
$(DVIPS) history.dvi
readline.html: ${RLSRC}
- $(TEXI2HTML) -I $(TEXINPUTDIR) $(srcdir)/rlman.texinfo
- sed -e 's:rlman.html:readline.html:' -e 's:rlman_toc.html:readline_toc.html:' rlman.html > readline.html
- sed -e 's:rlman.html:readline.html:' -e 's:rlman_toc.html:readline_toc.html:' rlman_toc.html > readline_toc.html
- $(RM) rlman.html rlman_toc.html
+ $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/rlman.texinfo
+ sed -e 's:rlman.html:readline.html:' rlman.html > readline.html
+ $(RM) rlman.html
history.html: ${HISTSRC}
- $(TEXI2HTML) -I $(TEXINPUTDIR) $(srcdir)/hist.texinfo
- sed -e 's:hist.html:history.html:' -e 's:hist_toc.html:history_toc.html:' hist.html > history.html
- sed -e 's:hist.html:history.html:' -e 's:hist_toc.html:history_toc.html:' hist_toc.html > history_toc.html
- $(RM) hist.html hist_toc.html
+ $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/hist.texinfo
+ sed -e 's:hist.html:history.html:' hist.html > history.html
+ $(RM) hist.html
info: $(INFOOBJ)
dvi: $(DVIOBJ)
@@ -101,18 +102,20 @@ clean:
distclean: clean
$(RM) $(CREATED_DOCS)
+ $(RM) $(INTERMEDIATE_OBJ)
$(RM) Makefile
mostlyclean: clean
maintainer-clean: clean
$(RM) $(CREATED_DOCS)
+ $(RM) $(INTERMEDIATE_OBJ)
$(RM) Makefile
installdirs: $(top_srcdir)/support/mkdirs
-$(SHELL) $(top_srcdir)/support/mkdirs $(infodir) $(man3dir)
-install: installdirs info
+install: installdirs
if test -f readline.info; then \
${INSTALL_DATA} readline.info $(infodir)/readline.info; \
else \
diff --git a/readline/doc/hist.texinfo b/readline/doc/hist.texinfo
index be8742f5e66..31a0ba0ae72 100644
--- a/readline/doc/hist.texinfo
+++ b/readline/doc/hist.texinfo
@@ -6,26 +6,19 @@
@setchapternewpage odd
-@ignore
-last change: Thu Apr 2 14:38:22 EST 1998
-@end ignore
-
-@set EDITION 2.2
-@set VERSION 2.2
-@set UPDATED 2 April 1998
-@set UPDATE-MONTH April 1998
+@include manvers.texinfo
+@ifinfo
@dircategory Libraries
@direntry
* History: (history). The GNU history library API
@end direntry
-@ifinfo
This document describes the GNU History library, a programming tool that
provides a consistent user interface for recalling lines of previously
typed input.
-Copyright (C) 1988, 1991, 1993, 1995, 1996, 1998 Free Software Foundation, Inc.
+Copyright (C) 1988-1999 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -46,7 +39,7 @@ notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
-by the Foundation.
+by the Free Software Foundation.
@end ifinfo
@titlepage
@@ -77,10 +70,10 @@ notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
-by the Foundation.
+by the Free Software Foundation.
@vskip 0pt plus 1filll
-Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
+Copyright @copyright{} 1988-1999 Free Software Foundation, Inc.
@end titlepage
@ifinfo
diff --git a/readline/doc/hsuser.texinfo b/readline/doc/hsuser.texinfo
index 7c4582d2ace..76cb63b1eee 100644
--- a/readline/doc/hsuser.texinfo
+++ b/readline/doc/hsuser.texinfo
@@ -117,7 +117,7 @@ history list and history file.
@table @code
@item fc
-@comment btindex fc
+@btindex fc
@example
@code{fc [-e @var{ename}] [-nlr] [@var{first}] [@var{last}]}
@code{fc -s [@var{pat}=@var{rep}] [@var{command}]}
@@ -149,7 +149,7 @@ that typing @samp{r cc} runs the last command beginning with @code{cc}
and typing @samp{r} re-executes the last command (@pxref{Aliases}).
@item history
-@comment btindex history
+@btindex history
@example
history [-c] [@var{n}]
history [-anrw] [@var{filename}]
diff --git a/readline/doc/readline.0 b/readline/doc/readline.0
index c925d529cb5..970d8c6d0c7 100644
--- a/readline/doc/readline.0
+++ b/readline/doc/readline.0
@@ -8,6 +8,7 @@ NNAAMMEE
readline - get a line from a user with editing
SSYYNNOOPPSSIISS
+ ##iinncclluuddee <<ssttddiioo..hh>>
##iinncclluuddee <<rreeaaddlliinnee..hh>>
##iinncclluuddee <<hhiissttoorryy..hh>>
@@ -57,11 +58,10 @@ NNOOTTAATTIIOONN
ments deviates from this are noted.
When a command is described as _k_i_l_l_i_n_g text, the text
- deleted is saved for possible future retrieval (_y_a_n_k_i_n_g).
-GNU 1998 Feb 19 1
+GNU 1998 Dec 31 1
@@ -70,6 +70,7 @@ GNU 1998 Feb 19 1
READLINE(3) READLINE(3)
+ deleted is saved for possible future retrieval (_y_a_n_k_i_n_g).
The killed text is saved in a _k_i_l_l _r_i_n_g. Consecutive
kills cause the text to be accumulated into one unit,
which can be yanked all at once. Commands which do not
@@ -126,8 +127,7 @@ IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE
-
-GNU 1998 Feb 19 2
+GNU 1998 Dec 31 2
@@ -193,7 +193,7 @@ READLINE(3) READLINE(3)
-GNU 1998 Feb 19 3
+GNU 1998 Dec 31 3
@@ -259,7 +259,7 @@ READLINE(3) READLINE(3)
-GNU 1998 Feb 19 4
+GNU 1998 Dec 31 4
@@ -274,6 +274,18 @@ READLINE(3) READLINE(3)
for display, scrolling the input horizontally on a
single screen line when it becomes longer than the
screen width rather than wrapping to a new line.
+ iinnppuutt--mmeettaa ((OOffff))
+ If set to OOnn, readline will enable eight-bit input
+ (that is, it will not strip the high bit from the
+ characters it reads), regardless of what the termi-
+ nal claims it can support. The name mmeettaa--ffllaagg is a
+ synonym for this variable.
+ iisseeaarrcchh--tteerrmmiinnaattoorrss ((````CC--[[CC--JJ''''))
+ The string of characters that should terminate an
+ incremental search without subsequently executing
+ the character as a command. If this variable has
+ not been given a value, the characters _E_S_C and _C_-_J
+ will terminate an incremental search.
kkeeyymmaapp ((eemmaaccss))
Set the current readline keymap. The set of legal
keymap names is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_,
@@ -288,44 +300,32 @@ READLINE(3) READLINE(3)
mmaarrkk--mmooddiiffiieedd--lliinneess ((OOffff))
If set to OOnn, history lines that have been modified
are displayed with a preceding asterisk (**).
- mmeettaa--ffllaagg ((OOffff))
- If set to OOnn, readline will enable eight-bit input
- (that is, it will not strip the high bit from the
- characters it reads), regardless of what the termi-
- nal claims it can support.
oouuttppuutt--mmeettaa ((OOffff))
If set to OOnn, readline will display characters with
- the eighth bit set directly rather than as a meta-
+ the eighth bit set directly rather than as a meta-
prefixed escape sequence.
pprriinntt--ccoommpplleettiioonnss--hhoorriizzoonnttaallllyy ((OOffff))
- If set to OOnn, readline will display completions
- with matches sorted horizontally in alphabetical
+ If set to OOnn, readline will display completions
+ with matches sorted horizontally in alphabetical
order, rather than down the screen.
sshhooww--aallll--iiff--aammbbiigguuoouuss ((OOffff))
- This alters the default behavior of the completion
- functions. If set to oonn, words which have more
- than one possible completion cause the matches to
- be listed immediately instead of ringing the bell.
+ This alters the default behavior of the completion
+ functions. If set to oonn, words which have more
+ than one possible completion cause the matches to
+ be listed immediately instead of ringing the bell.
vviissiibbllee--ssttaattss ((OOffff))
If set to OOnn, a character denoting a file's type as
- reported by ssttaatt(2) is appended to the filename
+ reported by ssttaatt(2) is appended to the filename
when listing possible completions.
CCoonnddiittiioonnaall CCoonnssttrruuccttss
- Readline implements a facility similar in spirit to the
- conditional compilation features of the C preprocessor
- which allows key bindings and variable settings to be per-
- formed as the result of tests. There are four parser
- directives used.
-
- $$iiff The $$iiff construct allows bindings to be made based
- on the editing mode, the terminal being used, or
- the application using readline. The text of the
- test extends to the end of the line; no characters
+ Readline implements a facility similar in spirit to the
+ conditional compilation features of the C preprocessor
+ which allows key bindings and variable settings to be
-GNU 1998 Feb 19 5
+GNU 1998 Dec 31 5
@@ -334,21 +334,28 @@ GNU 1998 Feb 19 5
READLINE(3) READLINE(3)
+ performed as the result of tests. There are four parser
+ directives used.
+
+ $$iiff The $$iiff construct allows bindings to be made based
+ on the editing mode, the terminal being used, or
+ the application using readline. The text of the
+ test extends to the end of the line; no characters
are required to isolate it.
- mmooddee The mmooddee== form of the $$iiff directive is used
- to test whether readline is in emacs or vi
- mode. This may be used in conjunction with
+ mmooddee The mmooddee== form of the $$iiff directive is used
+ to test whether readline is in emacs or vi
+ mode. This may be used in conjunction with
the sseett kkeeyymmaapp command, for instance, to set
- bindings in the _e_m_a_c_s_-_s_t_a_n_d_a_r_d and _e_m_a_c_s_-
- _c_t_l_x keymaps only if readline is starting
+ bindings in the _e_m_a_c_s_-_s_t_a_n_d_a_r_d and _e_m_a_c_s_-
+ _c_t_l_x keymaps only if readline is starting
out in emacs mode.
tteerrmm The tteerrmm== form may be used to include termi-
- nal-specific key bindings, perhaps to bind
- the key sequences output by the terminal's
- function keys. The word on the right side
- of the == is tested against the full name of
+ nal-specific key bindings, perhaps to bind
+ the key sequences output by the terminal's
+ function keys. The word on the right side
+ of the == is tested against the full name of
the terminal and the portion of the terminal
name before the first --. This allows _s_u_n to
match both _s_u_n and _s_u_n_-_c_m_d, for instance.
@@ -357,12 +364,12 @@ READLINE(3) READLINE(3)
The aapppplliiccaattiioonn construct is used to include
application-specific settings. Each program
using the readline library sets the _a_p_p_l_i_c_a_-
- _t_i_o_n _n_a_m_e, and an initialization file can
- test for a particular value. This could be
+ _t_i_o_n _n_a_m_e, and an initialization file can
+ test for a particular value. This could be
used to bind key sequences to functions use-
- ful for a specific program. For instance,
- the following command adds a key sequence
- that quotes the current or previous word in
+ ful for a specific program. For instance,
+ the following command adds a key sequence
+ that quotes the current or previous word in
Bash:
$$iiff bash
@@ -373,25 +380,18 @@ READLINE(3) READLINE(3)
$$eennddiiff This command, as seen in the previous example, ter-
minates an $$iiff command.
- $$eellssee Commands in this branch of the $$iiff directive are
+ $$eellssee Commands in this branch of the $$iiff directive are
executed if the test fails.
$$iinncclluuddee
- This directive takes a single filename as an argu-
- ment and reads commands and bindings from that
- file. For example, the following directive would
+ This directive takes a single filename as an argu-
+ ment and reads commands and bindings from that
+ file. For example, the following directive would
read _/_e_t_c_/_i_n_p_u_t_r_c:
- $$iinncclluuddee _/_e_t_c_/_i_n_p_u_t_r_c
-
-SSEEAARRCCHHIINNGG
- Readline provides commands for searching through the com-
- mand history for lines containing a specified string.
- There are two search modes: _i_n_c_r_e_m_e_n_t_a_l and _n_o_n_-
-
-GNU 1998 Feb 19 6
+GNU 1998 Dec 31 6
@@ -400,36 +400,44 @@ GNU 1998 Feb 19 6
READLINE(3) READLINE(3)
- _i_n_c_r_e_m_e_n_t_a_l.
+ $$iinncclluuddee _/_e_t_c_/_i_n_p_u_t_r_c
+
+SSEEAARRCCHHIINNGG
+ Readline provides commands for searching through the com-
+ mand history for lines containing a specified string.
+ There are two search modes: _i_n_c_r_e_m_e_n_t_a_l and _n_o_n_-_i_n_c_r_e_m_e_n_-
+ _t_a_l.
- Incremental searches begin before the user has finished
+ Incremental searches begin before the user has finished
typing the search string. As each character of the search
string is typed, readline displays the next entry from the
- history matching the string typed so far. An incremental
- search requires only as many characters as needed to find
- the desired history entry. The Escape character is used
- to terminate an incremental search. Control-J will also
- terminate the search. Control-G will abort an incremental
- search and restore the original line. When the search is
- terminated, the history entry containing the search string
- becomes the current line. To find other matching entries
- in the history list, type Control-S or Control-R as appro-
- priate. This will search backward or forward in the his-
- tory for the next line matching the search string typed so
- far. Any other key sequence bound to a readline command
- will terminate the search and execute that command. For
- instance, a _n_e_w_l_i_n_e will terminate the search and accept
- the line, thereby executing the command from the history
- list.
-
- Non-incremental searches read the entire search string
+ history matching the string typed so far. An incremental
+ search requires only as many characters as needed to find
+ the desired history entry. The characters present in the
+ value of the _i_s_e_a_r_c_h_-_t_e_r_m_i_n_a_t_o_r_s variable are used to ter-
+ minate an incremental search. If that variable has not
+ been assigned a value the Escape and Control-J characters
+ will terminate an incremental search. Control-G will
+ abort an incremental search and restore the original line.
+ When the search is terminated, the history entry contain-
+ ing the search string becomes the current line. To find
+ other matching entries in the history list, type Control-S
+ or Control-R as appropriate. This will search backward or
+ forward in the history for the next line matching the
+ search string typed so far. Any other key sequence bound
+ to a readline command will terminate the search and exe-
+ cute that command. For instance, a _n_e_w_l_i_n_e will terminate
+ the search and accept the line, thereby executing the com-
+ mand from the history list.
+
+ Non-incremental searches read the entire search string
before starting to search for matching history lines. The
- search string may be typed by the user or be part of the
+ search string may be typed by the user or be part of the
contents of the current line.
EEDDIITTIINNGG CCOOMMMMAANNDDSS
- The following is a list of the names of the commands and
- the default key sequences to which they are bound. Com-
+ The following is a list of the names of the commands and
+ the default key sequences to which they are bound. Com-
mand names without an accompanying key sequence are
unbound by default.
@@ -443,21 +451,13 @@ EEDDIITTIINNGG CCOOMMMMAANNDDSS
bbaacckkwwaarrdd--cchhaarr ((CC--bb))
Move back a character.
ffoorrwwaarrdd--wwoorrdd ((MM--ff))
- Move forward to the end of the next word. Words
- are composed of alphanumeric characters (letters
+ Move forward to the end of the next word. Words
+ are composed of alphanumeric characters (letters
and digits).
- bbaacckkwwaarrdd--wwoorrdd ((MM--bb))
- Move back to the start of this, or the previous,
- word. Words are composed of alphanumeric charac-
- ters (letters and digits).
- cclleeaarr--ssccrreeeenn ((CC--ll))
- Clear the screen leaving the current line at the
- top of the screen. With an argument, refresh the
- current line without clearing the screen.
-GNU 1998 Feb 19 7
+GNU 1998 Dec 31 7
@@ -466,64 +466,64 @@ GNU 1998 Feb 19 7
READLINE(3) READLINE(3)
+ bbaacckkwwaarrdd--wwoorrdd ((MM--bb))
+ Move back to the start of this, or the previous,
+ word. Words are composed of alphanumeric charac-
+ ters (letters and digits).
+ cclleeaarr--ssccrreeeenn ((CC--ll))
+ Clear the screen leaving the current line at the
+ top of the screen. With an argument, refresh the
+ current line without clearing the screen.
rreeddrraaww--ccuurrrreenntt--lliinnee
Refresh the current line.
CCoommmmaannddss ffoorr MMaanniippuullaattiinngg tthhee HHiissttoorryy
aacccceepptt--lliinnee ((NNeewwlliinnee,, RReettuurrnn))
- Accept the line regardless of where the cursor is.
- If this line is non-empty, add it to the history
- list. If the line is a modified history line, then
+ Accept the line regardless of where the cursor is.
+ If this line is non-empty, add it to the history
+ list. If the line is a modified history line, then
restore the history line to its original state.
pprreevviioouuss--hhiissttoorryy ((CC--pp))
- Fetch the previous command from the history list,
+ Fetch the previous command from the history list,
moving back in the list.
nneexxtt--hhiissttoorryy ((CC--nn))
- Fetch the next command from the history list, mov-
+ Fetch the next command from the history list, mov-
ing forward in the list.
bbeeggiinnnniinngg--ooff--hhiissttoorryy ((MM--<<))
Move to the first line in the history.
eenndd--ooff--hhiissttoorryy ((MM-->>))
- Move to the end of the input history, i.e., the
+ Move to the end of the input history, i.e., the
line currently being entered.
rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((CC--rr))
- Search backward starting at the current line and
+ Search backward starting at the current line and
moving `up' through the history as necessary. This
is an incremental search.
ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((CC--ss))
- Search forward starting at the current line and
- moving `down' through the history as necessary.
+ Search forward starting at the current line and
+ moving `down' through the history as necessary.
This is an incremental search.
nnoonn--iinnccrreemmeennttaall--rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((MM--pp))
Search backward through the history starting at the
- current line using a non-incremental search for a
+ current line using a non-incremental search for a
string supplied by the user.
nnoonn--iinnccrreemmeennttaall--ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((MM--nn))
- Search forward through the history using a non-
- incremental search for a string supplied by the
+ Search forward through the history using a non-
+ incremental search for a string supplied by the
user.
hhiissttoorryy--sseeaarrcchh--ffoorrwwaarrdd
- Search forward through the history for the string
+ Search forward through the history for the string
of characters between the start of the current line
- and the current cursor position (the _p_o_i_n_t). This
+ and the current cursor position (the _p_o_i_n_t). This
is a non-incremental search.
hhiissttoorryy--sseeaarrcchh--bbaacckkwwaarrdd
- Search backward through the history for the string
+ Search backward through the history for the string
of characters between the start of the current line
and the point. This is a non-incremental search.
- yyaannkk--nntthh--aarrgg ((MM--CC--yy))
- Insert the first argument to the previous command
- (usually the second word on the previous line) at
- point (the current cursor position). With an argu-
- ment _n, insert the _nth word from the previous com-
- mand (the words in the previous command begin with
- word 0). A negative argument inserts the _nth word
- from the end of the previous command.
-GNU 1998 Feb 19 8
+GNU 1998 Dec 31 8
@@ -532,24 +532,37 @@ GNU 1998 Feb 19 8
READLINE(3) READLINE(3)
+ yyaannkk--nntthh--aarrgg ((MM--CC--yy))
+ Insert the first argument to the previous command
+ (usually the second word on the previous line) at
+ point (the current cursor position). With an argu-
+ ment _n, insert the _nth word from the previous com-
+ mand (the words in the previous command begin with
+ word 0). A negative argument inserts the _nth word
+ from the end of the previous command.
yyaannkk--llaasstt--aarrgg ((MM--..,, MM--__))
- Insert the last argument to the previous command
- (the last word of the previous history entry).
+ Insert the last argument to the previous command
+ (the last word of the previous history entry).
With an argument, behave exactly like yyaannkk--nntthh--aarrgg.
Successive calls to yyaannkk--llaasstt--aarrgg move back through
- the history list, inserting the last argument of
+ the history list, inserting the last argument of
each line in turn.
CCoommmmaannddss ffoorr CChhaannggiinngg TTeexxtt
ddeelleettee--cchhaarr ((CC--dd))
Delete the character under the cursor. If point is
- at the beginning of the line, there are no charac-
- ters in the line, and the last character typed was
+ at the beginning of the line, there are no charac-
+ ters in the line, and the last character typed was
not bound to BBddeelleettee--cchhaarr, then return EEOOFF.
bbaacckkwwaarrdd--ddeelleettee--cchhaarr ((RRuubboouutt))
Delete the character behind the cursor. When given
- a numeric argument, save the deleted text on the
+ a numeric argument, save the deleted text on the
kill ring.
+ ffoorrwwaarrdd--bbaacckkwwaarrdd--ddeelleettee--cchhaarr
+ Delete the character under the cursor, unless the
+ cursor is at the end of the line, in which case the
+ character behind the cursor is deleted. By
+ default, this is not bound to a key.
qquuootteedd--iinnsseerrtt ((CC--qq,, CC--vv))
Add the next character that you type to the line
verbatim. This is how to insert characters like
@@ -572,6 +585,19 @@ READLINE(3) READLINE(3)
Uppercase the current (or following) word. With a
negative argument, uppercase the previous word, but
do not move point.
+
+
+
+
+GNU 1998 Dec 31 9
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
ddoowwnnccaassee--wwoorrdd ((MM--ll))
Lowercase the current (or following) word. With a
negative argument, lowercase the previous word, but
@@ -585,19 +611,6 @@ READLINE(3) READLINE(3)
kkiillll--lliinnee ((CC--kk))
Kill the text from the current cursor position to
the end of the line.
-
-
-
-
-GNU 1998 Feb 19 9
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
bbaacckkwwaarrdd--kkiillll--lliinnee ((CC--xx RRuubboouutt))
Kill backward to the beginning of the line.
uunniixx--lliinnee--ddiissccaarrdd ((CC--uu))
@@ -639,6 +652,18 @@ READLINE(3) READLINE(3)
Rotate the kill ring, and yank the new top. Only
works following yyaannkk or yyaannkk--ppoopp.
+
+
+
+GNU 1998 Dec 31 10
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
NNuummeerriicc AArrgguummeennttss
ddiiggiitt--aarrgguummeenntt ((MM--00,, MM--11,, ......,, MM----))
Add this digit to the argument already accumulat-
@@ -651,20 +676,8 @@ READLINE(3) READLINE(3)
define the argument. If the command is followed by
digits, executing uunniivveerrssaall--aarrgguummeenntt again ends the
numeric argument, but is otherwise ignored. As a
- special case, if this command is immediately
-
-
-
-GNU 1998 Feb 19 10
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- followed by a character that is neither a digit or
+ special case, if this command is immediately fol-
+ lowed by a character that is neither a digit or
minus sign, the argument count for the next command
is multiplied by four. The argument count is ini-
tially one, so executing this function the first
@@ -705,30 +718,36 @@ READLINE(3) READLINE(3)
the list. This command is intended to be bound to
TTAABB, but is unbound by default.
- KKeeyybbooaarrdd MMaaccrrooss
- ssttaarrtt--kkbbdd--mmaaccrroo ((CC--xx (())
- Begin saving the characters typed into the current
- keyboard macro.
- eenndd--kkbbdd--mmaaccrroo ((CC--xx ))))
- Stop saving the characters typed into the current
- keyboard macro and store the definition.
- ccaallll--llaasstt--kkbbdd--mmaaccrroo ((CC--xx ee))
- Re-execute the last keyboard macro defined, by mak-
- ing the characters in the macro appear as if typed
- at the keyboard.
+GNU 1998 Dec 31 11
-GNU 1998 Feb 19 11
+READLINE(3) READLINE(3)
-READLINE(3) READLINE(3)
+ ddeelleettee--cchhaarr--oorr--lliisstt
+ Deletes the character under the cursor if not at
+ the beginning or end of the line (like ddeelleettee--
+ cchhaarr). If at the end of the line, behaves identi-
+ cally to ppoossssiibbllee--ccoommpplleettiioonnss. This command is
+ unbound by default.
+ KKeeyybbooaarrdd MMaaccrrooss
+ ssttaarrtt--kkbbdd--mmaaccrroo ((CC--xx (())
+ Begin saving the characters typed into the current
+ keyboard macro.
+ eenndd--kkbbdd--mmaaccrroo ((CC--xx ))))
+ Stop saving the characters typed into the current
+ keyboard macro and store the definition.
+ ccaallll--llaasstt--kkbbdd--mmaaccrroo ((CC--xx ee))
+ Re-execute the last keyboard macro defined, by mak-
+ ing the characters in the macro appear as if typed
+ at the keyboard.
MMiisscceellllaanneeoouuss
rree--rreeaadd--iinniitt--ffiillee ((CC--xx CC--rr))
@@ -753,7 +772,7 @@ READLINE(3) READLINE(3)
Undo all changes made to this line. This is like
executing the uunnddoo command enough times to return
the line to its initial state.
- ttiillddee--eexxppaanndd ((MM--~~))
+ ttiillddee--eexxppaanndd ((MM--&&))
Perform tilde expansion on the current word.
sseett--mmaarrkk ((CC--@@,, MM--<<ssppaaccee>>))
Set the mark to the current point. If a numeric
@@ -765,6 +784,18 @@ READLINE(3) READLINE(3)
cursor position is saved as the mark.
cchhaarraacctteerr--sseeaarrcchh ((CC--]]))
A character is read and point is moved to the next
+
+
+
+GNU 1998 Dec 31 12
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
occurrence of that character. A negative count
searches for previous occurrences.
cchhaarraacctteerr--sseeaarrcchh--bbaacckkwwaarrdd ((MM--CC--]]))
@@ -783,20 +814,8 @@ READLINE(3) READLINE(3)
ment is supplied, the output is formatted in such a
way that it can be made part of an _i_n_p_u_t_r_c file.
dduummpp--vvaarriiaabblleess
- Print all of the settable variables and their
-
-
-
-GNU 1998 Feb 19 12
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
- values to the readline output stream. If a numeric
+ Print all of the settable variables and their val-
+ ues to the readline output stream. If a numeric
argument is supplied, the output is formatted in
such a way that it can be made part of an _i_n_p_u_t_r_c
file.
@@ -830,6 +849,19 @@ DDEEFFAAUULLTT KKEEYY BBIINNDDIINNGGSS
the bell (subject to the setting of the bbeellll--ssttyyllee vari-
able).
+
+
+
+
+GNU 1998 Dec 31 13
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
EEmmaaccss MMooddee
Emacs Standard bindings
@@ -850,18 +882,6 @@ DDEEFFAAUULLTT KKEEYY BBIINNDDIINNGGSS
"C-P" previous-history
"C-Q" quoted-insert
"C-R" reverse-search-history
-
-
-
-GNU 1998 Feb 19 13
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
"C-S" forward-search-history
"C-T" transpose-chars
"C-U" unix-line-discard
@@ -896,6 +916,18 @@ READLINE(3) READLINE(3)
"M-1" digit-argument
"M-2" digit-argument
"M-3" digit-argument
+
+
+
+GNU 1998 Dec 31 14
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
"M-4" digit-argument
"M-5" digit-argument
"M-6" digit-argument
@@ -916,18 +948,6 @@ READLINE(3) READLINE(3)
"M-R" revert-line
"M-T" transpose-words
"M-U" upcase-word
-
-
-
-GNU 1998 Feb 19 14
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
"M-Y" yank-pop
"M-\" delete-horizontal-space
"M-~" tilde-expand
@@ -962,6 +982,18 @@ READLINE(3) READLINE(3)
"C-W" unix-word-rubout
"C-Y" yank
"C-[" vi-movement-mode
+
+
+
+GNU 1998 Dec 31 15
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
"C-_" undo
" " to "~" self-insert
"C-?" backward-delete-char
@@ -982,18 +1014,6 @@ READLINE(3) READLINE(3)
"C-R" reverse-search-history
"C-S" forward-search-history
"C-T" transpose-chars
-
-
-
-GNU 1998 Feb 19 15
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
"C-U" unix-line-discard
"C-V" quoted-insert
"C-W" unix-word-rubout
@@ -1028,6 +1048,18 @@ READLINE(3) READLINE(3)
"S" vi-subst
"T" vi-char-search
"U" revert-line
+
+
+
+GNU 1998 Dec 31 16
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
"W" vi-next-word
"X" backward-delete-char
"Y" vi-yank-to
@@ -1048,18 +1080,6 @@ READLINE(3) READLINE(3)
"l" forward-char
"m" vi-set-mark
"n" vi-search-again
-
-
-
-GNU 1998 Feb 19 16
-
-
-
-
-
-READLINE(3) READLINE(3)
-
-
"p" vi-put
"r" vi-change-char
"s" vi-subst
@@ -1094,6 +1114,18 @@ BBUUGG RREEPPOORRTTSS
library that you have.
Once you have determined that a bug actually exists, mail
+
+
+
+GNU 1998 Dec 31 17
+
+
+
+
+
+READLINE(3) READLINE(3)
+
+
a bug report to _b_u_g_-_r_e_a_d_l_i_n_e@_g_n_u_._o_r_g. If you have a fix,
you are welcome to mail that as well! Suggestions and
`philosophical' bug reports may be mailed to _b_u_g_-_r_e_a_d_-
@@ -1117,6 +1149,40 @@ BBUUGGSS
-GNU 1998 Feb 19 17
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+GNU 1998 Dec 31 18
diff --git a/readline/doc/readline.3 b/readline/doc/readline.3
index bb9f7590258..6b36f2f5695 100644
--- a/readline/doc/readline.3
+++ b/readline/doc/readline.3
@@ -6,9 +6,9 @@
.\" Case Western Reserve University
.\" chet@ins.CWRU.Edu
.\"
-.\" Last Change: Thu Feb 19 10:26:47 EST 1998
+.\" Last Change: Thu Dec 31 10:16:30 EST 1998
.\"
-.TH READLINE 3 "1998 Feb 19" GNU
+.TH READLINE 3 "1998 Dec 31" GNU
.\"
.\" File Name macro. This used to be `.PN', for Path Name,
.\" but Sun doesn't seem to like that very much.
@@ -22,6 +22,7 @@ readline \- get a line from a user with editing
.LP
.nf
.ft B
+#include <stdio.h>
#include <readline.h>
#include <history.h>
.ft
@@ -380,6 +381,19 @@ When set to \fBOn\fP, makes readline use a single line for display,
scrolling the input horizontally on a single screen line when it
becomes longer than the screen width rather than wrapping to a new line.
.TP
+.B input\-meta (Off)
+If set to \fBOn\fP, readline will enable eight-bit input (that is,
+it will not strip the high bit from the characters it reads),
+regardless of what the terminal claims it can support. The name
+.B meta\-flag
+is a synonym for this variable.
+.TP
+.B isearch\-terminators (``C\-[C\-J'')
+The string of characters that should terminate an incremental
+search without subsequently executing the character as a command.
+If this variable has not been given a value, the characters
+\fIESC\fP and \fIC\-J\fP will terminate an incremental search.
+.TP
.B keymap (emacs)
Set the current readline keymap. The set of legal keymap names is
\fIemacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move,
@@ -400,11 +414,6 @@ appended.
If set to \fBOn\fP, history lines that have been modified are displayed
with a preceding asterisk (\fB*\fP).
.TP
-.B meta\-flag (Off)
-If set to \fBOn\fP, readline will enable eight-bit input (that is,
-it will not strip the high bit from the characters it reads),
-regardless of what the terminal claims it can support.
-.TP
.B output\-meta (Off)
If set to \fBOn\fP, readline will display characters with the
eighth bit set directly rather than as a meta-prefixed escape
@@ -509,8 +518,10 @@ As each character of the search string is typed, readline displays
the next entry from the history matching the string typed so far.
An incremental search requires only as many characters as needed to
find the desired history entry.
-The Escape character is used to terminate an incremental search.
-Control-J will also terminate the search.
+The characters present in the value of the \fIisearch-terminators\fP
+variable are used to terminate an incremental search.
+If that variable has not been assigned a value the Escape and
+Control-J characters will terminate an incremental search.
Control-G will abort an incremental search and restore the original
line.
When the search is terminated, the history entry containing the
@@ -647,6 +658,11 @@ the last character typed was not bound to \fBBdelete\-char\fP, then return
Delete the character behind the cursor. When given a numeric argument,
save the deleted text on the kill ring.
.TP
+.B forward\-backward\-delete\-char
+Delete the character under the cursor, unless the cursor is at the
+end of the line, in which case the character behind the cursor is
+deleted. By default, this is not bound to a key.
+.TP
.B quoted\-insert (C\-q, C\-v)
Add the next character that you type to the line verbatim. This is
how to insert characters like \fBC\-q\fP, for example.
@@ -798,6 +814,13 @@ of matches; a negative argument may be used to move backward
through the list.
This command is intended to be bound to \fBTAB\fP, but is unbound
by default.
+.TP
+.B delete\-char\-or\-list
+Deletes the character under the cursor if not at the beginning or
+end of the line (like \fBdelete-char\fP).
+If at the end of the line, behaves identically to
+\fBpossible-completions\fP.
+This command is unbound by default.
.PD
.SS Keyboard Macros
.PP
@@ -847,7 +870,7 @@ Undo all changes made to this line. This is like executing the
.B undo
command enough times to return the line to its initial state.
.TP
-.B tilde\-expand (M\-~)
+.B tilde\-expand (M\-&)
Perform tilde expansion on the current word.
.TP
.B set\-mark (C\-@, M-<space>)
diff --git a/readline/doc/rlman.texinfo b/readline/doc/rlman.texinfo
index dd6478af5a2..41bafbf501b 100644
--- a/readline/doc/rlman.texinfo
+++ b/readline/doc/rlman.texinfo
@@ -6,26 +6,19 @@
@synindex vr fn
@setchapternewpage odd
-@ignore
-last change: Thu Apr 2 14:39:03 EST 1998
-@end ignore
-
-@set EDITION 2.2
-@set VERSION 2.2
-@set UPDATED 2 April 1998
-@set UPDATE-MONTH April 1998
+@include manvers.texinfo
+@ifinfo
@dircategory Libraries
@direntry
* Readline: (readline). The GNU readline library API
@end direntry
-@ifinfo
This document describes the GNU Readline Library, a utility which aids
in the consistency of user interface across discrete programs that need
to provide a command line interface.
-Copyright (C) 1988, 1991, 1993, 1996, 1998 Free Software Foundation, Inc.
+Copyright (C) 1988-1999 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -46,7 +39,7 @@ notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
-by the Foundation.
+by the Free Software Foundation.
@end ifinfo
@titlepage
@@ -77,10 +70,10 @@ notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
-by the Foundation.
+by the Free Software Foundation.
@vskip 0pt plus 1filll
-Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
+Copyright @copyright{} 1988-1999 Free Software Foundation, Inc.
@end titlepage
@ifinfo
diff --git a/readline/doc/rltech.texinfo b/readline/doc/rltech.texinfo
index bce508717ac..ea8d7f8c5e5 100644
--- a/readline/doc/rltech.texinfo
+++ b/readline/doc/rltech.texinfo
@@ -8,7 +8,7 @@ This document describes the GNU Readline Library, a utility for aiding
in the consitency of user interface across discrete programs that need
to provide a command line interface.
-Copyright (C) 1988, 1994, 1996 Free Software Foundation, Inc.
+Copyright (C) 1988, 1994, 1996, 1998, 1999 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -47,7 +47,9 @@ in your own programs, this section is for you.
* Readline Variables:: Variables accessible to custom
functions.
* Readline Convenience Functions:: Functions which Readline supplies to
- aid in writing your own
+ aid in writing your own custom
+ functions.
+* Readline Signal Handling:: How Readline behaves when it receives signals.
* Custom Completers:: Supplanting or supplementing Readline's
completion functions.
@end menu
@@ -268,6 +270,13 @@ Setting this to a value makes it the next keystroke read. This is a
way to stuff a single character into the input stream.
@end deftypevar
+@deftypevar int rl_erase_empty_line
+Setting this to a non-zero value causes Readline to completely erase
+the current line, including any prompt, any time a newline is typed as
+the only character on an otherwise-empty line. The cursor is moved to
+the beginning of the newly-blank line.
+@end deftypevar
+
@deftypevar {char *} rl_prompt
The prompt Readline uses. This is set from the argument to
@code{readline ()}, and should not be assigned to directly.
@@ -300,6 +309,12 @@ If non-zero, this is the address of a function to call just
before @code{readline} prints the first prompt.
@end deftypevar
+@deftypevar {Function *} rl_pre_input_hook
+If non-zero, this is the address of a function to call after
+the first prompt has been printed and just before @code{readline}
+starts reading input characters.
+@end deftypevar
+
@deftypevar {Function *} rl_event_hook
If non-zero, this is the address of a function to call periodically
when readline is waiting for terminal input.
@@ -619,6 +634,16 @@ is also used to display numeric arguments and search strings.
Clear the message in the echo area.
@end deftypefun
+@deftypefun void rl_save_prompt ()
+Save the local Readline prompt display state in preparation for
+displaying a new message in the message area with @code{rl_message}.
+@end deftypefun
+
+@deftypefun void rl_restore_prompt ()
+Restore the local Readline prompt display state saved by the most
+recent call to @code{rl_save_prompt}.
+@end deftypefun
+
@node Modifying Text
@subsection Modifying Text
@@ -689,6 +714,16 @@ Return 1 if @var{c} is a numeric character.
Ring the terminal bell, obeying the setting of @code{bell-style}.
@end deftypefun
+@deftypefun void rl_display_match_list (char **matches, int len, int max)
+A convenience function for displaying a list of strings in
+columnar format on Readline's output stream. @code{matches} is the list
+of strings, in argv format, such as a list of completion matches.
+@code{len} is the number of strings in @code{matches}, and @code{max}
+is the length of the longest string in @code{matches}. This function uses
+the setting of @code{print-completions-horizontally} to select how the
+matches are displayed (@pxref{Readline Init File Syntax}).
+@end deftypefun
+
The following are implemented as macros, defined in @code{chartypes.h}.
@deftypefun int uppercase_p (int c)
@@ -814,6 +849,116 @@ invert_case_line (count, key)
@}
@end example
+@node Readline Signal Handling
+@section Readline Signal Handling
+
+Signals are asynchronous events sent to a process by the Unix kernel,
+sometimes on behalf of another process. They are intended to indicate
+exceptional events, like a user pressing the interrupt key on his
+terminal, or a network connection being broken. There is a class of
+signals that can be sent to the process currently reading input from
+the keyboard. Since Readline changes the terminal attributes when it
+is called, it needs to perform special processing when a signal is
+received to restore the terminal to a sane state, or provide application
+writers with functions to do so manually.
+
+Readline contains an internal signal handler that is installed for a
+number of signals (@code{SIGINT}, @code{SIGQUIT}, @code{SIGTERM},
+@code{SIGALRM}, @code{SIGTSTP}, @code{SIGTTIN}, and @code{SIGTTOU}).
+When one of these signals is received, the signal handler
+will reset the terminal attributes to those that were in effect before
+@code{readline ()} was called, reset the signal handling to what it was
+before @code{readline ()} was called, and resend the signal to the calling
+application.
+If and when the calling application's signal handler returns, Readline
+will reinitialize the terminal and continue to accept input.
+When a @code{SIGINT} is received, the Readline signal handler performs
+some additional work, which will cause any partially-entered line to be
+aborted (see the description of @code{rl_free_line_state ()}).
+
+There is an additional Readline signal handler, for @code{SIGWINCH}, which
+the kernel sends to a process whenever the terminal's size changes (for
+example, if a user resizes an @code{xterm}). The Readline @code{SIGWINCH}
+handler updates Readline's internal screen size state, and then calls any
+@code{SIGWINCH} signal handler the calling application has installed.
+Readline calls the application's @code{SIGWINCH} signal handler without
+resetting the terminal to its original state. If the application's signal
+handler does more than update its idea of the terminal size and return (for
+example, a @code{longjmp} back to a main processing loop), it @emph{must}
+call @code{rl_cleanup_after_signal ()} (described below), to restore the
+terminal state.
+
+Readline provides two variables that allow application writers to
+control whether or not it will catch certain signals and act on them
+when they are received. It is important that applications change the
+values of these variables only when calling @code{readline ()}, not in
+a signal handler, so Readline's internal signal state is not corrupted.
+
+@deftypevar int rl_catch_signals
+If this variable is non-zero, Readline will install signal handlers for
+@code{SIGINT}, @code{SIGQUIT}, @code{SIGTERM}, @code{SIGALRM},
+@code{SIGTSTP}, @code{SIGTTIN}, and @code{SIGTTOU}.
+
+The default value of @code{rl_catch_signals} is 1.
+@end deftypevar
+
+@deftypevar int rl_catch_sigwinch
+If this variable is non-zero, Readline will install a signal handler for
+@code{SIGWINCH}.
+
+The default value of @code{rl_catch_sigwinch} is 1.
+@end deftypevar
+
+If an application does not wish to have Readline catch any signals, or
+to handle signals other than those Readline catches (@code{SIGHUP},
+for example),
+Readline provides convenience functions to do the necessary terminal
+and internal state cleanup upon receipt of a signal.
+
+@deftypefun void rl_cleanup_after_signal (void)
+This function will reset the state of the terminal to what it was before
+@code{readline ()} was called, and remove the Readline signal handlers for
+all signals, depending on the values of @code{rl_catch_signals} and
+@code{rl_catch_sigwinch}.
+@end deftypefun
+
+@deftypefun void rl_free_line_state (void)
+This will free any partial state associated with the current input line
+(undo information, any partial history entry, any partially-entered
+keyboard macro, and any partially-entered numeric argument). This
+should be called before @code{rl_cleanup_after_signal ()}. The
+Readline signal handler for @code{SIGINT} calls this to abort the
+current input line.
+@end deftypefun
+
+@deftypefun void rl_reset_after_signal (void)
+This will reinitialize the terminal and reinstall any Readline signal
+handlers, depending on the values of @code{rl_catch_signals} and
+@code{rl_catch_sigwinch}.
+@end deftypefun
+
+If an application does not wish Readline to catch @code{SIGWINCH}, it may
+call @code{rl_resize_terminal ()} to force Readline to update its idea of
+the terminal size when a @code{SIGWINCH} is received.
+
+@deftypefun void rl_resize_terminal (void)
+Update Readline's internal screen size.
+@end deftypefun
+
+The following functions install and remove Readline's signal handlers.
+
+@deftypefun int rl_set_signals (void)
+Install Readline's signal handler for @code{SIGINT}, @code{SIGQUIT},
+@code{SIGTERM}, @code{SIGALRM}, @code{SIGTSTP}, @code{SIGTTIN},
+@code{SIGTTOU}, and @code{SIGWINCH}, depending on the values of
+@code{rl_catch_signals} and @code{rl_catch_sigwinch}.
+@end deftypefun
+
+@deftypefun int rl_clear_signals (void)
+Remove all of the Readline signal handlers installed by
+@code{rl_set_signals ()}.
+@end deftypefun
+
@node Custom Completers
@section Custom Completers
@@ -1108,6 +1253,20 @@ string (the current directory name) as an argument. It could be used
to expand symbolic links or shell variables in pathnames.
@end deftypevar
+@deftypevar {VFunction *} rl_completion_display_matches_hook
+If non-zero, then this is the address of a function to call when
+completing a word would normally display the list of possible matches.
+This function is called in lieu of Readline displaying the list.
+It takes three arguments:
+(@code{char **}@var{matches}, @code{int} @var{num_matches}, @code{int} @var{max_length})
+where @var{matches} is the array of matching strings,
+@var{num_matches} is the number of strings in that array, and
+@var{max_length} is the length of the longest string in that array.
+Readline provides a convenience function, @code{rl_display_match_list},
+that takes care of doing the display to Readline's output stream. That
+function may be called from this hook.
+@end deftypevar
+
@node A Short Completion Example
@subsection A Short Completion Example
diff --git a/readline/doc/rluser.texinfo b/readline/doc/rluser.texinfo
index b2fd060366a..755f7ca3a35 100644
--- a/readline/doc/rluser.texinfo
+++ b/readline/doc/rluser.texinfo
@@ -97,7 +97,7 @@ regardless of the location of the cursor within the line.
* Readline Killing Commands:: How to delete text, and how to get it back!
* Readline Arguments:: Giving numeric arguments to commands.
* Searching:: Searching through previous lines.
- @end menu
+@end menu
@node Readline Bare Essentials
@subsection Readline Bare Essentials
@@ -252,8 +252,10 @@ As each character of the search string is typed, Readline displays
the next entry from the history matching the string typed so far.
An incremental search requires only as many characters as needed to
find the desired history entry.
-The @key{ESC} character is used to terminate an incremental search.
-@key{C-j} will also terminate the search.
+The characters present in the value of the @var{isearch-terminators} variable
+are used to terminate an incremental search.
+If that variable has not been assigned a value, the @key{ESC} and
+@key{C-J} characters will terminate an incremental search.
@key{C-g} will abort an incremental search and restore the original line.
When the search is terminated, the history entry containing the
search string becomes the current line.
@@ -396,6 +398,22 @@ horizontally on a single screen line when they are longer than the width
of the screen, instead of wrapping onto a new screen line. By default,
this variable is set to @samp{off}.
+@item input-meta
+@vindex input-meta
+@vindex meta-flag
+If set to @samp{on}, Readline will enable eight-bit input (it
+will not strip the eighth bit from the characters it reads),
+regardless of what the terminal claims it can support. The
+default value is @samp{off}. The name @code{meta-flag} is a
+synonym for this variable.
+
+@item isearch-terminators
+@vindex isearch-terminators
+The string of characters that should terminate an incremental search without
+subsequently executing the character as a command (@pxref{Searching}).
+If this variable has not been given a value, the characters @key{ESC} and
+@key{C-J} will terminate an incremental search.
+
@item keymap
@vindex keymap
Sets Readline's idea of the current keymap for key binding commands.
@@ -422,15 +440,6 @@ This variable, when set to @samp{on}, causes Readline to display an
asterisk (@samp{*}) at the start of history lines which have been modified.
This variable is @samp{off} by default.
-@item input-meta
-@vindex input-meta
-@vindex meta-flag
-If set to @samp{on}, Readline will enable eight-bit input (it
-will not strip the eighth bit from the characters it reads),
-regardless of what the terminal claims it can support. The
-default value is @samp{off}. The name @code{meta-flag} is a
-synonym for this variable.
-
@item output-meta
@vindex output-meta
If set to @samp{on}, Readline will display characters with the
@@ -876,6 +885,11 @@ return @code{EOF}.
Delete the character behind the cursor. A numeric argument means
to kill the characters instead of deleting them.
+@item forward-backward-delete-char ()
+Delete the character under the cursor, unless the cursor is at the
+end of the line, in which case the character behind the cursor is
+deleted. By default, this is not bound to a key.
+
@item quoted-insert (C-q, C-v)
Add the next character typed to the line verbatim. This is
how to insert key sequences like @key{C-q}, for example.
@@ -1039,6 +1053,13 @@ through the list.
This command is intended to be bound to @code{TAB}, but is unbound
by default.
+@item delete-char-or-list ()
+Deletes the character under the cursor if not at the beginning or
+end of the line (like @code{delete-char}).
+If at the end of the line, behaves identically to
+@code{possible-completions}.
+This command is unbound by default.
+
@ifset BashFeatures
@item complete-filename (M-/)
Attempt filename completion on the text before point.
@@ -1141,7 +1162,12 @@ Incremental undo, separately remembered for each line.
Undo all changes made to this line. This is like executing the @code{undo}
command enough times to get back to the beginning.
+@ifset BashFeatures
+@item tilde-expand (M-&)
+@end ifset
+@ifclear BashFeatures
@item tilde-expand (M-~)
+@end ifclear
Perform tilde expansion on the current word.
@item set-mark (C-@@)
diff --git a/readline/doc/texi2dvi b/readline/doc/texi2dvi
index 8fb2f908771..43f652d00f1 100755
--- a/readline/doc/texi2dvi
+++ b/readline/doc/texi2dvi
@@ -1,10 +1,9 @@
#! /bin/sh
# texi2dvi --- smartly produce DVI files from texinfo sources
-
-# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
-
-# $Id: texi2dvi,v 0.5 1995/06/20 02:21:36 friedman Exp $
-
+# $Id: texi2dvi,v 0.8 1998/02/26 21:13:13 karl Exp $
+#
+# Copyright (C) 1992, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
@@ -19,65 +18,73 @@
# along with this program; if not, you can either send email to this
# program's maintainer or write to: The Free Software Foundation,
# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
-
+#
# Commentary:
-
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-
-# Please send bug reports, etc. to bug-texinfo@prep.ai.mit.edu
+#
+# Author: Noah Friedman <friedman@gnu.org>
+#
+# Please send bug reports, etc. to bug-texinfo@gnu.org.
# If possible, please send a copy of the output of the script called with
# the `--debug' option when making a bug report.
-
+#
# In the interest of general portability, some common bourne shell
# constructs were avoided because they weren't guaranteed to be available
# in some earlier implementations. I've tried to make this program as
# portable as possible. Welcome to unix, where the lowest common
# denominator is rapidly diminishing.
#
-# Among the more interesting lossages I noticed with some bourne shells
-# are:
+# Among the more interesting lossages I noticed among Bourne shells:
# * No shell functions.
# * No `unset' builtin.
# * `shift' cannot take a numeric argument, and signals an error if
# there are no arguments to shift.
-
+#
# Code:
# Name by which this script was invoked.
progname=`echo "$0" | sed -e 's/[^\/]*\///g'`
# This string is expanded by rcs automatically when this file is checked out.
-rcs_revision='$Revision: 0.5 $'
+rcs_revision='$Revision: 0.8 $'
version=`set - $rcs_revision; echo $2`
# To prevent hairy quoting and escaping later.
bq='`'
eq="'"
-usage="Usage: $progname {options} [file1] {file2 {...}}
-(version $version)
+usage="Usage: $0 [OPTION]... FILE...
+Run a Texinfo document through TeX.
-Options are:
+Options:
+-b, --batch No interaction (\nonstopmode in TeX).
+-c, --clean Remove all auxiliary files.
-D, --debug Turn on shell debugging ($bq${bq}set -x$eq$eq).
--h, --help You're looking at it.
--v, --version Print version number.
+-t, --texinfo CMD Insert CMD after @setfilename before running TeX.
+--verbose Report on what is done.
+-h, --help Display this help and exit.
+-v, --version Display version information and exit.
-Arguments in brackets are required. Those in braces are optional.
-"
+The values of the TEX, TEXINDEX, and MAKEINFO environment variables are
+used to run those commands, if they are set.
+
+Email bug reports to bug-texinfo@gnu.org."
# Initialize variables.
# Don't use `unset' since old bourne shells don't have this command.
# Instead, assign them an empty value.
-# Some of these, like TEX and TEXINDEX, may be inherited from the environment
-backup_extension=.bak
+# Some of these, like TEX and TEXINDEX, may be inherited from the environment.
+backup_extension=.bak # these files get deleted if all goes well.
+batch=
+clean=
debug=
orig_pwd="`pwd`"
-verbose=
+textra=
+verbose=false
+makeinfo="${MAKEINFO-makeinfo}"
texindex="${TEXINDEX-texindex}"
tex="${TEX-tex}"
-# Save this so we can construct a new TEXINPUTS path for each file to be
-# processed.
+# Save this so we can construct a new TEXINPUTS path for each file.
TEXINPUTS_orig="$TEXINPUTS"
export TEXINPUTS
@@ -86,190 +93,270 @@ export TEXINPUTS
# It's a good idea to document the full long option name in each case.
# Long options which take arguments will need a `*' appended to the
# canonical name to match the value appended after the `=' character.
-while : ; do
- case $# in 0) break ;; esac
+while :; do
+ test $# -eq 0 && break
+
case "$1" in
- -D | --debug | --d* )
- debug=t
- shift
- ;;
- -h | --help | --h* )
- echo "$usage" 1>&2
- exit 0
- ;;
- -v | --version | --v* )
- echo "texi2dvi version $version" 1>&2
- exit 0
- ;;
+ -b | --batch | --b* ) batch=t; shift ;;
+ -c | --clean | --c* ) clean=t; shift ;;
+ -D | --debug | --d* ) debug=t; shift ;;
+ -h | --help | --h* ) echo "$usage"; exit 0 ;;
+ # OK, we should do real option parsing here, but be lazy for now.
+ -t | --texinfo | --t*) shift; textra="$textra $1"; shift ;;
+ -v | --vers* )
+ echo "$progname (GNU Texinfo 3.12) $version"
+ echo "Copyright (C) 1998 Free Software Foundation, Inc.
+There is NO warranty. You may redistribute this software
+under the terms of the GNU General Public License.
+For more information about these matters, see the files named COPYING."
+ exit 0 ;;
+ --verb* ) verbose=echo; shift ;;
-- ) # Stop option processing
shift
- break
- ;;
+ break ;;
-* )
case "$1" in
--*=* ) arg=`echo "$1" | sed -e 's/=.*//'` ;;
* ) arg="$1" ;;
esac
exec 1>&2
- echo "$progname: unknown or ambiguous option $bq$arg$eq"
- echo "$progname: Use $bq--help$eq for a list of options."
- exit 1
- ;;
- * )
- break
- ;;
+ echo "$progname: Unknown or ambiguous option $bq$arg$eq."
+ echo "$progname: Try $bq--help$eq for more information."
+ exit 1 ;;
+ * ) break ;;
esac
done
# See if there are any command line args left (which will be interpreted as
-# filename arguments)
-case $# in
- 0 )
- exec 1>&2
- echo "$progname: at least one file name is required as an argument."
- echo "$progname: Use $bq--help$eq for a description of command syntax."
- exit 2
- ;;
-esac
-
-case "$debug" in t ) set -x ;; esac
+# filename arguments).
+if test $# -eq 0; then
+ exec 1>&2
+ echo "$progname: At least one file name is required as an argument."
+ echo "$progname: Try $bq--help$eq for more information."
+ exit 2
+fi
+
+test "$debug" = t && set -x
# Texify files
-for command_line_filename in ${1+"$@"} ; do
- # Roughly equivalent to `dirname ...`, but more portable
- directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`"
- filename_texi="`basename ${command_line_filename}`"
- # Strip off the last extension part (probably .texinfo or .texi)
- filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`"
-
- # If directory and file are the same, then it's probably because there's
- # no pathname component. Set dirname to `.', the current directory.
- if test "z${directory}" = "z${command_line_filename}" ; then
- directory="."
- fi
-
- # Source file might @include additional texinfo sources. Put `.' and
- # directory where source file(s) reside in TEXINPUTS before anything
- # else. `.' goes first to ensure that any old .aux, .cps, etc. files in
- # ${directory} don't get used in preference to fresher files in `.'.
- TEXINPUTS=".:${directory}:${TEXINPUTS_orig}"
-
- # "Unset" variables that might have values from previous iterations and
- # which won't be completely reset later.
- definite_index_files=""
-
- # See if file exists here. If it doesn't we're in trouble since, even
- # though the user may be able to reenter a valid filename at the tex
- # prompt (assuming they're attending the terminal), this script won't be
- # able to find the right index files and so forth.
- if test ! -r "${command_line_filename}" ; then
- echo "${progname}: ${command_line_filename}: No such file or permission denied." 1>&2
- continue;
- fi
-
- # Find all files having root filename with a two-letter extension,
- # determine whether they're really index files, and save them. Foo.aux
- # is actually the cross-references file, but we need to keep track of
- # that too.
- possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
- for this_file in ${possible_index_files} ; do
+for command_line_filename in ${1+"$@"}; do
+ $verbose "Processing $command_line_filename ..."
+
+ # See if file exists. If it doesn't we're in trouble since, even
+ # though the user may be able to reenter a valid filename at the tex
+ # prompt (assuming they're attending the terminal), this script won't
+ # be able to find the right index files and so forth.
+ if test ! -r "${command_line_filename}"; then
+ echo "$0: Could not read ${command_line_filename}." >&2
+ continue
+ fi
+
+ # Roughly equivalent to `dirname ...`, but more portable
+ directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`"
+ filename_texi="`basename ${command_line_filename}`"
+ # Strip off the last extension part (probably .texinfo or .texi)
+ filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`"
+
+ # Use same basename since we want to generate aux files with the same
+ # basename as the manual. Use extension .texi for the temp file so
+ # that TeX will ignore it. Thus, we must use a subdirectory.
+ #
+ # Output the macro-expanded file to here. The vastly abbreviated
+ # temporary directory name is so we don't have collisions on 8.3 or
+ # 14-character filesystems.
+ tmp_dir=${TMPDIR-/tmp}/txi2d.$$
+ filename_tmp=$tmp_dir/$filename_noext.texi
+ # Output the file with the user's extra commands to here.
+ tmp_dir2=${tmp_dir}.2
+ filename_tmp2=$tmp_dir2/$filename_noext.texi
+ mkdir $tmp_dir $tmp_dir2
+ # Always remove the temporary directories.
+ trap "rm -rf $tmp_dir $tmp_dir2" 1 2 15
+
+ # If directory and file are the same, then it's probably because there's
+ # no pathname component. Set dirname to `.', the current directory.
+ if test "z${directory}" = "z${command_line_filename}"; then
+ directory=.
+ fi
+
+ # Source file might @include additional texinfo sources. Put `.' and
+ # directory where source file(s) reside in TEXINPUTS before anything
+ # else. `.' goes first to ensure that any old .aux, .cps, etc. files in
+ # ${directory} don't get used in preference to fresher files in `.'.
+ TEXINPUTS=".:${directory}:${TEXINPUTS_orig}"
+
+ # Expand macro commands in the original source file using Makeinfo;
+ # the macro syntax bfox implemented is impossible to implement in TeX.
+ # Always use `end' footnote style, since the `separate' style
+ # generates different output (arguably this is a bug in -E).
+ # Discard main info output, the user asked to run TeX, not makeinfo.
+ # Redirect output to /dev/null to throw away `Making info file...' msg.
+ $verbose "Macro-expanding $command_line_filename to $filename_tmp ..."
+ $makeinfo --footnote-style=end -E $filename_tmp -o /dev/null \
+ $command_line_filename >/dev/null
+
+ # But if there were no macros, or makeinfo failed for some reason,
+ # just use the original file. (It shouldn't make any difference, but
+ # let's be safe.)
+ if test $? -ne 0 || cmp -s $filename_tmp $command_line_filename; then
+ $verbose "Reverting to $command_line_filename ..."
+ cp -p $command_line_filename $filename_tmp
+ fi
+ filename_input=$filename_tmp
+ dirname_input=$tmp_dir
+
+ # Used most commonly for @finalout, @smallbook, etc.
+ if test -n "$textra"; then
+ $verbose "Inserting extra commands: $textra."
+ sed '/^@setfilename/a\
+'"$textra" $filename_input >$filename_tmp2
+ filename_input=$filename_tmp2
+ dirname_input=$tmp_dir2
+ fi
+
+ # If clean mode was specified, then move to the temporary directory.
+ if test "$clean" = t; then
+ $verbose "cd $dirname_input"
+ cd $dirname_input || exit 1
+ filename_input=`basename $filename_input`
+ fi
+
+ while true; do # will break out of loop below
+ # "Unset" variables that might have values from previous iterations and
+ # which won't be completely reset later.
+ definite_index_files=
+
+ # Find all files having root filename with a two-letter extension,
+ # determine whether they're really index files, and save them. Foo.aux
+ # is actually the cross-references file, but we need to keep track of
+ # that too.
+ possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
+ for this_file in ${possible_index_files}; do
# If file is empty, forget it.
- if test ! -s "${this_file}" ; then
- continue;
- fi
+ test -s "${this_file}" || continue
- # Examine first character of file. If it's not a backslash or
- # single quote, then it's definitely not an index or xref file.
+ # Examine first character of file. If it's not suitable to be an
+ # index or xref file, don't process it.
first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
- if test "${first_character}" = "\\" -o "${first_character}" = "'" ; then
- definite_index_files="${definite_index_files} ${this_file}"
+ if test "x${first_character}" = "x\\" \
+ || test "x${first_character}" = "x'"; then
+ definite_index_files="${definite_index_files} ${this_file}"
fi
- done
- orig_index_files="${definite_index_files}"
- orig_index_files_sans_aux="`echo ${definite_index_files} \
- | sed 's/'${filename_noext}'\.aux//;
- s/^[ ]*//;s/[ ]*$//;'`"
-
- # Now save copies of original index files so we have some means of
- # comparison later.
- for index_file_to_save in ${orig_index_files} ; do
- cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
- done
-
- # Run texindex on current index files. If they already exist, and
- # after running TeX a first time the index files don't change, then
- # there's no reason to run TeX again. But we won't know that if the
- # index files are out of date or nonexistent.
- if test "${orig_index_files_sans_aux}" ; then
+ done
+ orig_index_files="${definite_index_files}"
+ orig_index_files_sans_aux="`echo ${definite_index_files} \
+ | sed 's/'${filename_noext}'\.aux//;
+ s/^[ ]*//;s/[ ]*$//;'`"
+
+ # Now save copies of original index files so we have some means of
+ # comparison later.
+ $verbose "Backing up current index files: $orig_index_files ..."
+ for index_file_to_save in ${orig_index_files}; do
+ cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
+ done
+
+ # Run texindex on current index files. If they already exist, and
+ # after running TeX a first time the index files don't change, then
+ # there's no reason to run TeX again. But we won't know that if the
+ # index files are out of date or nonexistent.
+ if test -n "${orig_index_files_sans_aux}"; then
+ $verbose "Running $texindex $orig_index_files_sans_aux ..."
${texindex} ${orig_index_files_sans_aux}
- fi
-
- if ${tex} ${command_line_filename} ; then # TeX run first time
- definite_index_files=""
- # Get list of new index files
- possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
- for this_file in ${possible_index_files} ; do
- # If file is empty, forget it.
- if test ! -s ${this_file} ; then
- continue;
- fi
-
- # Examine first character of file. If it's not a backslash or
- # single quote, then it's definitely not an index or xref file.
- first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
- if test "${first_character}" = "\\" -o "${first_character}" = "'" ; then
- definite_index_files="${definite_index_files} ${this_file}"
- fi
+ fi
+
+ # Finally, run TeX.
+ if test "$batch" = t; then
+ tex_mode='\nonstopmode'
+ else
+ tex_mode=
+ fi
+ $verbose "Running $tex $filename_input ..."
+ cmd="$tex $tex_mode \\input $filename_input"
+ $cmd
+
+ # Check if index files changed.
+ #
+ definite_index_files=
+ # Get list of new index files.
+ possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
+ for this_file in ${possible_index_files}; do
+ # If file is empty, forget it.
+ test -s "${this_file}" || continue
+
+ # Examine first character of file. If it's not a backslash or
+ # single quote, then it's definitely not an index or xref file.
+ # (Will have to check for @ when we switch to Texinfo syntax in
+ # all these files...)
+ first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
+ if test "x${first_character}" = "x\\" \
+ || test "x${first_character}" = "x'"; then
+ definite_index_files="${definite_index_files} ${this_file}"
+ fi
+ done
+ new_index_files="${definite_index_files}"
+ new_index_files_sans_aux="`echo ${definite_index_files} \
+ | sed 's/'${filename_noext}'\.aux//;
+ s/^[ ]*//;s/[ ]*$//;'`"
+
+ # If old and new list don't at least have the same file list, then one
+ # file or another has definitely changed.
+ $verbose "Original index files =$orig_index_files"
+ $verbose "New index files =$new_index_files"
+ if test "z${orig_index_files}" != "z${new_index_files}"; then
+ index_files_changed_p=t
+ else
+ # File list is the same. We must compare each file until we find a
+ # difference.
+ index_files_changed_p=
+ for this_file in ${new_index_files}; do
+ $verbose "Comparing index file $this_file ..."
+ # cmp -s will return nonzero exit status if files differ.
+ cmp -s "${this_file}" "${this_file}${backup_extension}"
+ if test $? -ne 0; then
+ # We only need to keep comparing until we find *one* that
+ # differs, because we'll have to run texindex & tex no
+ # matter what.
+ index_files_changed_p=t
+ $verbose "Index file $this_file differed:"
+ test $verbose = echo \
+ && diff -c "${this_file}${backup_extension}" "${this_file}"
+ break
+ fi
done
- new_index_files="${definite_index_files}"
- new_index_files_sans_aux="`echo ${definite_index_files} \
- | sed 's/'${filename_noext}'\.aux//;
- s/^[ ]*//;s/[ ]*$//;'`"
-
- # If old and new list don't at least have the same file list, then one
- # file or another has definitely changed.
- if test "${orig_index_files}" != "${new_index_files}" ; then
- index_files_changed_p=t
- else
- # File list is the same. We must compare each file until we find a
- # difference.
- index_files_changed_p=""
- for this_file in ${new_index_files} ; do
- # cmp -s will return nonzero exit status if files differ.
- cmp -s "${this_file}" "${this_file}${backup_extension}"
- if test $? -ne 0 ; then
- # We only need to keep comparing until we find *one* that
- # differs, because we'll have to run texindex & tex no
- # matter what.
- index_files_changed_p=t
- break
- fi
- done
- fi
+ fi
- # If index files have changed since TeX has been run, or if the aux
- # file wasn't present originally, run texindex and TeX again.
- if test "${index_files_changed_p}" ; then
- retval=0
- if test "${new_index_files_sans_aux}" ; then
- ${texindex} ${new_index_files_sans_aux}
- retval=$?
- fi
- if test ${retval} -eq 0 ; then
- ${tex} "${command_line_filename}"
- fi
- fi
- fi
-
- # Generate list of files to delete, then call rm once with the entire
- # list. This is significantly faster than multiple executions of rm.
- file_list=""
- for file in ${orig_index_files} ; do
- file_list="${file_list} ${file}${backup_extension}"
- done
- if test "${file_list}" ; then
- rm -f ${file_list}
- fi
+ # If index files have changed since TeX has been run, or if the aux
+ # file wasn't present originally, run texindex and TeX again.
+ if test "${index_files_changed_p}"; then :; else
+ # Nothing changed. We're done with TeX.
+ break
+ fi
+ done
+
+ # If we were in clean mode, compilation was in a tmp directory.
+ # Copy the DVI file into the directory where the compilation
+ # has been done. (The temp dir is about to get removed anyway.)
+ # We also return to the original directory so that
+ # - the next file is processed in correct conditions
+ # - the temporary file can be removed
+ if test -n "$clean"; then
+ $verbose "Copying DVI file from `pwd` to $orig_pwd"
+ cp -p $filename_noext.dvi $orig_pwd
+ cd $orig_pwd || exit 1
+ fi
+
+ # Generate list of files to delete, then call rm once with the entire
+ # list. This is significantly faster than multiple executions of rm.
+ file_list=
+ for file in ${orig_index_files}; do
+ file_list="${file_list} ${file}${backup_extension}"
+ done
+ if test -n "${file_list}"; then
+ $verbose "Removing $file_list $tmp_dir $tmp_dir2 ..."
+ rm -f ${file_list}
+ rm -rf $tmp_dir $tmp_dir2
+ fi
done
-# texi2dvi ends here
+$verbose "$0 done."
+true # exit successfully.
diff --git a/readline/doc/texi2html b/readline/doc/texi2html
index cc751785493..4beec01b341 100755
--- a/readline/doc/texi2html
+++ b/readline/doc/texi2html
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/local/bin/perl
'di ';
'ig 00 ';
#+##############################################################################
@@ -9,7 +9,7 @@
# #
#-##############################################################################
-# @(#)texi2html 1.51 09/10/96 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch
+# @(#)texi2html 1.52 01/05/98 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch
# The man page for this program is included at the end of this file and can be
# viewed using the command 'nroff -man texi2html'.
@@ -29,7 +29,7 @@ $DEBUG_DEF = 16;
$DEBUG_HTML = 32;
$DEBUG_USER = 64;
-$BIBRE = '\[[\w\/]+\]'; # RE for a bibliography reference
+$BIBRE = '\[[\w\/-]+\]'; # RE for a bibliography reference
$FILERE = '[\/\w.+-]+'; # RE for a file name
$VARRE = '[^\s\{\}]+'; # RE for a variable name
$NODERE = '[^@{}:\'`",]+'; # RE for a node name
@@ -37,8 +37,8 @@ $NODESRE = '[^@{}:\'`"]+'; # RE for a list of node names
$XREFRE = '[^@{}]+'; # RE for a xref (should use NODERE)
$ERROR = "***"; # prefix for errors and warnings
-$THISPROG = "texi2html 1.51"; # program name and version
-$HOMEPAGE = "http://wwwcn.cern.ch/dci/texi2html/"; # program home page
+$THISPROG = "texi2html 1.52"; # program name and version
+$HOMEPAGE = "http://wwwinfo.cern.ch/dis/texi2html/"; # program home page
$TODAY = &pretty_date; # like "20 September 1993"
$SPLITTAG = "<!-- SPLIT HERE -->\n"; # tag to know where to split
$PROTECTTAG = "_ThisIsProtected_"; # tag to recognize protected sections
@@ -129,6 +129,7 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
"!", "!",
"?", "?",
".", ".",
+ "-", "",
);
#
@@ -159,19 +160,23 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
'cite', 'CITE',
'code', 'CODE',
'ctrl', '&do_ctrl', # special case
- 'dfn', 'STRONG', # DFN tag is illegal in the standard
+ 'dfn', 'EM', # DFN tag is illegal in the standard
'dmn', '', # useless
+ 'email', '&do_email', # insert a clickable email address
'emph', 'EM',
'file', '"TT', # will put quotes, cf. &apply_style
'i', 'I',
'kbd', 'KBD',
'key', 'KBD',
+ 'math', 'EM',
'r', '', # unsupported
'samp', '"SAMP', # will put quotes, cf. &apply_style
'sc', '&do_sc', # special case
'strong', 'STRONG',
't', 'TT',
'titlefont', '', # useless
+ 'uref', '&do_uref', # insert a clickable URL
+ 'url', '&do_url', # insert a clickable URL
'var', 'VAR',
'w', '', # unsupported
);
@@ -270,6 +275,7 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
'smallbook', 1,
'vskip', 1,
'filbreak', 1,
+ 'paragraphindent', 1,
# unsupported formats
'cartouche', 1,
'end cartouche', 1,
@@ -283,6 +289,8 @@ $html2_doctype = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//E
# #
#---############################################################################
+%value = (); # hold texinfo variables, see also -D
+
$use_bibliography = 1;
$use_acc = 0;
$debug = 0;
@@ -306,6 +314,7 @@ To convert a Texinfo file to HMTL: $0 [options] file
-expandinfo : use \@ifinfo sections, not \@iftex
-glossary : handle a glossary
-invisible name: use 'name' as an invisible anchor
+ -Dname : define name like with \@set
-I dir : search also for files in 'dir'
-menu : handle menus
-monolithic : output only one file including ToC
@@ -317,7 +326,7 @@ To convert a Texinfo file to HMTL: $0 [options] file
To check converted files: $0 -check [-verbose] files
EOT
-while ($#ARGV >= 0 && $ARGV[0] =~ /^-/) {
+while (@ARGV && $ARGV[0] =~ /^-/) {
$_ = shift(@ARGV);
if (/^-acc$/) { $use_acc = 1; next; }
if (/^-d(ebug)?(\d+)?$/) { $debug = $2 || shift(@ARGV); next; }
@@ -327,6 +336,7 @@ while ($#ARGV >= 0 && $ARGV[0] =~ /^-/) {
if (/^-g(lossary)?$/) { $use_glossary = 1; next; }
if (/^-i(nvisible)?$/) { $invisible_mark = shift(@ARGV); next; }
if (/^-iso$/) { $use_iso = 1; next; }
+ if (/^-D(.+)?$/) { $value{$1 || shift(@ARGV)} = 1; next; }
if (/^-I(.+)?$/) { push(@include_dirs, $1 || shift(@ARGV)); next; }
if (/^-m(enu)?$/) { $show_menu = 1; next; }
if (/^-mono(lithic)?$/) { $monolithic = 1; next; }
@@ -383,9 +393,8 @@ if ($monolithic) {
#
# variables
#
-%value = (); # hold texinfo variables
$value{'html'} = 1; # predefine html (the output format)
-$value{'texi2html'} = '1.51'; # predefine texi2html (the translator)
+$value{'texi2html'} = '1.52'; # predefine texi2html (the translator)
# _foo: internal to track @foo
foreach ('_author', '_title', '_subtitle',
'_settitle', '_setfilename') {
@@ -453,7 +462,7 @@ $toplevel = 0; # top level seen in hierarchy
$curlevel = 0; # current level in TOC
$node = ''; # current node name
$in_table = 0; # am I inside a table
-$table_type = ''; # type of table ('', 'f', 'v')
+$table_type = ''; # type of table ('', 'f', 'v', 'multi')
@tables = (); # nested table support
$in_bibliography = 0; # am I inside a bibliography
$in_glossary = 0; # am I inside a glossary
@@ -554,9 +563,11 @@ while ($_ = &next_line) {
#
s/((^|[^\@])(\@\@)*)\@c(omment)? .*/$1/;
# non-@ substitutions cf. texinfmt.el
- s/``/\"/g;
- s/''/\"/g;
- s/([\w ])---([\w ])/$1--$2/g;
+ unless ($in_pre) {
+ s/``/\"/g;
+ s/''/\"/g;
+ s/([\w ])---([\w ])/$1--$2/g;
+ }
#
# analyze the tag
#
@@ -570,14 +581,9 @@ while ($_ = &next_line) {
}
&skip_until($tag), next if $tag eq 'tex';
# handle special tables
- if ($tag eq 'table') {
- $table_type = '';
- } elsif ($tag eq 'ftable') {
+ if ($tag =~ /^(|f|v|multi)table$/) {
+ $table_type = $1;
$tag = 'table';
- $table_type = 'f';
- } elsif ($tag eq 'vtable') {
- $tag = 'table';
- $table_type = 'v';
}
# special cases
if ($tag eq 'top' || ($tag eq 'node' && /^\@node\s+top\s*,/i)) {
@@ -647,11 +653,16 @@ while ($_ = &next_line) {
push(@lines, &debug("<$format_map{$tag}>\n", __LINE__));
next;
} elsif ($tag eq 'table') {
- if (/^\@[fv]?table\s+\@(\w+)\s*$/) {
- $in_table = $1;
+ if (/^\@(|f|v|multi)table\s+\@(\w+)/) {
+ $in_table = $2;
unshift(@tables, join($;, $table_type, $in_table));
- push(@lines, &debug("<DL COMPACT>\n", __LINE__));
- &html_push_if('DL');
+ if ($table_type eq "multi") {
+ push(@lines, &debug("<TABLE BORDER>\n", __LINE__));
+ &html_push_if('TABLE');
+ } else {
+ push(@lines, &debug("<DL COMPACT>\n", __LINE__));
+ &html_push_if('DL');
+ }
push(@lines, &html_debug("\n", __LINE__));
} else {
warn "$ERROR Bad table line: $_";
@@ -776,18 +787,29 @@ while ($_ = &next_line) {
&html_pop_if();
push(@lines, &debug("</$format_map{$end_tag}>\n", __LINE__));
push(@lines, &html_debug("\n", __LINE__));
- } elsif ($end_tag eq 'table' ||
- $end_tag eq 'ftable' ||
- $end_tag eq 'vtable') {
- shift(@tables);
+ } elsif ($end_tag =~ /^(|f|v|multi)table$/) {
+ unless (@tables) {
+ warn "$ERROR \@end $end_tag without \@*table\n";
+ next;
+ }
+ ($table_type, $in_table) = split($;, shift(@tables));
+ unless ($1 eq $table_type) {
+ warn "$ERROR \@end $end_tag without matching \@$end_tag\n";
+ next;
+ }
+ if ($table_type eq "multi") {
+ push(@lines, "</TR></TABLE>\n");
+ &html_pop_if('TR');
+ } else {
+ push(@lines, "</DL>\n");
+ &html_pop_if('DD');
+ }
+ &html_pop_if();
if (@tables) {
($table_type, $in_table) = split($;, $tables[0]);
} else {
$in_table = 0;
}
- push(@lines, "</DL>\n");
- &html_pop_if('DD');
- &html_pop_if();
} elsif (defined($def_map{$end_tag})) {
push(@lines, &debug("</DL>\n", __LINE__));
} elsif ($end_tag eq 'menu') {
@@ -986,6 +1008,12 @@ EOC
if ($table_type) { # add also an index
unshift(@input_spool, "\@${table_type}index $what\n");
}
+ } elsif ($html_element eq 'TABLE') {
+ push(@lines, &debug("<TR><TD>$what</TD>\n", __LINE__));
+ &html_push('TR');
+ } elsif ($html_element eq 'TR') {
+ push(@lines, &debug("</TR>\n", __LINE__));
+ push(@lines, &debug("<TR><TD>$what</TD>\n", __LINE__));
} else {
push(@lines, &debug("<LI>$what\n", __LINE__));
&html_push('LI') unless $html_element eq 'LI';
@@ -996,6 +1024,9 @@ EOC
$deferred_ref = '';
}
next;
+ } elsif (/^\@tab\s+(.*)$/) {
+ push(@lines, "<TD>$1</TD>\n");
+ next;
}
}
}
@@ -1088,13 +1119,25 @@ while (@lines) {
print "# index $key sorted as $_\n"
if $key ne $_ && $debug & $DEBUG_INDEX;
}
+ push(@lines2, "Jump to:\n");
+ $last_letter = undef;
+ foreach $key (sort byalpha @keys) {
+ $letter = substr($key2alpha{$key}, 0, 1);
+ $letter = substr($key2alpha{$key}, 0, 2) if $letter eq $;;
+ if (!defined($last_letter) || $letter ne $last_letter) {
+ push(@lines2, "-\n") if defined($last_letter);
+ push(@lines2, "<A HREF=\"#$index\_$letter\">" . &protect_html($letter) . "</A>\n");
+ $last_letter = $letter;
+ }
+ }
+ push(@lines2, "<P>\n");
$last_letter = undef;
foreach $key (sort byalpha @keys) {
$letter = substr($key2alpha{$key}, 0, 1);
$letter = substr($key2alpha{$key}, 0, 2) if $letter eq $;;
if (!defined($last_letter) || $letter ne $last_letter) {
push(@lines2, "</DIR>\n") if defined($last_letter);
- push(@lines2, "<H2>" . &protect_html($letter) . "</H2>\n");
+ push(@lines2, "<H2><A NAME=\"$index\_$letter\">" . &protect_html($letter) . "</A></H2>\n");
push(@lines2, "<DIR>\n");
$last_letter = $letter;
}
@@ -1657,8 +1700,24 @@ sub menu_entry {
sub do_ctrl { "^$_[0]" }
+sub do_email {
+ local($addr, $text) = split(/,\s*/, $_[0]);
+
+ $text = $addr unless $text;
+ &anchor('', "mailto:$addr", $text);
+}
+
sub do_sc { "\U$_[0]\E" }
+sub do_uref {
+ local($url, $text) = split(/,\s*/, $_[0]);
+
+ $text = $url unless $text;
+ &anchor('', $url, $text);
+}
+
+sub do_url { &anchor('', $_[0], $_[0]) }
+
sub apply_style {
local($texi_style, $text) = @_;
local($style);
@@ -1822,7 +1881,7 @@ sub print_toplevel_footer {
print FILE <<EOT;
This document was generated on $TODAY using the
<A HREF=\"$HOMEPAGE\">texi2html</A>
-translator version 1.51.</P>
+translator version 1.52.</P>
EOT
&print_footer;
}
@@ -1879,7 +1938,7 @@ sub byalpha {
.nr nl 0-1 \" fake up transition to first page again
.nr % 0 \" start at page 1
'; __END__ ############# From here on it's a standard manual page ############
-.TH TEXI2HTML 1 "09/10/96"
+.TH TEXI2HTML 1 "01/05/98"
.AT 3
.SH NAME
texi2html \- a Texinfo to HTML converter
@@ -1924,8 +1983,9 @@ Use the section named 'Glossary' to build a list of terms and put links in the H
document from each term toward its definition.
.TP
.B \-invisible \fIname\fP
-Use \fIname\fP to create invisible destination anchors for index links. This is a workaround
-for a known bug of many WWW browsers, including xmosaic.
+Use \fIname\fP to create invisible destination anchors for index links
+(you can for instance use the invisible.xbm file shipped with this program).
+This is a workaround for a known bug of many WWW browsers, including netscape.
.TP
.B \-I \fIdir\fP
Look also in \fIdir\fP to find included files.
@@ -1985,21 +2045,21 @@ option, it creates only one file:
predefines the following variables: \fBhtml\fP, \fBtexi2html\fP.
.SH ADDITIONAL COMMANDS
.I texi2html
-implements the following non-Texinfo commands:
+implements the following non-Texinfo commands (maybe they are in Texinfo now...):
.TP 16
.B @ifhtml
This indicates the start of an HTML section, this section will passed through
-without any modofication.
+without any modification.
.TP
.B @end ifhtml
-This indcates the end of an HTML section.
+This indicates the end of an HTML section.
.SH VERSION
-This is \fItexi2html\fP version 1.51, 09/10/96.
+This is \fItexi2html\fP version 1.52, 01/05/98.
.PP
The latest version of \fItexi2html\fP can be found in WWW, cf. URL
-http://wwwcn.cern.ch/dci/texi2html/
+http://wwwinfo.cern.ch/dis/texi2html/
.SH AUTHOR
-The main author is Lionel Cons, CERN CN/DCI/UWS, Lionel.Cons@cern.ch.
+The main author is Lionel Cons, CERN IT/DIS/OSE, Lionel.Cons@cern.ch.
Many other people around the net contributed to this program.
.SH COPYRIGHT
This program is the intellectual property of the European
diff --git a/readline/examples/Makefile.in b/readline/examples/Makefile.in
index 18486736ec9..879aa49555b 100644
--- a/readline/examples/Makefile.in
+++ b/readline/examples/Makefile.in
@@ -1,6 +1,6 @@
# This is the Makefile for the examples subdirectory of readline. -*- text -*-
#
-SHELL = /bin/sh
+SHELL = @MAKE_SHELL@
RM = rm -f
srcdir = @srcdir@
@@ -14,7 +14,7 @@ CFLAGS = @CFLAGS@
LOCAL_CFLAGS = @LOCAL_CFLAGS@
CPPFLAGS = @CPPFLAGS@
-INCLUDES = -I $(srcdir) -I $(top_srcdir) -I..
+INCLUDES = -I$(srcdir) -I$(top_srcdir) -I..
CCFLAGS = $(DEFS) $(LOCAL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(CFLAGS)
LDFLAGS = -g -L..
@@ -22,10 +22,11 @@ LDFLAGS = -g -L..
TERMCAP_LIB = @TERMCAP_LIB@
.c.o:
+ ${RM} $@
$(CC) $(CCFLAGS) -c $<
-EXECUTABLES = fileman rltest rl
-OBJECTS = fileman.o rltest.o rl.o
+EXECUTABLES = fileman rltest rl rlversion
+OBJECTS = fileman.o rltest.o rl.o rlversion.o
all: $(EXECUTABLES)
@@ -38,6 +39,9 @@ fileman: fileman.o
rltest: rltest.o
$(CC) $(LDFLAGS) -o $@ rltest.o -lreadline $(TERMCAP_LIB)
+rlversion: rlversion.o
+ $(CC) $(LDFLAGS) -o $@ rlversion.o -lreadline $(TERMCAP_LIB)
+
clean mostlyclean:
$(RM) $(OBJECTS)
$(RM) $(EXECUTABLES)
@@ -48,3 +52,4 @@ distclean maintainer-clean: clean
fileman.o: fileman.c
rltest.o: rltest.c
rl.o: rl.c
+rlversion.o: rlversion.c
diff --git a/readline/examples/rl.c b/readline/examples/rl.c
index ccddd0fb752..17a63434f24 100644
--- a/readline/examples/rl.c
+++ b/readline/examples/rl.c
@@ -42,6 +42,7 @@ set_deftext ()
}
}
+static void
usage()
{
fprintf (stderr, "%s: usage: %s [-p prompt] [-u unit] [-d default]\n",
@@ -54,7 +55,7 @@ main (argc, argv)
{
char *temp, *prompt;
struct stat sb;
- int done, opt, fd;
+ int opt, fd;
FILE *ifp;
progname = strrchr(argv[0], '/');
diff --git a/readline/funmap.c b/readline/funmap.c
index 3946e0fc26e..f6b86286fe0 100644
--- a/readline/funmap.c
+++ b/readline/funmap.c
@@ -71,6 +71,7 @@ static FUNMAP default_funmap[] = {
{ "copy-forward-word", rl_copy_forward_word },
{ "copy-region-as-kill", rl_copy_region_to_kill },
{ "delete-char", rl_delete },
+ { "delete-char-or-list", rl_delete_or_show_completions },
{ "delete-horizontal-space", rl_delete_horizontal_space },
{ "digit-argument", rl_digit_argument },
{ "do-lowercase-version", rl_do_lowercase_version },
@@ -83,6 +84,7 @@ static FUNMAP default_funmap[] = {
{ "end-of-history", rl_end_of_history },
{ "end-of-line", rl_end_of_line },
{ "exchange-point-and-mark", rl_exchange_point_and_mark },
+ { "forward-backward-delete-char", rl_rubout_or_delete },
{ "forward-char", rl_forward },
{ "forward-search-history", rl_forward_search_history },
{ "forward-word", rl_forward_word },
diff --git a/readline/histexpand.c b/readline/histexpand.c
index 0dc179ac7f6..392e6d38d9e 100644
--- a/readline/histexpand.c
+++ b/readline/histexpand.c
@@ -365,6 +365,10 @@ hist_error(s, start, current, errtype)
emsg = "unrecognized history modifier";
elen = 29;
break;
+ case NO_PREV_SUBST:
+ emsg = "no previous substitution";
+ elen = 24;
+ break;
default:
emsg = "unknown expansion error";
elen = 23;
@@ -654,15 +658,6 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line)
}
}
- /* If there is no lhs, the substitution can't succeed. */
- if (subst_lhs_len == 0)
- {
- *ret_string = hist_error (string, starting_index, i, SUBST_FAILED);
- free (result);
- free (temp);
- return -1;
- }
-
FREE (subst_rhs);
subst_rhs = get_subst_pattern (string, &i, delimiter, 1, &subst_rhs_len);
@@ -674,6 +669,15 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line)
else
i += 2;
+ /* If there is no lhs, the substitution can't succeed. */
+ if (subst_lhs_len == 0)
+ {
+ *ret_string = hist_error (string, starting_index, i, NO_PREV_SUBST);
+ free (result);
+ free (temp);
+ return -1;
+ }
+
l_temp = strlen (temp);
/* Ignore impossible cases. */
if (subst_lhs_len > l_temp)
diff --git a/readline/histfile.c b/readline/histfile.c
index 81dda57d0fe..3325b7fc1f7 100644
--- a/readline/histfile.c
+++ b/readline/histfile.c
@@ -155,7 +155,11 @@ read_history_range (filename, from, to)
}
buffer = xmalloc (file_size + 1);
+#if 0
if (read (file, buffer, file_size) != file_size)
+#else
+ if (read (file, buffer, file_size) < 0)
+#endif
{
error_and_exit:
if (file >= 0)
@@ -217,7 +221,7 @@ read_history_range (filename, from, to)
int
history_truncate_file (fname, lines)
char *fname;
- register int lines;
+ int lines;
{
register int i;
int file, chars_read;
@@ -276,6 +280,12 @@ history_truncate_file (fname, lines)
if (i && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1))
{
write (file, buffer + i, file_size - i);
+
+#if defined (__BEOS__)
+ /* BeOS ignores O_TRUNC. */
+ ftruncate (file, file_size - i);
+#endif
+
close (file);
}
diff --git a/readline/histlib.h b/readline/histlib.h
index 10a40d7919b..422cf5974db 100644
--- a/readline/histlib.h
+++ b/readline/histlib.h
@@ -69,6 +69,7 @@ extern char *strchr ();
#define BAD_WORD_SPEC 1
#define SUBST_FAILED 2
#define BAD_MODIFIER 3
+#define NO_PREV_SUBST 4
/* Possible definitions for history starting point specification. */
#define ANCHORED_SEARCH 1
diff --git a/readline/history.c b/readline/history.c
index 24c5a49c359..d56ffacc6a0 100644
--- a/readline/history.c
+++ b/readline/history.c
@@ -278,7 +278,7 @@ HIST_ENTRY *
replace_history_entry (which, line, data)
int which;
char *line;
- char *data;
+ histdata_t data;
{
HIST_ENTRY *temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY));
HIST_ENTRY *old_value;
diff --git a/readline/history.h b/readline/history.h
index e49a341492f..8ecce726779 100644
--- a/readline/history.h
+++ b/readline/history.h
@@ -22,6 +22,16 @@
#ifndef _HISTORY_H_
#define _HISTORY_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined READLINE_LIBRARY
+# include "rlstdc.h"
+#else
+# include <readline/rlstdc.h>
+#endif
+
#if !defined (_FUNCTION_DEF)
# define _FUNCTION_DEF
typedef int Function ();
@@ -30,10 +40,16 @@ typedef char *CPFunction ();
typedef char **CPPFunction ();
#endif
+#ifdef __STDC__
+typedef void *histdata_t;
+#else
+typedef char *histdata_t;
+#endif
+
/* The structure used to store a history entry. */
typedef struct _hist_entry {
char *line;
- char *data;
+ histdata_t data;
} HIST_ENTRY;
/* A structure used to pass the current state of the history stuff around. */
@@ -52,81 +68,81 @@ typedef struct _hist_state {
/* Begin a session in which the history functions might be used. This
just initializes the interactive variables. */
-extern void using_history ();
+extern void using_history __P((void));
/* Return the current HISTORY_STATE of the history. */
-extern HISTORY_STATE *history_get_history_state ();
+extern HISTORY_STATE *history_get_history_state __P((void));
/* Set the state of the current history array to STATE. */
-extern void history_set_history_state ();
+extern void history_set_history_state __P((HISTORY_STATE *));
/* Manage the history list. */
/* Place STRING at the end of the history list.
The associated data field (if any) is set to NULL. */
-extern void add_history ();
+extern void add_history __P((char *));
/* A reasonably useless function, only here for completeness. WHICH
is the magic number that tells us which element to delete. The
elements are numbered from 0. */
-extern HIST_ENTRY *remove_history ();
+extern HIST_ENTRY *remove_history __P((int));
/* Make the history entry at WHICH have LINE and DATA. This returns
the old entry so you can dispose of the data. In the case of an
invalid WHICH, a NULL pointer is returned. */
-extern HIST_ENTRY *replace_history_entry ();
+extern HIST_ENTRY *replace_history_entry __P((int, char *, histdata_t));
/* Clear the history list and start over. */
-extern void clear_history ();
+extern void clear_history __P((void));
/* Stifle the history list, remembering only MAX number of entries. */
-extern void stifle_history ();
+extern void stifle_history __P((int));
/* Stop stifling the history. This returns the previous amount the
history was stifled by. The value is positive if the history was
stifled, negative if it wasn't. */
-extern int unstifle_history ();
+extern int unstifle_history __P((void));
/* Return 1 if the history is stifled, 0 if it is not. */
-extern int history_is_stifled ();
+extern int history_is_stifled __P((void));
/* Information about the history list. */
/* Return a NULL terminated array of HIST_ENTRY which is the current input
history. Element 0 of this list is the beginning of time. If there
is no history, return NULL. */
-extern HIST_ENTRY **history_list ();
+extern HIST_ENTRY **history_list __P((void));
/* Returns the number which says what history element we are now
looking at. */
-extern int where_history ();
+extern int where_history __P((void));
/* Return the history entry at the current position, as determined by
history_offset. If there is no entry there, return a NULL pointer. */
-HIST_ENTRY *current_history ();
+HIST_ENTRY *current_history __P((void));
/* Return the history entry which is logically at OFFSET in the history
array. OFFSET is relative to history_base. */
-extern HIST_ENTRY *history_get ();
+extern HIST_ENTRY *history_get __P((int));
/* Return the number of bytes that the primary history entries are using.
This just adds up the lengths of the_history->lines. */
-extern int history_total_bytes ();
+extern int history_total_bytes __P((void));
/* Moving around the history list. */
/* Set the position in the history list to POS. */
-int history_set_pos ();
+int history_set_pos __P((int));
/* Back up history_offset to the previous history entry, and return
a pointer to that entry. If there is no previous entry, return
a NULL pointer. */
-extern HIST_ENTRY *previous_history ();
+extern HIST_ENTRY *previous_history __P((void));
/* Move history_offset forward to the next item in the input_history,
and return the a pointer to that entry. If there is no next entry,
return a NULL pointer. */
-extern HIST_ENTRY *next_history ();
+extern HIST_ENTRY *next_history __P((void));
/* Searching the history list. */
@@ -136,44 +152,45 @@ extern HIST_ENTRY *next_history ();
current_history () is the history entry, and the value of this function
is the offset in the line of that history entry that the string was
found in. Otherwise, nothing is changed, and a -1 is returned. */
-extern int history_search ();
+extern int history_search __P((char *, int));
/* Search the history for STRING, starting at history_offset.
- The search is anchored: matching lines must begin with string. */
-extern int history_search_prefix ();
+ The search is anchored: matching lines must begin with string.
+ DIRECTION is as in history_search(). */
+extern int history_search_prefix __P((char *, int));
/* Search for STRING in the history list, starting at POS, an
absolute index into the list. DIR, if negative, says to search
backwards from POS, else forwards.
Returns the absolute index of the history element where STRING
was found, or -1 otherwise. */
-extern int history_search_pos ();
+extern int history_search_pos __P((char *, int, int));
/* Managing the history file. */
/* Add the contents of FILENAME to the history list, a line at a time.
If FILENAME is NULL, then read from ~/.history. Returns 0 if
successful, or errno if not. */
-extern int read_history ();
+extern int read_history __P((char *));
/* Read a range of lines from FILENAME, adding them to the history list.
Start reading at the FROM'th line and end at the TO'th. If FROM
is zero, start at the beginning. If TO is less than FROM, read
until the end of the file. If FILENAME is NULL, then read from
~/.history. Returns 0 if successful, or errno if not. */
-extern int read_history_range ();
+extern int read_history_range __P((char *, int, int));
/* Write the current history to FILENAME. If FILENAME is NULL,
then write the history list to ~/.history. Values returned
are as in read_history (). */
-extern int write_history ();
+extern int write_history __P((char *));
/* Append NELEMENT entries to FILENAME. The entries appended are from
the end of the list minus NELEMENTs up to the end of the list. */
-int append_history ();
+int append_history __P((int, char *));
/* Truncate the history file, leaving only the last NLINES lines. */
-extern int history_truncate_file ();
+extern int history_truncate_file __P((char *, int));
/* History expansion. */
@@ -189,20 +206,24 @@ extern int history_truncate_file ();
If an error ocurred in expansion, then OUTPUT contains a descriptive
error message. */
-extern int history_expand ();
+extern int history_expand __P((char *, char **));
/* Extract a string segment consisting of the FIRST through LAST
arguments present in STRING. Arguments are broken up as in
the shell. */
-extern char *history_arg_extract ();
+extern char *history_arg_extract __P((int, int, char *));
/* Return the text of the history event beginning at the current
- offset into STRING. */
-extern char *get_history_event ();
+ offset into STRING. Pass STRING with *INDEX equal to the
+ history_expansion_char that begins this specification.
+ DELIMITING_QUOTE is a character that is allowed to end the string
+ specification for what to search for in addition to the normal
+ characters `:', ` ', `\t', `\n', and sometimes `?'. */
+extern char *get_history_event __P((char *, int *, int));
/* Return an array of tokens, much as the shell might. The tokens are
parsed out of STRING. */
-extern char **history_tokenize ();
+extern char **history_tokenize __P((char *));
/* Exported history variables. */
extern int history_base;
@@ -220,4 +241,8 @@ extern int history_quotes_inhibit_expansion;
application and not expanded. */
extern Function *history_inhibit_expansion_function;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_HISTORY_H_ */
diff --git a/readline/input.c b/readline/input.c
index 7e3c0feb5ce..3b48483d262 100644
--- a/readline/input.c
+++ b/readline/input.c
@@ -124,38 +124,13 @@ _rl_any_typein ()
return any_typein;
}
-/* Add KEY to the buffer of characters to be read. */
-int
-rl_stuff_char (key)
- int key;
-{
- if (key == EOF)
- {
- key = NEWLINE;
- rl_pending_input = EOF;
- }
- ibuffer[push_index++] = key;
- if (push_index >= ibuffer_len)
- push_index = 0;
- return push_index;
-}
-
-/* Make C be the next command to be executed. */
-int
-rl_execute_next (c)
- int c;
-{
- rl_pending_input = c;
- return 0;
-}
-
-/* Return the amount of space available in the
- buffer for stuffing characters. */
+/* Return the amount of space available in the buffer for stuffing
+ characters. */
static int
ibuffer_space ()
{
if (pop_index > push_index)
- return (pop_index - push_index);
+ return (pop_index - push_index - 1);
else
return (ibuffer_len - (push_index - pop_index));
}
@@ -341,6 +316,36 @@ _rl_insert_typein (c)
free (string);
}
+/* Add KEY to the buffer of characters to be read. Returns 1 if the
+ character was stuffed correctly; 0 otherwise. */
+int
+rl_stuff_char (key)
+ int key;
+{
+ if (ibuffer_space () == 0)
+ return 0;
+
+ if (key == EOF)
+ {
+ key = NEWLINE;
+ rl_pending_input = EOF;
+ }
+ ibuffer[push_index++] = key;
+ if (push_index >= ibuffer_len)
+ push_index = 0;
+
+ return 1;
+}
+
+/* Make C be the next command to be executed. */
+int
+rl_execute_next (c)
+ int c;
+{
+ rl_pending_input = c;
+ return 0;
+}
+
/* **************************************************************** */
/* */
/* Character Input */
@@ -409,6 +414,11 @@ rl_getc (stream)
if (result == 0)
return (EOF);
+#if defined (__BEOS__)
+ if (errno == EINTR)
+ continue;
+#endif
+
#if defined (EWOULDBLOCK)
if (errno == EWOULDBLOCK)
{
diff --git a/readline/isearch.c b/readline/isearch.c
index 7decf9595b0..67279e18924 100644
--- a/readline/isearch.c
+++ b/readline/isearch.c
@@ -48,6 +48,9 @@
#include "readline.h"
#include "history.h"
+/* Variables exported to other files in the readline library. */
+unsigned char *_rl_isearch_terminators = (unsigned char *)NULL;
+
/* Variables imported from other files in the readline library. */
extern Keymap _rl_keymap;
extern HIST_ENTRY *saved_line_for_history;
@@ -55,9 +58,6 @@ extern int rl_line_buffer_len;
extern int rl_point, rl_end;
extern char *rl_line_buffer;
-extern void _rl_save_prompt ();
-extern void _rl_restore_prompt ();
-
extern int rl_execute_next ();
extern void rl_extend_line_buffer ();
@@ -178,12 +178,20 @@ rl_search_history (direction, invoking_key)
/* Non-zero if we are doing a reverse search. */
int reverse;
+ /* The list of characters which terminate the search, but are not
+ subsequently executed. If the variable isearch-terminators has
+ been set, we use that value, otherwise we use ESC and C-J. */
+ unsigned char *isearch_terminators;
+
orig_point = rl_point;
last_found_line = orig_line = where_history ();
reverse = direction < 0;
hlist = history_list ();
allocated_line = (char *)NULL;
+ isearch_terminators = _rl_isearch_terminators ? _rl_isearch_terminators
+ : (unsigned char *)"\033\012";
+
/* Create an arrary of pointers to the lines that we want to search. */
maybe_replace_line ();
i = 0;
@@ -211,7 +219,7 @@ rl_search_history (direction, invoking_key)
/* The line where we start the search. */
i = orig_line;
- _rl_save_prompt ();
+ rl_save_prompt ();
/* Initialize search parameters. */
search_string = xmalloc (search_string_size = 128);
@@ -246,10 +254,18 @@ rl_search_history (direction, invoking_key)
c = !reverse ? -1 : -2;
}
+#if 0
/* Let NEWLINE (^J) terminate the search for people who don't like
using ESC. ^M can still be used to terminate the search and
immediately execute the command. */
if (c == ESC || c == NEWLINE)
+#else
+ /* The characters in isearch_terminators (set from the user-settable
+ variable isearch-terminators) are used to terminate the search but
+ not subsequently execute the character as a command. The default
+ value is "\033\012" (ESC and C-J). */
+ if (strchr (isearch_terminators, c))
+#endif
{
/* ESC still terminates the search, but if there is pending
input or if input arrives within 0.1 seconds (on systems
@@ -291,7 +307,7 @@ rl_search_history (direction, invoking_key)
strcpy (rl_line_buffer, lines[orig_line]);
rl_point = orig_point;
rl_end = strlen (rl_line_buffer);
- _rl_restore_prompt();
+ rl_restore_prompt();
rl_clear_message ();
if (allocated_line)
free (allocated_line);
@@ -409,15 +425,15 @@ rl_search_history (direction, invoking_key)
/* First put back the original state. */
strcpy (rl_line_buffer, lines[orig_line]);
- _rl_restore_prompt ();
+ rl_restore_prompt ();
/* Free the search string. */
free (search_string);
if (last_found_line < orig_line)
- rl_get_previous_history (orig_line - last_found_line);
+ rl_get_previous_history (orig_line - last_found_line, 0);
else
- rl_get_next_history (last_found_line - orig_line);
+ rl_get_next_history (last_found_line - orig_line, 0);
/* If the string was not found, put point at the end of the line. */
if (line_index < 0)
diff --git a/readline/keymaps.c b/readline/keymaps.c
index 9359749ddc0..c73666bf273 100644
--- a/readline/keymaps.c
+++ b/readline/keymaps.c
@@ -124,7 +124,7 @@ rl_make_keymap ()
/* Free the storage associated with MAP. */
void
rl_discard_keymap (map)
- Keymap (map);
+ Keymap map;
{
int i;
diff --git a/readline/keymaps.h b/readline/keymaps.h
index f6143f86f26..5dff46f56c2 100644
--- a/readline/keymaps.h
+++ b/readline/keymaps.h
@@ -24,8 +24,10 @@
#define _KEYMAPS_H_
#if defined (READLINE_LIBRARY)
+# include "rlstdc.h"
# include "chardefs.h"
#else
+# include <readline/rlstdc.h>
# include <readline/chardefs.h>
#endif
@@ -70,26 +72,29 @@ extern KEYMAP_ENTRY_ARRAY vi_insertion_keymap, vi_movement_keymap;
/* Return a new, empty keymap.
Free it with free() when you are done. */
-extern Keymap rl_make_bare_keymap ();
+extern Keymap rl_make_bare_keymap __P((void));
/* Return a new keymap which is a copy of MAP. */
-extern Keymap rl_copy_keymap ();
+extern Keymap rl_copy_keymap __P((Keymap));
/* Return a new keymap with the printing characters bound to rl_insert,
the lowercase Meta characters bound to run their equivalents, and
the Meta digits bound to produce numeric arguments. */
-extern Keymap rl_make_keymap ();
+extern Keymap rl_make_keymap __P((void));
-extern void rl_discard_keymap ();
+/* Free the storage associated with a keymap. */
+extern void rl_discard_keymap __P((Keymap));
+
+/* These functions actually appear in bind.c */
/* Return the keymap corresponding to a given name. Names look like
- `emacs' or `emacs-meta' or `vi-insert'. */
-extern Keymap rl_get_keymap_by_name ();
+ `emacs' or `emacs-meta' or `vi-insert'. */
+extern Keymap rl_get_keymap_by_name __P((char *));
/* Return the current keymap. */
-extern Keymap rl_get_keymap ();
+extern Keymap rl_get_keymap __P((void));
/* Set the current keymap to MAP. */
-extern void rl_set_keymap ();
+extern void rl_set_keymap __P((Keymap));
#endif /* _KEYMAPS_H_ */
diff --git a/readline/kill.c b/readline/kill.c
index a150e3c28d2..0b4714fafa8 100644
--- a/readline/kill.c
+++ b/readline/kill.c
@@ -572,6 +572,8 @@ rl_yank_last_arg (count, key)
static int explicit_arg_p = 0;
static int count_passed = 1;
static int direction = 1;
+ static int undo_needed = 0;
+ int retval;
if (rl_last_func != rl_yank_last_arg)
{
@@ -582,19 +584,22 @@ rl_yank_last_arg (count, key)
}
else
{
- rl_do_undo ();
+ if (undo_needed)
+ rl_do_undo ();
if (count < 1)
direction = -direction;
history_skip += direction;
if (history_skip < 0)
history_skip = 0;
- count_passed = count;
}
if (explicit_arg_p)
- return (rl_yank_nth_arg_internal (count, key, history_skip));
+ retval = rl_yank_nth_arg_internal (count_passed, key, history_skip);
else
- return (rl_yank_nth_arg_internal ('$', key, history_skip));
+ retval = rl_yank_nth_arg_internal ('$', key, history_skip);
+
+ undo_needed = retval == 0;
+ return retval;
}
/* A special paste command for users of Cygnus's cygwin32. */
diff --git a/readline/posixjmp.h b/readline/posixjmp.h
index 8703d17e9fb..1347cc07ebc 100644
--- a/readline/posixjmp.h
+++ b/readline/posixjmp.h
@@ -9,10 +9,12 @@
#if defined (HAVE_POSIX_SIGSETJMP)
# define procenv_t sigjmp_buf
-# undef setjmp
-# define setjmp(x) sigsetjmp((x), 1)
-# undef longjmp
-# define longjmp(x, n) siglongjmp((x), (n))
+# if !defined (__OPENNT)
+# undef setjmp
+# define setjmp(x) sigsetjmp((x), 1)
+# undef longjmp
+# define longjmp(x, n) siglongjmp((x), (n))
+# endif /* !__OPENNT */
#else
# define procenv_t jmp_buf
#endif
diff --git a/readline/readline.c b/readline/readline.c
index 8ff6e98929f..622811fc11e 100644
--- a/readline/readline.c
+++ b/readline/readline.c
@@ -64,7 +64,7 @@
#include "history.h"
#ifndef RL_LIBRARY_VERSION
-# define RL_LIBRARY_VERSION "2.2-bash"
+# define RL_LIBRARY_VERSION "4.0"
#endif
/* Evaluates its arguments multiple times. */
@@ -83,7 +83,6 @@ extern void _rl_output_character_function ();
#else
extern int _rl_output_character_function ();
#endif
-extern void _rl_get_screen_size ();
extern int _rl_enable_meta;
extern int _rl_term_autowrap;
@@ -100,7 +99,6 @@ extern int alphabetic ();
/* Functions imported from bind.c. */
extern void _rl_bind_if_unbound ();
-extern int rl_set_keymap_from_edit_mode ();
/* Functions imported from input.c. */
extern int _rl_any_typein ();
@@ -118,9 +116,7 @@ extern void _rl_move_vert ();
extern void _rl_update_final ();
extern void _rl_clear_to_eol ();
extern void _rl_clear_screen ();
-
-extern void _rl_save_prompt ();
-extern void _rl_restore_prompt ();
+extern void _rl_erase_entire_line ();
extern void _rl_erase_at_end_of_line ();
extern void _rl_move_cursor_relative ();
@@ -253,9 +249,14 @@ int rl_visible_prompt_length = 0;
int rl_key_sequence_length = 0;
/* If non-zero, then this is the address of a function to call just
- before readline_internal () prints the first prompt. */
+ before readline_internal_setup () prints the first prompt. */
Function *rl_startup_hook = (Function *)NULL;
+/* If non-zero, this is the address of a function to call just before
+ readline_internal_setup () returns and readline_internal starts
+ reading input characters. */
+Function *rl_pre_input_hook = (Function *)NULL;
+
/* What we use internally. You should always refer to RL_LINE_BUFFER. */
static char *the_line;
@@ -286,6 +287,9 @@ char *_rl_comment_begin;
/* Keymap holding the function currently being executed. */
Keymap rl_executing_keymap;
+/* Non-zero means to erase entire line, including prompt, on empty input lines. */
+int rl_erase_empty_line = 0;
+
/* Line buffer and maintenence. */
char *rl_line_buffer = (char *)NULL;
int rl_line_buffer_len = 0;
@@ -388,6 +392,9 @@ readline_internal_setup ()
rl_vi_insertion_mode (1, 0);
#endif /* VI_MODE */
}
+
+ if (rl_pre_input_hook)
+ (*rl_pre_input_hook) ();
}
STATIC_CALLBACK char *
@@ -405,7 +412,7 @@ readline_internal_teardown (eof)
{
temp = savestring (the_line);
rl_revert_line (1, 0);
- entry = replace_history_entry (where_history (), the_line, (HIST_ENTRY *)NULL);
+ entry = replace_history_entry (where_history (), the_line, (histdata_t)NULL);
_rl_free_history_entry (entry);
strcpy (the_line, temp);
@@ -488,6 +495,12 @@ readline_internal_charloop ()
if (rl_done == 0)
(*rl_redisplay_function) ();
+ /* If the application writer has told us to erase the entire line if
+ the only character typed was something bound to rl_newline, do so. */
+ if (rl_erase_empty_line && rl_done && rl_last_func == rl_newline &&
+ rl_point == 0 && rl_end == 0)
+ _rl_erase_entire_line ();
+
#if defined (READLINE_CALLBACKS)
return 0;
#else
@@ -501,7 +514,7 @@ readline_internal_charloop ()
static int
readline_internal_charloop ()
{
- int eof;
+ int eof = 1;
while (rl_done == 0)
eof = readline_internal_char ();
@@ -837,11 +850,19 @@ rl_digit_loop ()
{
int key, c, sawminus, sawdigits;
- _rl_save_prompt ();
+ rl_save_prompt ();
sawminus = sawdigits = 0;
while (1)
{
+ if (rl_numeric_arg > 1000000)
+ {
+ sawdigits = rl_explicit_arg = rl_numeric_arg = 0;
+ ding ();
+ rl_restore_prompt ();
+ rl_clear_message ();
+ return 1;
+ }
rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg);
key = c = rl_read_key ();
@@ -858,7 +879,7 @@ rl_digit_loop ()
else
{
key = rl_read_key ();
- _rl_restore_prompt ();
+ rl_restore_prompt ();
rl_clear_message ();
return (_rl_dispatch (key, _rl_keymap));
}
@@ -881,7 +902,7 @@ rl_digit_loop ()
/* Make M-- command equivalent to M--1 command. */
if (sawminus && rl_numeric_arg == 1 && rl_explicit_arg == 0)
rl_explicit_arg = 1;
- _rl_restore_prompt ();
+ rl_restore_prompt ();
rl_clear_message ();
return (_rl_dispatch (key, _rl_keymap));
}
@@ -1231,7 +1252,8 @@ rl_backward_word (count, key)
/* Clear the current line. Numeric argument to C-l does this. */
int
-rl_refresh_line ()
+rl_refresh_line (ignore1, ignore2)
+ int ignore1, ignore2;
{
int curr_line, nleft;
@@ -1278,7 +1300,7 @@ rl_clear_screen (count, key)
{
if (rl_explicit_arg)
{
- rl_refresh_line ();
+ rl_refresh_line (count, key);
return 0;
}
@@ -1428,6 +1450,11 @@ rl_newline (count, key)
}
#endif /* VI_MODE */
+ /* If we've been asked to erase empty lines, suppress the final update,
+ since _rl_update_final calls crlf(). */
+ if (rl_erase_empty_line && rl_point == 0 && rl_end == 0)
+ return 0;
+
if (readline_echoing_p)
_rl_update_final ();
return 0;
@@ -1507,9 +1534,22 @@ rl_delete (count, key)
}
else
return (rl_delete_text (rl_point, rl_point + 1));
-
}
+/* Delete the character under the cursor, unless the insertion
+ point is at the end of the line, in which case the character
+ behind the cursor is deleted. COUNT is obeyed and may be used
+ to delete forward or backward that many characters. */
+int
+rl_rubout_or_delete (count, key)
+ int count, key;
+{
+ if (rl_end != 0 && rl_point == rl_end)
+ return (rl_rubout (count, key));
+ else
+ return (rl_delete (count, key));
+}
+
/* Delete all spaces and tabs around point. */
int
rl_delete_horizontal_space (count, ignore)
@@ -1533,6 +1573,19 @@ rl_delete_horizontal_space (count, ignore)
return 0;
}
+/* Like the tcsh editing function delete-char-or-list. The eof character
+ is caught before this is invoked, so this really does the same thing as
+ delete-char-or-list-or-eof, as long as it's bound to the eof character. */
+int
+rl_delete_or_show_completions (count, key)
+ int count, key;
+{
+ if (rl_end != 0 && rl_point == rl_end)
+ return (rl_possible_completions (count, key));
+ else
+ return (rl_delete (count, key));
+}
+
#ifndef RL_COMMENT_BEGIN_DEFAULT
#define RL_COMMENT_BEGIN_DEFAULT "#"
#endif
@@ -1859,7 +1912,7 @@ maybe_replace_line ()
/* If the current line has changed, save the changes. */
if (temp && ((UNDO_LIST *)(temp->data) != rl_undo_list))
{
- temp = replace_history_entry (where_history (), the_line, rl_undo_list);
+ temp = replace_history_entry (where_history (), the_line, (histdata_t)rl_undo_list);
free (temp->line);
free (temp);
}
diff --git a/readline/readline.h b/readline/readline.h
index 280ec32f13f..dba1a0fdde9 100644
--- a/readline/readline.h
+++ b/readline/readline.h
@@ -23,10 +23,16 @@
#if !defined (_READLINE_H_)
#define _READLINE_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if defined (READLINE_LIBRARY)
+# include "rlstdc.h"
# include "keymaps.h"
# include "tilde.h"
#else
+# include <readline/rlstdc.h>
# include <readline/keymaps.h>
# include <readline/tilde.h>
#endif
@@ -60,78 +66,191 @@ typedef struct _funmap {
extern FUNMAP **funmap;
-/* Functions available to bind to key sequences. */
-extern int
- rl_tilde_expand (), rl_set_mark (), rl_exchange_point_and_mark (),
- rl_beg_of_line (), rl_backward (), rl_delete (), rl_end_of_line (),
- rl_forward (), ding (), rl_newline (), rl_kill_line (),
- rl_copy_region_to_kill (), rl_kill_region (), rl_char_search (),
- rl_clear_screen (), rl_get_next_history (), rl_get_previous_history (),
- rl_quoted_insert (), rl_reverse_search_history (), rl_transpose_chars (),
- rl_unix_line_discard (), rl_unix_word_rubout (),
- rl_yank (), rl_rubout (), rl_backward_word (), rl_kill_word (),
- rl_forward_word (), rl_tab_insert (), rl_yank_pop (), rl_yank_nth_arg (),
- rl_backward_kill_word (), rl_backward_kill_line (), rl_transpose_words (),
- rl_complete (), rl_possible_completions (), rl_insert_completions (),
- rl_menu_complete (),
- rl_do_lowercase_version (), rl_kill_full_line (),
- rl_digit_argument (), rl_universal_argument (), rl_abort (),
- rl_undo_command (), rl_revert_line (), rl_beginning_of_history (),
- rl_end_of_history (), rl_forward_search_history (), rl_insert (),
- rl_upcase_word (), rl_downcase_word (), rl_capitalize_word (),
- rl_restart_output (), rl_re_read_init_file (),
- rl_dump_functions (), rl_dump_variables (), rl_dump_macros (),
- rl_delete_horizontal_space (), rl_history_search_forward (),
- rl_history_search_backward (), rl_tty_status (), rl_yank_last_arg (),
- rl_insert_comment (), rl_backward_char_search (),
- rl_copy_forward_word (), rl_copy_backward_word ();
-
-/* Not available unless readline is compiled -DPAREN_MATCHING. */
-extern int rl_insert_close ();
-
-/* Not available unless READLINE_CALLBACKS is defined. */
-extern void rl_callback_handler_install ();
-extern void rl_callback_read_char ();
-extern void rl_callback_handler_remove ();
+/* **************************************************************** */
+/* */
+/* Functions available to bind to key sequences */
+/* */
+/* **************************************************************** */
+/* Bindable commands for numeric arguments. */
+extern int rl_digit_argument __P((int, int));
+extern int rl_universal_argument __P((int, int));
+
+/* Bindable commands for moving the cursor. */
+extern int rl_forward __P((int, int));
+extern int rl_backward __P((int, int));
+extern int rl_beg_of_line __P((int, int));
+extern int rl_end_of_line __P((int, int));
+extern int rl_forward_word __P((int, int));
+extern int rl_backward_word __P((int, int));
+extern int rl_refresh_line __P((int, int));
+extern int rl_clear_screen __P((int, int));
+extern int rl_arrow_keys __P((int, int));
+
+/* Bindable commands for inserting and deleting text. */
+extern int rl_insert __P((int, int));
+extern int rl_quoted_insert __P((int, int));
+extern int rl_tab_insert __P((int, int));
+extern int rl_newline __P((int, int));
+extern int rl_do_lowercase_version __P((int, int));
+extern int rl_rubout __P((int, int));
+extern int rl_delete __P((int, int));
+extern int rl_rubout_or_delete __P((int, int));
+extern int rl_delete_horizontal_space __P((int, int));
+extern int rl_delete_or_show_completions __P((int, int));
+extern int rl_insert_comment __P((int, int));
+
+/* Bindable commands for changing case. */
+extern int rl_upcase_word __P((int, int));
+extern int rl_downcase_word __P((int, int));
+extern int rl_capitalize_word __P((int, int));
+
+/* Bindable commands for transposing characters and words. */
+extern int rl_transpose_words __P((int, int));
+extern int rl_transpose_chars __P((int, int));
+
+/* Bindable commands for searching within a line. */
+extern int rl_char_search __P((int, int));
+extern int rl_backward_char_search __P((int, int));
+
+/* Bindable commands for readline's interface to the command history. */
+extern int rl_beginning_of_history __P((int, int));
+extern int rl_end_of_history __P((int, int));
+extern int rl_get_next_history __P((int, int));
+extern int rl_get_previous_history __P((int, int));
+
+/* Bindable commands for managing the mark and region. */
+extern int rl_set_mark __P((int, int));
+extern int rl_exchange_point_and_mark __P((int, int));
+
+/* Bindable commands to set the editing mode (emacs or vi). */
+extern int rl_vi_editing_mode __P((int, int));
+extern int rl_emacs_editing_mode __P((int, int));
+
+/* Bindable commands for managing key bindings. */
+extern int rl_re_read_init_file __P((int, int));
+extern int rl_dump_functions __P((int, int));
+extern int rl_dump_macros __P((int, int));
+extern int rl_dump_variables __P((int, int));
+
+/* Bindable commands for word completion. */
+extern int rl_complete __P((int, int));
+extern int rl_possible_completions __P((int, int));
+extern int rl_insert_completions __P((int, int));
+extern int rl_menu_complete __P((int, int));
+
+/* Bindable commands for killing and yanking text, and managing the kill ring. */
+extern int rl_kill_word __P((int, int));
+extern int rl_backward_kill_word __P((int, int));
+extern int rl_kill_line __P((int, int));
+extern int rl_backward_kill_line __P((int, int));
+extern int rl_kill_full_line __P((int, int));
+extern int rl_unix_word_rubout __P((int, int));
+extern int rl_unix_line_discard __P((int, int));
+extern int rl_copy_region_to_kill __P((int, int));
+extern int rl_kill_region __P((int, int));
+extern int rl_copy_forward_word __P((int, int));
+extern int rl_copy_backward_word __P((int, int));
+extern int rl_yank __P((int, int));
+extern int rl_yank_pop __P((int, int));
+extern int rl_yank_nth_arg __P((int, int));
+extern int rl_yank_last_arg __P((int, int));
/* Not available unless __CYGWIN32__ is defined. */
#ifdef __CYGWIN32__
-extern int rl_paste_from_clipboard ();
+extern int rl_paste_from_clipboard __P((int, int));
#endif
-/* These are *both* defined even when VI_MODE is not. */
-extern int rl_vi_editing_mode (), rl_emacs_editing_mode ();
+/* Bindable commands for incremental searching. */
+extern int rl_reverse_search_history __P((int, int));
+extern int rl_forward_search_history __P((int, int));
+
+/* Bindable keyboard macro commands. */
+extern int rl_start_kbd_macro __P((int, int));
+extern int rl_end_kbd_macro __P((int, int));
+extern int rl_call_last_kbd_macro __P((int, int));
+
+/* Bindable undo commands. */
+extern int rl_revert_line __P((int, int));
+extern int rl_undo_command __P((int, int));
+
+/* Bindable tilde expansion commands. */
+extern int rl_tilde_expand __P((int, int));
+
+/* Bindable terminal control commands. */
+extern int rl_restart_output __P((int, int));
+extern int rl_stop_output __P((int, int));
+
+/* Miscellaneous bindable commands. */
+extern int rl_abort __P((int, int));
+extern int rl_tty_status __P((int, int));
+
+/* Bindable commands for incremental and non-incremental history searching. */
+extern int rl_history_search_forward __P((int, int));
+extern int rl_history_search_backward __P((int, int));
+extern int rl_noninc_forward_search __P((int, int));
+extern int rl_noninc_reverse_search __P((int, int));
+extern int rl_noninc_forward_search_again __P((int, int));
+extern int rl_noninc_reverse_search_again __P((int, int));
+
+/* Not available unless readline is compiled -DPAREN_MATCHING. */
+extern int rl_insert_close __P((int, int));
-/* Non incremental history searching. */
-extern int rl_noninc_forward_search ();
-extern int rl_noninc_reverse_search ();
-extern int rl_noninc_forward_search_again ();
-extern int rl_noninc_reverse_search_again ();
+/* Not available unless READLINE_CALLBACKS is defined. */
+extern void rl_callback_handler_install __P((char *, VFunction *));
+extern void rl_callback_read_char __P((void));
+extern void rl_callback_handler_remove __P((void));
/* Things for vi mode. Not available unless readline is compiled -DVI_MODE. */
-extern int rl_vi_check ();
-extern int
- rl_vi_undo (), rl_vi_redo (), rl_vi_tilde_expand (),
- rl_vi_movement_mode (), rl_vi_insertion_mode (), rl_vi_arg_digit (),
- rl_vi_prev_word (), rl_vi_next_word (), rl_vi_char_search (),
- rl_vi_eof_maybe (), rl_vi_append_mode (), rl_vi_put (),
- rl_vi_append_eol (), rl_vi_insert_beg (), rl_vi_delete (),
- rl_vi_first_print (), rl_vi_fword (), rl_vi_fWord (), rl_vi_bword (),
- rl_vi_bWord (), rl_vi_eword (), rl_vi_eWord (), rl_vi_end_word (),
- rl_vi_change_case (), rl_vi_match (), rl_vi_bracktype (),
- rl_vi_change_char (), rl_vi_yank_arg (), rl_vi_search (),
- rl_vi_search_again (), rl_vi_subst (), rl_vi_overstrike (),
- rl_vi_overstrike_delete (), rl_vi_replace(), rl_vi_column (),
- rl_vi_delete_to (), rl_vi_change_to (), rl_vi_yank_to (),
- rl_vi_complete (), rl_vi_fetch_history (), rl_vi_set_mark (),
- rl_vi_goto_mark (), rl_vi_back_to_indent ();
-
-/* Keyboard macro commands. */
-extern int rl_start_kbd_macro (), rl_end_kbd_macro ();
-extern int rl_call_last_kbd_macro ();
-extern void rl_push_macro_input ();
-
-extern int rl_arrow_keys(), rl_refresh_line ();
+/* VI-mode bindable commands. */
+extern int rl_vi_redo __P((int, int));
+extern int rl_vi_undo __P((int, int));
+extern int rl_vi_yank_arg __P((int, int));
+extern int rl_vi_fetch_history __P((int, int));
+extern int rl_vi_search_again __P((int, int));
+extern int rl_vi_search __P((int, int));
+extern int rl_vi_complete __P((int, int));
+extern int rl_vi_tilde_expand __P((int, int));
+extern int rl_vi_prev_word __P((int, int));
+extern int rl_vi_next_word __P((int, int));
+extern int rl_vi_end_word __P((int, int));
+extern int rl_vi_insert_beg __P((int, int));
+extern int rl_vi_append_mode __P((int, int));
+extern int rl_vi_append_eol __P((int, int));
+extern int rl_vi_eof_maybe __P((int, int));
+extern int rl_vi_insertion_mode __P((int, int));
+extern int rl_vi_movement_mode __P((int, int));
+extern int rl_vi_arg_digit __P((int, int));
+extern int rl_vi_change_case __P((int, int));
+extern int rl_vi_put __P((int, int));
+extern int rl_vi_column __P((int, int));
+extern int rl_vi_delete_to __P((int, int));
+extern int rl_vi_change_to __P((int, int));
+extern int rl_vi_yank_to __P((int, int));
+extern int rl_vi_delete __P((int, int));
+extern int rl_vi_back_to_indent __P((int, int));
+extern int rl_vi_first_print __P((int, int));
+extern int rl_vi_char_search __P((int, int));
+extern int rl_vi_match __P((int, int));
+extern int rl_vi_change_char __P((int, int));
+extern int rl_vi_subst __P((int, int));
+extern int rl_vi_overstrike __P((int, int));
+extern int rl_vi_overstrike_delete __P((int, int));
+extern int rl_vi_replace __P((int, int));
+extern int rl_vi_set_mark __P((int, int));
+extern int rl_vi_goto_mark __P((int, int));
+
+/* VI-mode utility functions. */
+extern int rl_vi_check __P((void));
+extern int rl_vi_domove __P((int, int *));
+extern int rl_vi_bracktype __P((int));
+
+/* VI-mode pseudo-bindable commands, used as utility functions. */
+extern int rl_vi_fWord __P((int, int));
+extern int rl_vi_bWord __P((int, int));
+extern int rl_vi_eWord __P((int, int));
+extern int rl_vi_fword __P((int, int));
+extern int rl_vi_bword __P((int, int));
+extern int rl_vi_eword __P((int, int));
/* **************************************************************** */
/* */
@@ -141,57 +260,80 @@ extern int rl_arrow_keys(), rl_refresh_line ();
/* Readline functions. */
/* Read a line of input. Prompt with PROMPT. A NULL PROMPT means none. */
-extern char *readline ();
-
-/* These functions are from bind.c. */
-/* rl_add_defun (char *name, Function *function, int key)
- Add NAME to the list of named functions. Make FUNCTION
- be the function that gets called.
- If KEY is not -1, then bind it. */
-extern int rl_add_defun ();
-
-extern Keymap rl_make_bare_keymap ();
-extern Keymap rl_copy_keymap ();
-extern Keymap rl_make_keymap ();
-extern void rl_discard_keymap ();
-extern Keymap rl_get_keymap (), rl_get_keymap_by_name ();
-extern void rl_set_keymap ();
-extern char *rl_get_keymap_name ();
-
-extern int rl_bind_key (), rl_bind_key_in_map ();
-extern int rl_unbind_key (), rl_unbind_key_in_map ();
-extern int rl_unbind_function_in_map (), rl_unbind_command_in_map ();
-extern int rl_set_key ();
-extern int rl_generic_bind ();
-extern int rl_parse_and_bind ();
-/* Backwards compatibility, use rl_generic_bind instead. */
-extern int rl_macro_bind (), rl_variable_bind ();
+extern char *readline __P((char *));
-extern int rl_read_init_file ();
+extern int rl_initialize __P((void));
-extern Function *rl_named_function (), *rl_function_of_keyseq ();
-extern char **rl_invoking_keyseqs (), **rl_invoking_keyseqs_in_map ();
-extern void rl_function_dumper ();
-extern void rl_variable_dumper ();
-extern void rl_macro_dumper ();
-extern void rl_list_funmap_names ();
+extern int rl_discard_argument __P((void));
-/* Undocumented in the texinfo manual; not really useful to programs. */
-extern int rl_translate_keyseq ();
-extern void rl_initialize_funmap ();
+/* Utility functions to bind keys to readline commands. */
+extern int rl_add_defun __P((char *, Function *, int));
+extern int rl_bind_key __P((int, Function *));
+extern int rl_bind_key_in_map __P((int, Function *, Keymap));
+extern int rl_unbind_key __P((int));
+extern int rl_unbind_key_in_map __P((int, Keymap));
+extern int rl_unbind_function_in_map __P((Function *, Keymap));
+extern int rl_unbind_command_in_map __P((char *, Keymap));
+extern int rl_set_key __P((char *, Function *, Keymap));
+extern int rl_generic_bind __P((int, char *, char *, Keymap));
+extern int rl_variable_bind __P((char *, char *));
-/* Functions for undoing. */
-extern int rl_begin_undo_group (), rl_end_undo_group ();
-extern void rl_add_undo (), free_undo_list ();
-extern int rl_do_undo ();
-extern int rl_modifying ();
+/* Backwards compatibility, use rl_generic_bind instead. */
+extern int rl_macro_bind __P((char *, char *, Keymap));
+
+/* Undocumented in the texinfo manual; not really useful to programs. */
+extern int rl_translate_keyseq __P((char *, char *, int *));
+extern char *rl_untranslate_keyseq __P((int));
+
+extern Function *rl_named_function __P((char *));
+extern Function *rl_function_of_keyseq __P((char *, Keymap, int *));
+
+extern void rl_list_funmap_names __P((void));
+extern char **rl_invoking_keyseqs_in_map __P((Function *, Keymap));
+extern char **rl_invoking_keyseqs __P((Function *));
+
+extern void rl_function_dumper __P((int));
+extern void rl_macro_dumper __P((int));
+extern void rl_variable_dumper __P((int));
+
+extern int rl_read_init_file __P((char *));
+extern int rl_parse_and_bind __P((char *));
+
+/* Functions for manipulating keymaps. */
+extern Keymap rl_make_bare_keymap __P((void));
+extern Keymap rl_copy_keymap __P((Keymap));
+extern Keymap rl_make_keymap __P((void));
+extern void rl_discard_keymap __P((Keymap));
+
+extern Keymap rl_get_keymap_by_name __P((char *));
+extern char *rl_get_keymap_name __P((Keymap));
+extern void rl_set_keymap __P((Keymap));
+extern Keymap rl_get_keymap __P((void));
+extern void rl_set_keymap_from_edit_mode __P((void));
+extern char *rl_get_keymap_name_from_edit_mode __P((void));
+
+/* Functions for manipulating the funmap, which maps command names to functions. */
+extern int rl_add_funmap_entry __P((char *, Function *));
+extern void rl_initialize_funmap __P((void));
+extern char **rl_funmap_names __P((void));
+
+/* Utility functions for managing keyboard macros. */
+extern void rl_push_macro_input __P((char *));
+
+/* Functions for undoing, from undo.c */
+extern void rl_add_undo __P((enum undo_code, int, int, char *));
+extern void free_undo_list __P((void));
+extern int rl_do_undo __P((void));
+extern int rl_begin_undo_group __P((void));
+extern int rl_end_undo_group __P((void));
+extern int rl_modifying __P((int, int));
/* Functions for redisplay. */
-extern void rl_redisplay ();
-extern int rl_forced_update_display ();
-extern int rl_clear_message ();
-extern int rl_reset_line_state ();
-extern int rl_on_new_line ();
+extern void rl_redisplay __P((void));
+extern int rl_on_new_line __P((void));
+extern int rl_forced_update_display __P((void));
+extern int rl_clear_message __P((void));
+extern int rl_reset_line_state __P((void));
#if defined (__STDC__) && defined (USE_VARARGS) && defined (PREFER_STDARG)
extern int rl_message (const char *, ...);
@@ -200,36 +342,59 @@ extern int rl_message ();
#endif
/* Undocumented in texinfo manual. */
-extern int rl_character_len ();
-extern int rl_show_char ();
-extern int crlf ();
-
-/* Modifying text. */
-extern int rl_insert_text (), rl_delete_text ();
-extern int rl_kill_text ();
-extern char *rl_copy_text ();
-
-/* `Public' utility functions. */
-extern int rl_reset_terminal ();
-extern int rl_stuff_char ();
-extern int rl_read_key (), rl_getc ();
+extern int rl_show_char __P((int));
+extern int rl_character_len __P((int, int));
+extern int crlf __P((void));
-extern int rl_initialize ();
+/* Save and restore internal prompt redisplay information. */
+extern void rl_save_prompt __P((void));
+extern void rl_restore_prompt __P((void));
+/* Modifying text. */
+extern int rl_insert_text __P((char *));
+extern int rl_delete_text __P((int, int));
+extern int rl_kill_text __P((int, int));
+extern char *rl_copy_text __P((int, int));
+
+/* Terminal and tty mode management. */
+extern void rl_prep_terminal __P((int));
+extern void rl_deprep_terminal __P((void));
+extern void rltty_set_default_bindings __P((Keymap));
+
+extern int rl_reset_terminal __P((char *));
+extern void rl_resize_terminal __P((void));
+
+/* `Public' utility functions . */
+extern void rl_extend_line_buffer __P((int));
+extern int ding __P((void));
+
+/* Functions for character input. */
+extern int rl_stuff_char __P((int));
+extern int rl_execute_next __P((int));
+extern int rl_read_key __P((void));
+extern int rl_getc __P((FILE *));
+
+/* Readline signal handling, from signals.c */
+extern int rl_set_signals __P((void));
+extern int rl_clear_signals __P((void));
+extern void rl_cleanup_after_signal __P((void));
+extern void rl_reset_after_signal __P((void));
+extern void rl_free_line_state __P((void));
+
/* Undocumented. */
-extern int rl_expand_prompt ();
-extern int rl_set_signals (), rl_clear_signals ();
-extern int maybe_save_line (), maybe_unsave_line (), maybe_replace_line ();
+extern int rl_expand_prompt __P((char *));
+
+extern int maybe_save_line __P((void));
+extern int maybe_unsave_line __P((void));
+extern int maybe_replace_line __P((void));
/* Completion functions. */
-/* These functions are from complete.c. */
-extern int rl_complete_internal ();
+extern int rl_complete_internal __P((int));
+extern void rl_display_match_list __P((char **, int, int));
-/* Return an array of strings which are the result of repeatadly calling
- FUNC with TEXT. */
-extern char **completion_matches ();
-extern char *username_completion_function ();
-extern char *filename_completion_function ();
+extern char **completion_matches __P((char *, CPFunction *));
+extern char *username_completion_function __P((char *, int));
+extern char *filename_completion_function __P((char *, int));
/* **************************************************************** */
/* */
@@ -254,10 +419,14 @@ extern char *rl_line_buffer;
/* The location of point, and end. */
extern int rl_point, rl_end;
+/* The mark, or saved cursor position. */
extern int rl_mark;
+/* Flag to indicate that readline has finished with the current input
+ line and should return it. */
extern int rl_done;
+/* If set to a character value, that will be the next keystroke read. */
extern int rl_pending_input;
/* Non-zero if we called this function from _rl_dispatch(). It's present
@@ -275,6 +444,11 @@ extern FILE *rl_instream, *rl_outstream;
before readline_internal () prints the first prompt. */
extern Function *rl_startup_hook;
+/* If non-zero, this is the address of a function to call just before
+ readline_internal_setup () returns and readline_internal starts
+ reading input characters. */
+extern Function *rl_pre_input_hook;
+
/* The address of a function to call periodically while Readline is
awaiting character input, or NULL, for no event handling. */
extern Function *rl_event_hook;
@@ -288,6 +462,24 @@ extern VFunction *rl_deprep_term_function;
extern Keymap rl_executing_keymap;
extern Keymap rl_binding_keymap;
+/* Display variables. */
+/* If non-zero, readline will erase the entire line, including any prompt,
+ if the only thing typed on an otherwise-blank line is something bound to
+ rl_newline. */
+extern int rl_erase_empty_line;
+
+/* Variables to control readline signal handling. */
+/* If non-zero, readline will install its own signal handlers for
+ SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */
+extern int rl_catch_signals;
+
+/* If non-zero, readline will install a signal handler for SIGWINCH
+ that also attempts to call any calling application's SIGWINCH signal
+ handler. Note that the terminal is not cleaned up before the
+ application's signal handler is called; use rl_cleanup_after_signal()
+ to do that. */
+extern int rl_catch_sigwinch;
+
/* Completion variables. */
/* Pointer to the generator function for completion_matches ().
NULL means to use filename_entry_function (), the default filename
@@ -346,6 +538,15 @@ extern Function *rl_directory_completion_hook;
/* Backwards compatibility with previous versions of readline. */
#define rl_symbolic_link_hook rl_directory_completion_hook
+/* If non-zero, then this is the address of a function to call when
+ completing a word would normally display the list of possible matches.
+ This function is called instead of actually doing the display.
+ It takes three arguments: (char **matches, int num_matches, int max_length)
+ where MATCHES is the array of strings that matched, NUM_MATCHES is the
+ number of strings in that array, and MAX_LENGTH is the length of the
+ longest string in that array. */
+extern VFunction *rl_completion_display_matches_hook;
+
/* Non-zero means that the results of the matches are to be treated
as filenames. This is ALWAYS zero on entry, and can only be changed
within a completion entry finder function. */
@@ -413,4 +614,8 @@ extern int rl_inhibit_completion;
extern char *savestring (); /* XXX backwards compatibility */
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _READLINE_H_ */
diff --git a/readline/rlconf.h b/readline/rlconf.h
index 8f07db155df..1356fd87924 100644
--- a/readline/rlconf.h
+++ b/readline/rlconf.h
@@ -56,8 +56,6 @@
/* Define this if you want code that allows readline to be used in an
X `callback' style. */
-#if !defined (SHELL)
-# define READLINE_CALLBACKS
-#endif
+#define READLINE_CALLBACKS
#endif /* _RLCONF_H_ */
diff --git a/readline/rltty.c b/readline/rltty.c
index 8312963abcb..a5ef938b5c0 100644
--- a/readline/rltty.c
+++ b/readline/rltty.c
@@ -37,9 +37,9 @@
#include "rldefs.h"
-#if !defined (SHELL) && defined (GWINSZ_IN_SYS_IOCTL)
+#if defined (GWINSZ_IN_SYS_IOCTL)
# include <sys/ioctl.h>
-#endif /* !SHELL && GWINSZ_IN_SYS_IOCTL */
+#endif /* GWINSZ_IN_SYS_IOCTL */
#include "rltty.h"
#include "readline.h"
@@ -144,7 +144,7 @@ static int terminal_prepped;
static int ksrflow;
#endif
-#if !defined (SHELL) && defined (TIOCGWINSZ)
+#if defined (TIOCGWINSZ)
/* Dummy call to force a backgrounded readline to stop before it tries
to get the tty settings. */
static void
@@ -156,9 +156,7 @@ set_winsize (tty)
if (ioctl (tty, TIOCGWINSZ, &w) == 0)
(void) ioctl (tty, TIOCSWINSZ, &w);
}
-#else /* SHELL || !TIOCGWINSZ */
-# define set_winsize(tty)
-#endif /* SHELL || !TIOCGWINSZ */
+#endif /* TIOCGWINSZ */
#if defined (NEW_TTY_DRIVER)
@@ -389,6 +387,7 @@ get_tty_settings (tty, tiop)
TIOTYPE *tiop;
{
int ioctl_ret;
+
set_winsize (tty);
while (1)
diff --git a/readline/search.c b/readline/search.c
index 3024ee59677..6c76e1a1c96 100644
--- a/readline/search.c
+++ b/readline/search.c
@@ -61,7 +61,6 @@ extern Function *rl_last_func;
/* Functions imported from the rest of the library. */
extern int _rl_free_history_entry ();
extern char *_rl_make_prompt_for_search ();
-extern void _rl_restore_prompt ();
extern void rl_extend_line_buffer ();
static char *noninc_search_string = (char *) NULL;
@@ -172,7 +171,7 @@ noninc_search (dir, pchar)
rl_message (p, 0, 0);
free (p);
-#define SEARCH_RETURN _rl_restore_prompt (); return
+#define SEARCH_RETURN rl_restore_prompt (); return
/* Read the search string. */
while (c = rl_read_key ())
@@ -241,7 +240,7 @@ noninc_search (dir, pchar)
noninc_search_string = savestring (rl_line_buffer);
}
- _rl_restore_prompt ();
+ rl_restore_prompt ();
noninc_dosearch (noninc_search_string, dir);
}
diff --git a/readline/shell.c b/readline/shell.c
index 8bc2fe9b4f9..091ec08f645 100644
--- a/readline/shell.c
+++ b/readline/shell.c
@@ -26,10 +26,9 @@
# include <config.h>
#endif
+#include <sys/types.h>
+
#if defined (HAVE_UNISTD_H)
-# ifdef _MINIX
-# include <sys/types.h>
-# endif
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
@@ -45,24 +44,16 @@
# include <strings.h>
#endif /* !HAVE_STRING_H */
-extern char *xmalloc (), *xrealloc ();
+#include <pwd.h>
-#if !defined (SHELL)
+#if !defined (HAVE_GETPW_DECLS)
+extern struct passwd *getpwuid ();
+#endif /* !HAVE_GETPW_DECLS */
-#ifdef savestring
-#undef savestring
-#endif
+extern char *xmalloc ();
-/* Backwards compatibility, now that savestring has been removed from
- all `public' readline header files. */
-#if 0
-char *
-savestring (s)
- char *s;
-{
- return ((char *)strcpy (xmalloc (1 + (int)strlen (s)), (s)));
-}
-#endif
+/* All of these functions are resolved from bash if we are linking readline
+ as part of bash. */
/* Does shell-like quoting using single quotes. */
char *
@@ -128,13 +119,15 @@ get_env_value (varname)
return ((char *)getenv (varname));
}
-#else /* SHELL */
-extern char *get_string_value ();
-
char *
-get_env_value (varname)
- char *varname;
+get_home_dir ()
{
- return get_string_value (varname);
-}
-#endif /* SHELL */
+ char *home_dir;
+ struct passwd *entry;
+
+ home_dir = (char *)NULL;
+ entry = getpwuid (getuid ());
+ if (entry)
+ home_dir = entry->pw_dir;
+ return (home_dir);
+}
diff --git a/readline/signals.c b/readline/signals.c
index e19c22d3641..3a34432f143 100644
--- a/readline/signals.c
+++ b/readline/signals.c
@@ -49,18 +49,6 @@
#include "readline.h"
#include "history.h"
-extern int readline_echoing_p;
-extern int rl_pending_input;
-extern int _rl_meta_flag;
-
-extern void free_undo_list ();
-extern void _rl_get_screen_size ();
-extern void _rl_redisplay_after_sigwinch ();
-extern void _rl_clean_up_for_exit ();
-extern void _rl_kill_kbd_macro ();
-extern void _rl_init_argument ();
-extern void rl_deprep_terminal (), rl_prep_terminal ();
-
#if !defined (RETSIGTYPE)
# if defined (VOID_SIGHANDLER)
# define RETSIGTYPE void
@@ -79,40 +67,52 @@ extern void rl_deprep_terminal (), rl_prep_terminal ();
to say SigHandler *foo = signal (SIGKILL, SIG_IGN); */
typedef RETSIGTYPE SigHandler ();
+extern int readline_echoing_p;
+extern int rl_pending_input;
+extern int _rl_meta_flag;
+
+extern void free_undo_list ();
+extern void _rl_get_screen_size ();
+extern void _rl_redisplay_after_sigwinch ();
+extern void _rl_clean_up_for_exit ();
+extern void _rl_kill_kbd_macro ();
+extern void _rl_init_argument ();
+extern void rl_deprep_terminal (), rl_prep_terminal ();
+
static SigHandler *rl_set_sighandler ();
+/* Exported variables for use by applications. */
+
+/* If non-zero, readline will install its own signal handlers for
+ SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */
+int rl_catch_signals = 1;
+
+/* If non-zero, readline will install a signal handler for SIGWINCH. */
+#ifdef SIGWINCH
+int rl_catch_sigwinch = 1;
+#endif
+
+static int signals_set_flag;
+static int sigwinch_set_flag;
+
/* **************************************************************** */
/* */
/* Signal Handling */
/* */
/* **************************************************************** */
-/* If we're not being compiled as part of bash, initialize handlers for
- and catch the job control signals (SIGTTIN, SIGTTOU, SIGTSTP) and
- SIGTERM. */
-#if !defined (SHELL)
-# define HANDLE_JOB_SIGNALS
-# define HANDLE_SIGTERM
-#endif /* !SHELL */
-
#if defined (HAVE_POSIX_SIGNALS)
typedef struct sigaction sighandler_cxt;
# define rl_sigaction(s, nh, oh) sigaction(s, nh, oh)
#else
-typedef struct { SigHandler *sa_handler; } sighandler_cxt;
+typedef struct { SigHandler *sa_handler; int sa_mask, sa_flags; } sighandler_cxt;
# define sigemptyset(m)
#endif /* !HAVE_POSIX_SIGNALS */
-static sighandler_cxt old_int, old_alrm;
-
-#if defined (HANDLE_JOB_SIGNALS)
+static sighandler_cxt old_int, old_term, old_alrm, old_quit;
+#if defined (SIGTSTP)
static sighandler_cxt old_tstp, old_ttou, old_ttin;
-#endif /* HANDLE_JOB_SIGNALS */
-
-#if defined (HANDLE_SIGTERM)
-static sighandler_cxt old_term;
#endif
-
#if defined (SIGWINCH)
static sighandler_cxt old_winch;
#endif
@@ -143,18 +143,8 @@ rl_signal_handler (sig)
switch (sig)
{
case SIGINT:
- {
- register HIST_ENTRY *entry;
-
- free_undo_list ();
-
- entry = current_history ();
- if (entry)
- entry->data = (char *)NULL;
- }
- _rl_kill_kbd_macro ();
- rl_clear_message ();
- _rl_init_argument ();
+ rl_free_line_state ();
+ /* FALLTHROUGH */
#if defined (SIGTSTP)
case SIGTSTP:
@@ -163,10 +153,8 @@ rl_signal_handler (sig)
#endif /* SIGTSTP */
case SIGALRM:
case SIGTERM:
- _rl_clean_up_for_exit ();
- (*rl_deprep_term_function) ();
- rl_clear_signals ();
- rl_pending_input = 0;
+ case SIGQUIT:
+ rl_cleanup_after_signal ();
#if defined (HAVE_POSIX_SIGNALS)
sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &set);
@@ -188,8 +176,7 @@ rl_signal_handler (sig)
# endif /* HAVE_BSD_SIGNALS */
#endif /* !HAVE_POSIX_SIGNALS */
- (*rl_prep_term_function) (_rl_meta_flag);
- rl_set_signals ();
+ rl_reset_after_signal ();
}
SIGHANDLER_RETURN;
@@ -197,7 +184,7 @@ rl_signal_handler (sig)
#if defined (SIGWINCH)
static RETSIGTYPE
-rl_handle_sigwinch (sig)
+rl_sigwinch_handler (sig)
int sig;
{
SigHandler *oh;
@@ -209,14 +196,10 @@ rl_handle_sigwinch (sig)
disposition set by the calling application. We need this state
because we call the application's SIGWINCH handler after updating
our own idea of the screen size. */
- rl_set_sighandler (SIGWINCH, rl_handle_sigwinch, &dummy_winch);
+ rl_set_sighandler (SIGWINCH, rl_sigwinch_handler, &dummy_winch);
#endif
- if (readline_echoing_p)
- {
- _rl_get_screen_size (fileno (rl_instream), 1);
- _rl_redisplay_after_sigwinch ();
- }
+ rl_resize_terminal ();
/* If another sigwinch handler has been installed, call it. */
oh = (SigHandler *)old_winch.sa_handler;
@@ -263,62 +246,66 @@ rl_set_sighandler (sig, handler, ohandler)
return (ohandler->sa_handler);
}
-int
-rl_set_signals ()
+static void
+rl_maybe_set_sighandler (sig, handler, ohandler)
+ int sig;
+ SigHandler *handler;
+ sighandler_cxt *ohandler;
{
sighandler_cxt dummy;
SigHandler *oh;
-#if defined (HAVE_POSIX_SIGNALS)
sigemptyset (&dummy.sa_mask);
-#endif
-
- oh = rl_set_sighandler (SIGINT, rl_signal_handler, &old_int);
+ oh = rl_set_sighandler (sig, handler, ohandler);
if (oh == (SigHandler *)SIG_IGN)
- rl_sigaction (SIGINT, &old_int, &dummy);
+ rl_sigaction (sig, ohandler, &dummy);
+}
- oh = rl_set_sighandler (SIGALRM, rl_signal_handler, &old_alrm);
- if (oh == (SigHandler *)SIG_IGN)
- rl_sigaction (SIGALRM, &old_alrm, &dummy);
+int
+rl_set_signals ()
+{
+ sighandler_cxt dummy;
+ SigHandler *oh;
+
+ if (rl_catch_signals && signals_set_flag == 0)
+ {
+ rl_maybe_set_sighandler (SIGINT, rl_signal_handler, &old_int);
+ rl_maybe_set_sighandler (SIGTERM, rl_signal_handler, &old_term);
+ rl_maybe_set_sighandler (SIGQUIT, rl_signal_handler, &old_quit);
+
+ oh = rl_set_sighandler (SIGALRM, rl_signal_handler, &old_alrm);
+ if (oh == (SigHandler *)SIG_IGN)
+ rl_sigaction (SIGALRM, &old_alrm, &dummy);
#if defined (HAVE_POSIX_SIGNALS) && defined (SA_RESTART)
- /* If the application using readline has already installed a signal
- handler with SA_RESTART, SIGALRM will cause reads to be restarted
- automatically, so readline should just get out of the way. Since
- we tested for SIG_IGN above, we can just test for SIG_DFL here. */
- if (oh != (SigHandler *)SIG_DFL && (old_alrm.sa_flags & SA_RESTART))
- rl_sigaction (SIGALRM, &old_alrm, &dummy);
+ /* If the application using readline has already installed a signal
+ handler with SA_RESTART, SIGALRM will cause reads to be restarted
+ automatically, so readline should just get out of the way. Since
+ we tested for SIG_IGN above, we can just test for SIG_DFL here. */
+ if (oh != (SigHandler *)SIG_DFL && (old_alrm.sa_flags & SA_RESTART))
+ rl_sigaction (SIGALRM, &old_alrm, &dummy);
#endif /* HAVE_POSIX_SIGNALS */
-#if defined (HANDLE_JOB_SIGNALS)
-
#if defined (SIGTSTP)
- oh = rl_set_sighandler (SIGTSTP, rl_signal_handler, &old_tstp);
- if (oh == (SigHandler *)SIG_IGN)
- rl_sigaction (SIGTSTP, &old_tstp, &dummy);
-#else
- oh = (SigHandler *)NULL;
+ rl_maybe_set_sighandler (SIGTSTP, rl_signal_handler, &old_tstp);
#endif /* SIGTSTP */
#if defined (SIGTTOU)
- rl_set_sighandler (SIGTTOU, rl_signal_handler, &old_ttou);
- rl_set_sighandler (SIGTTIN, rl_signal_handler, &old_ttin);
-
- if (oh == (SigHandler *)SIG_IGN)
- {
- rl_set_sighandler (SIGTTOU, SIG_IGN, &dummy);
- rl_set_sighandler (SIGTTIN, SIG_IGN, &dummy);
- }
+ rl_maybe_set_sighandler (SIGTTOU, rl_signal_handler, &old_ttou);
#endif /* SIGTTOU */
-#endif /* HANDLE_JOB_SIGNALS */
+#if defined (SIGTTIN)
+ rl_maybe_set_sighandler (SIGTTIN, rl_signal_handler, &old_ttin);
+#endif /* SIGTTIN */
-#if defined (HANDLE_SIGTERM)
- /* Handle SIGTERM if we're not being compiled as part of bash. */
- rl_set_sighandler (SIGTERM, rl_signal_handler, &old_term);
-#endif /* HANDLE_SIGTERM */
+ signals_set_flag = 1;
+ }
#if defined (SIGWINCH)
- rl_set_sighandler (SIGWINCH, rl_handle_sigwinch, &old_winch);
+ if (rl_catch_sigwinch && sigwinch_set_flag == 0)
+ {
+ rl_maybe_set_sighandler (SIGWINCH, rl_sigwinch_handler, &old_winch);
+ sigwinch_set_flag = 1;
+ }
#endif /* SIGWINCH */
return 0;
@@ -329,35 +316,79 @@ rl_clear_signals ()
{
sighandler_cxt dummy;
-#if defined (HAVE_POSIX_SIGNALS)
- sigemptyset (&dummy.sa_mask);
-#endif
-
- rl_sigaction (SIGINT, &old_int, &dummy);
- rl_sigaction (SIGALRM, &old_alrm, &dummy);
+ if (rl_catch_signals && signals_set_flag == 1)
+ {
+ sigemptyset (&dummy.sa_mask);
-#if defined (HANDLE_JOB_SIGNALS)
+ rl_sigaction (SIGINT, &old_int, &dummy);
+ rl_sigaction (SIGTERM, &old_term, &dummy);
+ rl_sigaction (SIGQUIT, &old_quit, &dummy);
+ rl_sigaction (SIGALRM, &old_alrm, &dummy);
#if defined (SIGTSTP)
- rl_sigaction (SIGTSTP, &old_tstp, &dummy);
-#endif
+ rl_sigaction (SIGTSTP, &old_tstp, &dummy);
+#endif /* SIGTSTP */
#if defined (SIGTTOU)
- rl_sigaction (SIGTTOU, &old_ttou, &dummy);
- rl_sigaction (SIGTTIN, &old_ttin, &dummy);
+ rl_sigaction (SIGTTOU, &old_ttou, &dummy);
#endif /* SIGTTOU */
-#endif /* HANDLE_JOB_SIGNALS */
+#if defined (SIGTTIN)
+ rl_sigaction (SIGTTIN, &old_ttin, &dummy);
+#endif /* SIGTTIN */
-#if defined (HANDLE_SIGTERM)
- rl_sigaction (SIGTERM, &old_term, &dummy);
-#endif /* HANDLE_SIGTERM */
+ signals_set_flag = 0;
+ }
#if defined (SIGWINCH)
- sigemptyset (&dummy.sa_mask);
- rl_sigaction (SIGWINCH, &old_winch, &dummy);
+ if (rl_catch_sigwinch && sigwinch_set_flag == 1)
+ {
+ sigemptyset (&dummy.sa_mask);
+ rl_sigaction (SIGWINCH, &old_winch, &dummy);
+ sigwinch_set_flag = 0;
+ }
#endif
return 0;
}
+
+/* Clean up the terminal and readline state after catching a signal, before
+ resending it to the calling application. */
+void
+rl_cleanup_after_signal ()
+{
+ _rl_clean_up_for_exit ();
+ (*rl_deprep_term_function) ();
+ rl_clear_signals ();
+ rl_pending_input = 0;
+}
+
+/* Reset the terminal and readline state after a signal handler returns. */
+void
+rl_reset_after_signal ()
+{
+ (*rl_prep_term_function) (_rl_meta_flag);
+ rl_set_signals ();
+}
+
+/* Free up the readline variable line state for the current line (undo list,
+ any partial history entry, any keyboard macros in progress, and any
+ numeric arguments in process) after catching a signal, before calling
+ rl_cleanup_after_signal(). */
+void
+rl_free_line_state ()
+{
+ register HIST_ENTRY *entry;
+
+ free_undo_list ();
+
+ entry = current_history ();
+ if (entry)
+ entry->data = (char *)NULL;
+
+ _rl_kill_kbd_macro ();
+ rl_clear_message ();
+ _rl_init_argument ();
+}
+
#endif /* HANDLE_SIGNALS */
diff --git a/readline/support/config.guess b/readline/support/config.guess
index 0e11ad86e3a..66a24282a47 100755
--- a/readline/support/config.guess
+++ b/readline/support/config.guess
@@ -151,6 +151,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:QNX:*:42*)
echo i386-qssl-qnx`echo ${UNAME_VERSION}`
exit 0 ;;
+ BeBox:BeOS:*:*)
+ echo powerpc-be-beos
+ exit 0 ;;
+ BeMac:BeOS:*:*)
+ echo powerpc-apple-beos
+ exit 0 ;;
+ BePC:BeOS:*:*)
+ echo i586-pc-beos
+ exit 0 ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
# end cases added for Bash
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
@@ -213,6 +225,9 @@ EOF
amiga:OpenBSD:*:*)
echo m68k-cbm-openbsd${UNAME_RELEASE}
exit 0 ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit 0 ;;
arc64:OpenBSD:*:*)
echo mips64el-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@@ -315,10 +330,10 @@ EOF
echo m88k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
Power?Macintosh:Rhapsody:*:*)
- echo powerpc-apple-nextstep${UNAME_RELEASE}
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-unknown-nextstep${UNAME_RELEASE}
+ echo ${UNAME_MACHINE}-unknown-rhapsody${UNAME_RELEASE}
exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
@@ -737,6 +752,11 @@ EOF
i?86:DYNIX/ptx:4*:*)
echo i386-sequent-sysv4
exit 0 ;;
+# added by chet for bash based on usenet posting from <hops@sco.com> and
+# documentation on SCO's web site -- UnixWare 7 (SVR5)
+ i?86:UnixWare:5*:*)
+ echo ${UNAME_MACHINE}-pc-sysv5uw${UNAME_VERSION}
+ exit 0 ;;
i?86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
@@ -862,7 +882,7 @@ EOF
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
- exit 0 ;;
+ exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
diff --git a/readline/support/config.sub b/readline/support/config.sub
index 244fbde1feb..c1ec2df8f0b 100755
--- a/readline/support/config.sub
+++ b/readline/support/config.sub
@@ -94,7 +94,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple)
+ -apple )
os=
basic_machine=$1
;;
@@ -102,7 +102,7 @@ case $os in
os=-hiuxwe2
;;
-sco5)
- os=sco3.2v5
+ os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
@@ -175,7 +175,8 @@ case $basic_machine in
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
| none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
- | alpha-* | we32k-* | cydra-* | ns16k-* \
+ | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* | alphaev6-* \
+ | we32k-* | cydra-* | ns16k-* \
| pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
| pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* | f301-* \
@@ -183,7 +184,7 @@ case $basic_machine in
| cadmus-* | ews*-nec | ibmrt-ibm* | masscomp-masscomp \
| tandem-* | symmetric-* | drs6000-icl | *-*ardent | gould-gould \
| concurrent-* | ksr1-* | esa-ibm | fxc-alliant | *370-amdahl \
- | *-convex)
+ | *-convex | sx4*-nec)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@@ -208,7 +209,12 @@ case $basic_machine in
os=-sysv
;;
amiga | amiga-*)
- basic_machine=m68k-cbm
+# basic_machine=m68k-cbm
+ basic_machine=m68k-unknown
+ ;;
+ amigaos)
+ basic_machine=m68k-unknown
+ os=-amigaos
;;
amigados)
basic_machine=m68k-cbm
@@ -404,6 +410,14 @@ case $basic_machine in
miniframe)
basic_machine=m68000-convergent
;;
+ mipsel*-linux*)
+ basic_machine=mipsel-unknown
+ os=-linux
+ ;;
+ mips*-linux*)
+ basic_machine=mips-unknown
+ os=-linux
+ ;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
@@ -454,6 +468,14 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
+ osr5 | sco5) # SCO Open Server
+ basic_machine=i386-pc
+ os=-sco3.2v5
+ ;;
+ odt | odt3 | odt4) # SCO Open Desktop
+ basic_machine=i386-pc
+ os=-sco3.2v4
+ ;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
@@ -584,6 +606,14 @@ case $basic_machine in
basic_machine=a29k-nyu
os=-sym1
;;
+ uw2 | unixware | unixware2)
+ basic_machine=i386-pc
+ os=-sysv4.2uw2.1
+ ;;
+ uw7 | unixware7)
+ basic_machine=i386-pc
+ os=-sysv5uw7
+ ;;
vaxv)
basic_machine=vax-dec
os=-sysv
@@ -622,7 +652,11 @@ case $basic_machine in
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
mips)
- basic_machine=mips-mips
+ if test "x$os" = "x-linux" ; then
+ basic_machine=mips-unknown
+ else
+ basic_machine=mips-mips
+ fi
;;
romp)
basic_machine=romp-ibm
@@ -683,9 +717,15 @@ case $os in
-solaris)
os=-solaris2
;;
- -unixware* | svr4*)
+ svr4*)
os=-sysv4
;;
+ -unixware | -uw | -unixware2* | -uw2*)
+ os=-sysv4.2uw2.1
+ ;;
+ -unixware7* | -uw7*)
+ os=-sysv5uw7
+ ;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
@@ -696,15 +736,16 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -linux-gnu* | -uxpv* | -qnx* | -powerux)
+ | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -linux-gnu* | -uxpv* | -qnx* | -powerux* | -beos* | -rhapsody* \
+ | -superux* )
# Remember, each alternative MUST END IN *, to match a version number.
;;
-linux*)
@@ -759,7 +800,10 @@ case $os in
-sysvr4)
os=-sysv4
;;
- # This must come after -sysvr4.
+ -sysvr5)
+ os=-sysv5
+ ;;
+ # This must come after -sysvr[45].
-sysv*)
;;
-xenix)
@@ -817,6 +861,9 @@ case $basic_machine in
sparc-* | *-sun)
os=-sunos4.1.1
;;
+ *-be)
+ os=-beos
+ ;;
*-ibm)
os=-aix
;;
@@ -830,7 +877,7 @@ case $basic_machine in
os=-sysv
;;
*-cbm)
- os=-amigados
+ os=-amigaos
;;
*-dg)
os=-dgux
diff --git a/readline/support/mkdist b/readline/support/mkdist
index 0d3d6940599..a1e4eb16fed 100755
--- a/readline/support/mkdist
+++ b/readline/support/mkdist
@@ -48,7 +48,7 @@ fi
version=$1
newdir=${ROOTNAME}-$version
-vmsg creating distribution for version $version in $newdir
+vmsg creating distribution for $ROOTNAME version $version in $newdir
if [ ! -d $newdir ]; then
mkdir $newdir || { echo $0: cannot make directory $newdir 1>&2 ; exit 1; }
diff --git a/readline/terminal.c b/readline/terminal.c
index f5326387218..a1fcc25400e 100644
--- a/readline/terminal.c
+++ b/readline/terminal.c
@@ -236,6 +236,16 @@ _rl_set_screen_size (rows, cols)
screenchars = screenwidth * screenheight;
}
+void
+rl_resize_terminal ()
+{
+ if (readline_echoing_p)
+ {
+ _rl_get_screen_size (fileno (rl_instream), 1);
+ _rl_redisplay_after_sigwinch ();
+ }
+}
+
struct _tc_string {
char *tc_var;
char **tc_value;
diff --git a/readline/tilde.c b/readline/tilde.c
index 3741f9767b2..d1853bd63d6 100644
--- a/readline/tilde.c
+++ b/readline/tilde.c
@@ -47,10 +47,6 @@
#include "tilde.h"
-#ifdef SHELL
-#include "shell.h"
-#endif
-
#if !defined (HAVE_GETPW_DECLS)
extern struct passwd *getpwuid (), *getpwnam ();
#endif /* !HAVE_GETPW_DECLS */
@@ -77,6 +73,12 @@ static char *xmalloc (), *xrealloc ();
extern char *xmalloc (), *xrealloc ();
#endif /* TEST || STATIC_MALLOC */
+/* If being compiled as part of bash, these will be satisfied from
+ variables.o. If being compiled as part of readline, they will
+ be satisfied from shell.o. */
+extern char *get_home_dir ();
+extern char *get_env_value ();
+
/* The default value of tilde_additional_prefixes. This is set to
whitespace preceding a tilde so that simple programs which do not
perform any word separation get desired behaviour. */
@@ -171,15 +173,6 @@ tilde_find_suffix (string)
return (i);
}
-#if !defined (SHELL)
-static char *
-get_string_value (varname)
- char *varname;
-{
- return ((char *)getenv (varname));
-}
-#endif
-
/* Return a new string which is the result of tilde expanding STRING. */
char *
tilde_expand (string)
@@ -284,27 +277,6 @@ glue_prefix_and_suffix (prefix, suffix, suffind)
return ret;
}
-static char *
-get_home_dir ()
-{
- char *home_dir;
-
-#ifdef SHELL
- home_dir = (char *)NULL;
- if (current_user.home_dir == 0)
- get_current_user_info ();
- home_dir = current_user.home_dir;
-#else
- struct passwd *entry;
-
- home_dir = (char *)NULL;
- entry = getpwuid (getuid ());
- if (entry)
- home_dir = entry->pw_dir;
-#endif
- return (home_dir);
-}
-
/* Do the work of tilde expansion on FILENAME. FILENAME starts with a
tilde. If there is no expansion, call tilde_expansion_failure_hook.
This always returns a newly-allocated string, never static storage. */
@@ -328,7 +300,7 @@ tilde_expand_word (filename)
if (filename[1] == '\0' || filename[1] == '/')
{
/* Prefix $HOME to the rest of the string. */
- expansion = get_string_value ("HOME");
+ expansion = get_env_value ("HOME");
/* If there is no HOME variable, look up the directory in
the password database. */
diff --git a/readline/util.c b/readline/util.c
index fde012edb61..1dc3b664f1c 100644
--- a/readline/util.c
+++ b/readline/util.c
@@ -64,6 +64,7 @@ extern int _rl_defining_kbd_macro;
extern char *_rl_executing_macro;
/* Pseudo-global functions imported from other library files. */
+extern void _rl_replace_text ();
extern void _rl_pop_executing_macro ();
extern void _rl_set_the_line ();
extern void _rl_init_argument ();
@@ -124,7 +125,7 @@ rl_tty_status (count, key)
{
#if defined (TIOCSTAT)
ioctl (1, TIOCSTAT, (char *)0);
- rl_refresh_line ();
+ rl_refresh_line (count, key);
#else
ding ();
#endif
diff --git a/readline/vi_mode.c b/readline/vi_mode.c
index 2f62ec3d480..d4868bf3b13 100644
--- a/readline/vi_mode.c
+++ b/readline/vi_mode.c
@@ -77,7 +77,7 @@
extern char *xmalloc (), *xrealloc ();
/* Variables imported from readline.c */
-extern int rl_point, rl_end, rl_mark, rl_done;
+extern int rl_point, rl_end, rl_mark;
extern FILE *rl_instream;
extern int rl_line_buffer_len, rl_explicit_arg, rl_numeric_arg;
extern Keymap _rl_keymap;
@@ -352,9 +352,9 @@ rl_vi_prev_word (count, key)
}
if (_rl_uppercase_p (key))
- rl_vi_bWord (count);
+ rl_vi_bWord (count, key);
else
- rl_vi_bword (count);
+ rl_vi_bword (count, key);
return (0);
}
@@ -374,9 +374,9 @@ rl_vi_next_word (count, key)
}
if (_rl_uppercase_p (key))
- rl_vi_fWord (count);
+ rl_vi_fWord (count, key);
else
- rl_vi_fword (count);
+ rl_vi_fword (count, key);
return (0);
}
@@ -392,16 +392,16 @@ rl_vi_end_word (count, key)
}
if (_rl_uppercase_p (key))
- rl_vi_eWord (count);
+ rl_vi_eWord (count, key);
else
- rl_vi_eword (count);
+ rl_vi_eword (count, key);
return (0);
}
/* Move forward a word the way that 'W' does. */
int
-rl_vi_fWord (count)
- int count;
+rl_vi_fWord (count, ignore)
+ int count, ignore;
{
while (count-- && rl_point < (rl_end - 1))
{
@@ -417,8 +417,8 @@ rl_vi_fWord (count)
}
int
-rl_vi_bWord (count)
- int count;
+rl_vi_bWord (count, ignore)
+ int count, ignore;
{
while (count-- && rl_point > 0)
{
@@ -441,8 +441,8 @@ rl_vi_bWord (count)
}
int
-rl_vi_eWord (count)
- int count;
+rl_vi_eWord (count, ignore)
+ int count, ignore;
{
while (count-- && rl_point < (rl_end - 1))
{
@@ -471,8 +471,8 @@ rl_vi_eWord (count)
}
int
-rl_vi_fword (count)
- int count;
+rl_vi_fword (count, ignore)
+ int count, ignore;
{
while (count-- && rl_point < (rl_end - 1))
{
@@ -497,8 +497,8 @@ rl_vi_fword (count)
}
int
-rl_vi_bword (count)
- int count;
+rl_vi_bword (count, ignore)
+ int count, ignore;
{
while (count-- && rl_point > 0)
{
@@ -536,8 +536,8 @@ rl_vi_bword (count)
}
int
-rl_vi_eword (count)
- int count;
+rl_vi_eword (count, ignore)
+ int count, ignore;
{
while (count-- && rl_point < rl_end - 1)
{
@@ -729,7 +729,7 @@ rl_vi_put (count, key)
if (!_rl_uppercase_p (key) && (rl_point + 1 <= rl_end))
rl_point++;
- rl_yank ();
+ rl_yank (1, key);
rl_backward (1, key);
return (0);
}
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index cdea1ae66bb..64751c9f2fc 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jul 27 16:36:51 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * interp.c (sim_store_register): Handle case where client - GDB -
+ specifies that a 4 byte register is 8 bytes in size.
+ (sim_fetch_register): Ditto.
+
1999-07-14 Frank Ch. Eigler <fche@cygnus.com>
Implement "sim firmware" option, inspired by jimb's version of 1998-01.
diff --git a/sim/mips/interp.c b/sim/mips/interp.c
index a102eeb4493..590af5e7c26 100644
--- a/sim/mips/interp.c
+++ b/sim/mips/interp.c
@@ -13,8 +13,8 @@
THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- $Revision: 1.184 $
- $Date: 1999/07/15 13:51:46 $
+ $Revision: 1.185 $
+ $Date: 1999/07/27 07:00:55 $
NOTEs:
@@ -850,8 +850,17 @@ sim_store_register (sd,rn,memory,length)
cpu->fpr_state[rn - FGRIDX] = fmt_uninterpreted;
if (cpu->register_widths[rn] == 32)
{
- cpu->fgr[rn - FGRIDX] = T2H_4 (*(unsigned32*)memory);
- return 4;
+ if (length == 8)
+ {
+ cpu->fgr[rn - FGRIDX] =
+ (unsigned32) T2H_8 (*(unsigned64*)memory);
+ return 8;
+ }
+ else
+ {
+ cpu->fgr[rn - FGRIDX] = T2H_4 (*(unsigned32*)memory);
+ return 4;
+ }
}
else
{
@@ -862,8 +871,17 @@ sim_store_register (sd,rn,memory,length)
if (cpu->register_widths[rn] == 32)
{
- cpu->registers[rn] = T2H_4 (*(unsigned32*)memory);
- return 4;
+ if (length == 8)
+ {
+ cpu->registers[rn] =
+ (unsigned32) T2H_8 (*(unsigned64*)memory);
+ return 8;
+ }
+ else
+ {
+ cpu->registers[rn] = T2H_4 (*(unsigned32*)memory);
+ return 4;
+ }
}
else
{
@@ -903,8 +921,17 @@ sim_fetch_register (sd,rn,memory,length)
{
if (cpu->register_widths[rn] == 32)
{
- *(unsigned32*)memory = H2T_4 (cpu->fgr[rn - FGRIDX]);
- return 4;
+ if (length == 8)
+ {
+ *(unsigned64*)memory =
+ H2T_8 ((unsigned32) (cpu->fgr[rn - FGRIDX]));
+ return 8;
+ }
+ else
+ {
+ *(unsigned32*)memory = H2T_4 (cpu->fgr[rn - FGRIDX]);
+ return 4;
+ }
}
else
{
@@ -915,8 +942,17 @@ sim_fetch_register (sd,rn,memory,length)
if (cpu->register_widths[rn] == 32)
{
- *(unsigned32*)memory = H2T_4 ((unsigned32)(cpu->registers[rn]));
- return 4;
+ if (length == 8)
+ {
+ *(unsigned64*)memory =
+ H2T_8 ((unsigned32) (cpu->registers[rn]));
+ return 8;
+ }
+ else
+ {
+ *(unsigned32*)memory = H2T_4 ((unsigned32)(cpu->registers[rn]));
+ return 4;
+ }
}
else
{