summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/readline.exp
Commit message (Collapse)AuthorAgeFilesLines
* [gdb/testsuite] Fix gdb.base/readline.exp with stub-termcapTom de Vries2023-04-291-22/+35
| | | | | | | | | | | | | | | | | | | When doing a build which uses stub-termcap, we run into: ... (gdb) set width 7 <b) FAIL: gdb.base/readline.exp: set width 7 (timeout) ... Since readline can't detect very basic terminal support, it falls back on horizontal scrolling. Fix this by detecting the horizontal scrolling case, and skipping the subsequent test. Tested on x86_64-linux. PR testsuite/30400 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30400
* gdb: add test for readline handling very long commandsAndrew Burgess2023-02-111-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test added in this commit tests for a long fixed readline issue relating to long command lines. A similar patch has existed in the Fedora GDB tree for several years, but I don't see any reason why this test would not be suitable for inclusion in upstream GDB. I've updated the patch to current testsuite standards. The test is checking for an issue that was fixed by this readline patch: https://lists.gnu.org/archive/html/bug-readline/2006-11/msg00002.html Which was merged into readline 6.0 (released ~2010). The issue was triggered when the user enters a long command line, which wrapped over multiple terminal lines. The crash looks like this: free(): invalid pointer Fatal signal: Aborted ----- Backtrace ----- 0x4fb583 gdb_internal_backtrace_1 ../../src/gdb/bt-utils.c:122 0x4fb583 _Z22gdb_internal_backtracev ../../src/gdb/bt-utils.c:168 0x6047b9 handle_fatal_signal ../../src/gdb/event-top.c:964 0x7f26e0cc56af ??? 0x7f26e0cc5625 ??? 0x7f26e0cae8d8 ??? 0x7f26e0d094be ??? 0x7f26e0d10aab ??? 0x7f26e0d124ab ??? 0x7f26e1d32e12 rl_free_undo_list ../../readline-5.2/undo.c:119 0x7f26e1d229eb readline_internal_teardown ../../readline-5.2/readline.c:405 0x7f26e1d3425f rl_callback_read_char ../../readline-5.2/callback.c:197 0x604c0d gdb_rl_callback_read_char_wrapper_noexcept ../../src/gdb/event-top.c:192 0x60581d gdb_rl_callback_read_char_wrapper ../../src/gdb/event-top.c:225 0x60492f stdin_event_handler ../../src/gdb/event-top.c:545 0xa60015 gdb_wait_for_event ../../src/gdbsupport/event-loop.cc:694 0xa6078d gdb_wait_for_event ../../src/gdbsupport/event-loop.cc:593 0xa6078d _Z16gdb_do_one_eventi ../../src/gdbsupport/event-loop.cc:264 0x6fc459 start_event_loop ../../src/gdb/main.c:411 0x6fc459 captured_command_loop ../../src/gdb/main.c:471 0x6fdce4 captured_main ../../src/gdb/main.c:1310 0x6fdce4 _Z8gdb_mainP18captured_main_args ../../src/gdb/main.c:1325 0x44f694 main ../../src/gdb/gdb.c:32 --------------------- I recreated the above crash by a little light hacking on GDB, and then linking GDB against readline 5.2. The above stack trace was generated from the test included in this patch, and matches the trace that was included in the original bug report. It is worth acknowledging that without hacking things GDB has a minimum requirement of readline 7.0. This test is not about checking whether GDB has been built against an older version of readline, it is about checking that readline doesn't regress in this area. Reviewed-By: Tom Tromey <tom@tromey.com>
* Use clean_restart in gdb.baseTom Tromey2023-01-261-3/+1
| | | | | | | Change gdb.base to use clean_restart more consistently.
* Update copyright year range in header of all files managed by GDBJoel Brobecker2023-01-011-1/+1
| | | | | | | This commit is the result of running the gdb/copyright.py script, which automated the update of the copyright year range for all source files managed by the GDB project to be updated to include year 2023.
* gdb/readline: fix extra 'quit' message problemAndrew Burgess2022-05-071-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After these two commits: commit 4fb7bc4b147fd30b781ea2dad533956d0362295a Date: Mon Mar 7 13:49:21 2022 +0000 readline: back-port changes needed to properly detect EOF commit 91395d97d905c31ac38513e4aaedecb3b25e818f Date: Tue Feb 15 17:28:03 2022 +0000 gdb: handle bracketed-paste-mode and EOF correctly It was observed that, if a previous command is selected at the readline prompt using the up arrow key, then when the command is accepted (by pressing return) an unexpected 'quit' message will be printed by GDB. Here's an example session: (gdb) p 123 $1 = 123 (gdb) p 123 quit $2 = 123 (gdb) In this session the second 'p 123' was entered not by typing 'p 123', but by pressing the up arrow key to select the previous command. It is important that the up arrow key is used, typing Ctrl-p will not trigger the bug. The problem here appears to be readline's EOF detection when handling multi-character input sequences. I have raised this issue on the readline mailing list here: https://lists.gnu.org/archive/html/bug-readline/2022-04/msg00012.html a solution has been proposed here: https://lists.gnu.org/archive/html/bug-readline/2022-04/msg00016.html This patch includes a test for this issue as well as a back-port of (the important bits of) readline commit: commit 2ef9cec8c48ab1ae3a16b1874a49bd1f58eaaca1 Date: Wed May 4 11:18:04 2022 -0400 fix for setting RL_STATE_EOF in callback mode That commit also includes some updates to the readline documentation and tests that I have not included in this commit. With this commit in place the unexpected 'quit' messages are resolved.
* gdb/testsuite: Remove duplicates from gdb.base/readline.expLancelot SIX2022-01-071-1/+1
| | | | | | | | | | | | When running the testsuite, I have: Running .../gdb/testsuite/gdb.base/readline.exp ... DUPLICATE: gdb.base/readline.exp: Simple operate-and-get-next - final prompt Fix by adjusting the prefix given to the second 'simple' call to operate_and_get_next. Tested on x86_64-linux.
* Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker2022-01-011-1/+1
| | | | | | | | This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
* Update copyright year range in all GDB filesJoel Brobecker2021-01-011-1/+1
| | | | | | | | | This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
* Update copyright year range in all GDB files.Joel Brobecker2020-01-011-1/+1
| | | | | | gdb/ChangeLog: Update copyright year range in all GDB files.
* Update copyright year range in all GDB files.Joel Brobecker2019-01-011-1/+1
| | | | | | | | | | | | | | | | This commit applies all changes made after running the gdb/copyright.py script. Note that one file was flagged by the script, due to an invalid copyright header (gdb/unittests/basic_string_view/element_access/char/empty.cc). As the file was copied from GCC's libstdc++-v3 testsuite, this commit leaves this file untouched for the time being; a patch to fix the header was sent to gcc-patches first. gdb/ChangeLog: Update copyright year range in all GDB files.
* Change gdb test suite's TERM settingTom Tromey2018-12-281-45/+49
| | | | | | | | | | | | | | This changes the gdb test suite to set TERM to "dumb" by default. This setting disables terminal styling, so that the existing tests do not need to be updated. gdb/testsuite/ChangeLog 2018-12-28 Tom Tromey <tom@tromey.com> * lib/gdb.exp (gdb_init): Set the TERM environment variable to "dumb". * gdb.base/readline.exp (operate_and_get_next): Save and restore the TERM environment variable.
* Update copyright year range in all GDB filesJoel Brobecker2018-01-021-1/+1
| | | | | | gdb/ChangeLog: Update copyright year range in all GDB files
* update copyright year range in GDB filesJoel Brobecker2017-01-011-1/+1
| | | | | | | | | This applies the second part of GDB's End of Year Procedure, which updates the copyright year range in all of GDB's files. gdb/ChangeLog: Update copyright year range in all GDB files.
* GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker2016-01-011-1/+1
| | | | | | gdb/ChangeLog: Update year range in copyright notice of all files.
* Use save_vars to replace existing manipulation of globals in testsPatrick Palka2015-08-121-57/+37
| | | | | | | | | | | gdb/testsuite/ChangeLog: * gdb.base/gdbhistsize-history.exp (test_histsize_history_setting): Use save_vars. * gdb.base/gdbinit-history.exp (test_gdbinit_history_setting): Use save_vars. (test_no_truncation_of_unlimited_history_file): Use save_vars. * gdb.base/readline.exp: Use save_vars.
* Read $GDBHISTSIZE instead of $HISTSIZEPatrick Palka2015-06-171-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The HISTSIZE environment variable is generally expected to be read by shells, not by applications. Some distros for example globally export HISTSIZE in /etc/profile -- with the intention that it only affects shells -- and by doing so it renders useless GDB's own mechanism for setting the history size via .gdbinit. Also, annoyances may arise when HISTSIZE is not interpreted the same way by the shell and by GDB, e.g. PR gdb/16999. That can always be fixed on a shell-by-shell basis but it may be impossible to be consistent with the behavior of all shells at once. Finally it just makes sense to not confound shell environment variables with application environment variables. gdb/ChangeLog: * NEWS: Mention that GDBHISTSIZE is read instead of HISTSIZE. * top.c (init_history): Read from GDBHISTSIZE instead of HISTSIZE. (init_main): Refer to GDBHISTSIZE instead of HISTSIZE. gdb/doc/ChangeLog: * gdb.texinfo (Command History): Replace occurrences of HISTSIZE with GDBHISTSIZE. gdb/testsuite/ChangeLog: * gdb.base/gdbinit-history.exp: Replace occurrences of HISTSIZE with GDBHISTSIZE. * gdb.base/readline.exp: Likewise.
* Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker2015-01-011-1/+1
| | | | | | gdb/ChangeLog: Update year range in copyright notice of all files.
* Skip tests on completion and readline when readline lib isn't usedYao Qi2014-03-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The completion feature and other features on readline depend on the readline library. However, readline library is not always used, for example, running testsuite like make check RUNTESTFLAGS="--host_board=local-remote-host" the input stream is not a tty, and GDB doesn't use readline library as a result. This patch is to skip tests on completion and readline if 'show editing' is off, which means readline isn't used. Note that some tests in gdb.base/completion.exp test command complete, which isn't related to readline, so these tests aren't affected by readline library. This patch also moves these tests up, run them unconditionally, and run the rest if readline library is used. gdb/testsuite: 2014-03-26 Yao Qi <yao@codesourcery.com> * lib/gdb.exp (readline_is_used): New proc. * gdb.base/completion.exp: Move tests on command complete up. Skip the rest of tests if readline is not used. * gdb.ada/complete.exp: Skp the test if readline is not used. * gdb.base/filesym.exp: Likewise. * gdb.base/macscp.exp: Likewise. * gdb.base/readline-ask.exp: Likewise. * gdb.base/readline.exp: Likewise. * gdb.python/py-cmd.exp: Likewise. * gdb.trace/tfile.exp: Likewise.
* Update Copyright year range in all files maintained by GDB.Joel Brobecker2014-01-011-1/+1
|
* Update years in copyright notice for the GDB files.Joel Brobecker2013-01-011-1/+1
| | | | | | | Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.
* 2012-01-16 Pedro Alves <palves@redhat.com>Pedro Alves2012-01-161-4/+0
| | | | Remove all calls to strace.
* Copyright year update in most files of the GDB Project.Joel Brobecker2012-01-041-2/+1
| | | | | | gdb/ChangeLog: Copyright year update in most files of the GDB Project.
* run copyright.sh for 2011.Joel Brobecker2011-01-011-1/+2
|
* 2010-06-08 Michael Snyder <msnyder@vmware.com>Michael Snyder2010-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gdb.ada/exec_changed.exp: Use ".*" instead of "" as wildcard regexp. * gdb.base/async.exp: Use ".*" instead of "" as wildcard regexp. * gdb.base/call-ar-st.exp: Ditto. * gdb.base/checkpoint.exp: Ditto. * gdb.base/default.exp: Ditto. * gdb.base/dump.exp: Ditto. * gdb.base/ending-run.exp: Ditto. * gdb.base/fileio.exp: Ditto. * gdb.base/miscexprs.exp: Ditto. * gdb.base/pointers.exp: Ditto. * gdb.base/readline.exp: Ditto. * gdb.base/reread.exp: Ditto. * gdb.base/restore.exp: Ditto. * gdb.base/shlib-call.exp: Ditto. * gdb.base/valgrind-db-attach.exp: Ditto. * gdb.base/volatile.exp: Ditto. * gdb.base/watchpoints.exp: Ditto. * gdb.cp/classes.exp: Use ".*" instead of "" as wildcard regexp. * gdb.python/py-frame.exp: Use ".*" instead of "" as wildcard regexp. * gdb.python/py-value.exp: Ditto. * gdb.trace/backtrace.exp: Use ".*" instead of "" as wildcard regexp. * gdb.trace/circ.exp: Ditto. * gdb.trace/collection.exp: Ditto. * gdb.trace/packetlen.exp: Ditto. * gdb.trace/passc-dyn.exp: Ditto. * gdb.trace/report.exp: Ditto. * gdb.trace/tfile.exp: Ditto. * gdb.trace/tfind.exp: Ditto. * gdb.trace/while-dyn.exp: Ditto.
* Update copyright year in most headers.Joel Brobecker2010-01-011-1/+1
| | | | Automatic update by copyright.sh.
* gdb/testsuite/Jan Kratochvil2009-07-131-25/+0
| | | | | | | | | Fix gdb.base/macscp.exp when using custom inputrc. * gdb.base/completion.exp: Remove env(INPUTRC) set and restore. * gdb.base/readline.exp: Remove env(INPUTRC) set and restore. Remove env(TERM) set. * gdb.cp/cpcompletion.exp: Remove env(INPUTRC) set. * lib/gdb.exp (default_gdb_start): Add env(INPUTRC) and env(TERM) set.
* Updated copyright notices for most files.Joel Brobecker2009-01-031-1/+1
|
* Fix for PR gdb/1543.Jan Kratochvil2008-08-061-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gdb.base/sep.exp: `sep-proc.c' absolute line numbers replaced with $LOCATION. (location): New variable. * config/cfdbug.exp, config/d10v.exp, config/dve.exp, config/i960.exp, config/m32r.exp, config/mn10300-eval.exp, config/proelf.exp, config/rom68k.exp, config/sh.exp, config/unix.exp, config/vr4300.exp, config/vr5000.exp, config/vxworks.exp, gdb.arch/altivec-regs.exp, gdb.arch/e500-abi.exp, gdb.arch/e500-regs.exp, gdb.asm/asm-source.exp, gdb.base/a2-run.exp, gdb.base/advance.exp, gdb.base/all-bin.exp, gdb.base/args.exp, gdb.base/arithmet.exp, gdb.base/assign.exp, gdb.base/async.exp, gdb.base/auxv.exp, gdb.base/bigcore.c, gdb.base/bigcore.exp, gdb.base/bitfields.exp, gdb.base/bitops.exp, gdb.base/break.c, gdb.base/break.exp, gdb.base/break1.c, gdb.base/call-ar-st.exp, gdb.base/call-rt-st.exp, gdb.base/call-strs.exp, gdb.base/callfuncs.c, gdb.base/callfuncs.exp, gdb.base/checkpoint.exp, gdb.base/chng-syms.exp, gdb.base/code-expr.exp, gdb.base/commands.exp, gdb.base/completion.exp, gdb.base/complex.exp, gdb.base/cond-expr.exp, gdb.base/condbreak.exp, gdb.base/consecutive.exp, gdb.base/corefile.exp, gdb.base/cvexpr.c, gdb.base/cvexpr.exp, gdb.base/dbx.exp, gdb.base/default.exp, gdb.base/define.exp, gdb.base/del.c, gdb.base/detach.exp, gdb.base/display.exp, gdb.base/dump.exp, gdb.base/echo.exp, gdb.base/environ.exp, gdb.base/eval-skip.exp, gdb.base/exprs.exp, gdb.base/fileio.exp, gdb.base/find.exp, gdb.base/finish.exp, gdb.base/funcargs.exp, gdb.base/gcore-buffer-overflow.exp, gdb.base/gcore.exp, gdb.base/gdb1555.exp, gdb.base/gdbvars.exp, gdb.base/help.exp, gdb.base/huge.exp, gdb.base/info-proc.exp, gdb.base/interrupt.exp, gdb.base/jump.exp, gdb.base/langs.exp, gdb.base/lineinc.exp, gdb.base/list.exp, gdb.base/macscp.exp, gdb.base/maint.exp, gdb.base/mips_pro.exp, gdb.base/miscexprs.exp, gdb.base/nodebug.exp, gdb.base/nofield.c, gdb.base/opaque.exp, gdb.base/overlays.exp, gdb.base/page.exp, gdb.base/pc-fp.exp, gdb.base/pending.c, gdb.base/pendshr.c, gdb.base/pointers.exp, gdb.base/psymtab.exp, gdb.base/ptype.exp, gdb.base/randomize.c, gdb.base/readline.exp, gdb.base/recurse.exp, gdb.base/regs.exp, gdb.base/relational.exp, gdb.base/relocate.exp, gdb.base/remote.exp, gdb.base/reread.exp, gdb.base/return.exp, gdb.base/return2.exp, gdb.base/scope.exp, gdb.base/sect-cmd.exp, gdb.base/sep-proc.c, gdb.base/sep.c, gdb.base/sep.exp, gdb.base/sepdebug.c, gdb.base/sepdebug.exp, gdb.base/setshow.exp, gdb.base/shlib-call.exp, gdb.base/sigaltstack.c, gdb.base/so-indr-cl.exp, gdb.base/solib.exp, gdb.base/source.exp, gdb.base/start.c, gdb.base/step-bt.c, gdb.base/step-line.exp, gdb.base/structs.c, gdb.base/structs.exp, gdb.base/structs2.exp, gdb.base/term.exp, gdb.base/twice.exp, gdb.base/type-opaque.exp, gdb.base/until.exp, gdb.base/value-double-free.c, gdb.base/varargs.exp, gdb.base/watchpoint.exp, gdb.base/whatis-exp.exp, gdb.disasm/am33.exp, gdb.disasm/h8300s.exp, gdb.disasm/hppa.exp, gdb.disasm/mn10300.exp, gdb.disasm/sh3.exp, gdb.disasm/t01_mov.exp, gdb.disasm/t02_mova.exp, gdb.disasm/t03_add.exp, gdb.disasm/t04_sub.exp, gdb.disasm/t05_cmp.exp, gdb.disasm/t06_ari2.exp, gdb.disasm/t07_ari3.exp, gdb.disasm/t08_or.exp, gdb.disasm/t09_xor.exp, gdb.disasm/t10_and.exp, gdb.disasm/t11_logs.exp, gdb.disasm/t12_bit.exp, gdb.disasm/t13_otr.exp, gdb.fortran/exprs.exp, gdb.fortran/types.exp, gdb.hp/gdb.aCC/exception.exp, gdb.hp/gdb.aCC/optimize.exp, gdb.hp/gdb.aCC/watch-cmd.exp, gdb.hp/gdb.base-hp/callfwmall.exp, gdb.hp/gdb.base-hp/dollar.exp, gdb.hp/gdb.base-hp/hwwatchbus.exp, gdb.hp/gdb.base-hp/pxdb.exp, gdb.hp/gdb.base-hp/reg-pa64.exp, gdb.hp/gdb.base-hp/reg.exp, gdb.hp/gdb.base-hp/sized-enum.exp, gdb.hp/gdb.base-hp/so-thresh.exp, gdb.hp/gdb.compat/xdb1.exp, gdb.hp/gdb.compat/xdb2.exp, gdb.hp/gdb.compat/xdb3.exp, gdb.java/jmisc.exp, gdb.java/jv-exp.exp, gdb.java/jv-print.exp, gdb.mi/gdb669.exp, gdb.mi/gdb680.exp, gdb.mi/gdb701.exp, gdb.mi/gdb792.exp, gdb.mi/mi-basics.exp, gdb.mi/mi-console.exp, gdb.mi/mi-hack-cli.exp, gdb.mi/mi-pending.c, gdb.mi/mi-pendshr.c, gdb.mi/mi-pthreads.exp, gdb.mi/mi-read-memory.exp, gdb.mi/mi-regs.exp, gdb.mi/mi-syn-frame.exp, gdb.mi/mi-until.exp, gdb.mi/mi2-basics.exp, gdb.mi/mi2-console.exp, gdb.mi/mi2-hack-cli.exp, gdb.mi/mi2-pthreads.exp, gdb.mi/mi2-read-memory.exp, gdb.mi/mi2-regs.exp, gdb.mi/mi2-syn-frame.exp, gdb.mi/mi2-until.exp, gdb.pascal/types.exp, gdb.stabs/weird.exp, gdb.threads/gcore-thread.exp, gdb.threads/manythreads.exp, gdb.threads/print-threads.exp, gdb.threads/pthreads.exp, gdb.threads/schedlock.exp, gdb.threads/step.exp, gdb.threads/step2.exp, gdb.threads/switch-threads.exp, gdb.threads/thread-specific.exp, gdb.threads/thread_check.exp, gdb.threads/thread_events.exp, gdb.threads/tls-nodebug.exp, gdb.threads/tls-shared.exp, gdb.threads/tls.exp, gdb.trace/actions.exp, gdb.trace/backtrace.exp, gdb.trace/circ.exp, gdb.trace/collection.exp, gdb.trace/deltrace.exp, gdb.trace/infotrace.exp, gdb.trace/limits.exp, gdb.trace/packetlen.exp, gdb.trace/passc-dyn.exp, gdb.trace/passcount.exp, gdb.trace/report.exp, gdb.trace/save-trace.exp, gdb.trace/tfind.exp, gdb.trace/tracecmd.exp, gdb.trace/while-dyn.exp, gdb.trace/while-stepping.exp, lib/mi-support.exp, lib/trace-support.exp: Remove reference to bug-gdb@prep.ai.mit.edu .
* Updated copyright notices for most files.Daniel Jacobowitz2008-01-011-1/+1
|
* Switch the license of all .exp files to GPLv3.Joel Brobecker2007-08-231-5/+4
| | | | | Switch the license of all .f and .f90 files to GPLv3. Switch the license of all .s and .S files to GPLv3.
* * gdb.base/readline.exp (operate_and_get_next): Match the finalDaniel Jacobowitz2007-07-271-0/+3
| | | | prompt.
* 2007-01-03 Jan Kratochvil <jan.kratochvil@redhat.com>Daniel Jacobowitz2007-01-031-1/+21
| | | | | | | | | | | | | | | | | Daniel Jacobowitz <dan@codesourcery.com> * Makefile.in (top.o): Update. * top.c (gdb_readline_wrapper_done, gdb_readline_wrapper_result) (saved_after_char_processing_hook, gdb_readline_wrapper_line) (struct gdb_readline_wrapper_cleanup, gdb_readline_wrapper_cleanup): New. (gdb_readline_wrapper): Rewrite to use asynchronous readline. 2007-01-03 Jan Kratochvil <jan.kratochvil@redhat.com> Daniel Jacobowitz <dan@codesourcery.com> * gdb.base/readline.exp: Set $TERM. Test arrow keys in secondary prompts.
* * gdb.base/readline.exp: Add tests for operate-and-get-next with aMark Kettenis2003-06-081-1/+33
| | | | | fully filled history list. * gdb.base/gdb_history: New file.
* * gdb.base/readline.exp: New file.Tom Tromey2002-08-131-0/+190