public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug tui/16138] TUI commands when run from emacs exit gdb complaining "Error opening terminal: emacs" Date: Wed, 29 Oct 2014 14:34:00 -0000 [thread overview] Message-ID: <bug-16138-4717-QGfACFcVg3@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-16138-4717@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=16138 --- Comment #12 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> --- This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gdb and binutils". The branch, master has been updated via 84eda397bcf3ebea00383e4a6a864af59723dafd (commit) from 563e8d85161198df8a13de4bc660a047305458c9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=84eda397bcf3ebea00383e4a6a864af59723dafd commit 84eda397bcf3ebea00383e4a6a864af59723dafd Author: Pedro Alves <palves@redhat.com> Date: Wed Oct 29 14:23:57 2014 +0000 PR tui/16138, PR tui/17519, and misc failures to initialize the terminal PR tui/16138 is about failure to initialize curses resulting in GDB exiting instead of throwing an error. E.g.: $ TERM=foo gdb (gdb) layout asm Error opening terminal: foo. $ The problem is that we're calling initscr to initialize the screen. As mentioned in http://pubs.opengroup.org/onlinepubs/7908799/xcurses/initscr.html: If errors occur, initscr() writes an appropriate error message to standard error and exits. ^^^^^ Instead, we should use newterm: "A program that needs an indication of error conditions, so it can continue to run in a line-oriented mode if the terminal cannot support a screen-oriented program, would also use this function." After the patch: $ TERM=foo gdb -q -nx (gdb) layout asm Cannot enable the TUI: error opening terminal [TERM=foo] (gdb) And then PR tui/17519 is about GDB not validating whether the terminal has the necessary capabilities when enabling the TUI. If one tries to enable the TUI with TERM=dumb (and e.g., from a shell within emacs), GDB ends up with a clear screen, the cursor is placed at the bottom/right corner of the screen, there's no prompt, typing shows no echo, and there's no indication of what's going on. c-x,a gets you out of the TUI, but it's completely non-obvious. After the patch, we get: $ TERM=dumb gdb -q -nx (gdb) layout asm Cannot enable the TUI: terminal doesn't support cursor addressing [TERM=dumb] (gdb) While at it, I've moved all the tui_allowed_p validation to tui_enable, and expanded the error messages. Previously we'd get: $ gdb -q -nx -i=mi (gdb) layout asm &"layout asm\n" &"TUI mode not allowed\n" ^error,msg="TUI mode not allowed" and: $ gdb -q -nx -ex "layout asm" > foo TUI mode not allowed While now we get: $ gdb -q -nx -i=mi (gdb) layout asm &"layout asm\n" &"Cannot enable the TUI when the interpreter is 'mi'\n" ^error,msg="Cannot enable the TUI when the interpreter is 'mi'" (gdb) and: $ gdb -q -nx -ex "layout asm" > foo Cannot enable the TUI when output is not a terminal Tested on x86_64 Fedora 20. gdb/ 2014-10-29 Pedro Alves <palves@redhat.com> PR tui/16138 PR tui/17519 * tui/tui-interp.c (tui_is_toplevel): Delete global. (tui_allowed_p): Delete function. * tui/tui.c: Include "interps.h". (tui_enable): Don't use tui_allowed_p. Error out here with detailed error messages if the TUI is the top level interpreter, or if output is not a terminal. Use newterm instead of initscr, and error out if initializing the terminal fails. Also error out if the terminal doesn't support cursor addressing. * tui/tui.h (tui_allowed_p): Delete declaration. ----------------------------------------------------------------------- Summary of changes: gdb/tui/tui-interp.c | 17 ---------------- gdb/tui/tui.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++--- gdb/tui/tui.h | 4 --- 3 files changed, 49 insertions(+), 25 deletions(-) -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2014-10-29 14:34 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-11-07 16:33 [Bug tui/16138] New: layout asm when run from emacs exits " xdje42 at gmail dot com 2013-11-11 11:36 ` [Bug tui/16138] " palves at redhat dot com 2013-11-11 11:36 ` palves at redhat dot com 2013-11-12 4:47 ` xdje42 at gmail dot com 2013-11-12 9:49 ` palves at redhat dot com 2013-11-12 9:52 ` palves at redhat dot com 2013-11-12 10:17 ` palves at redhat dot com 2013-11-23 20:28 ` xdje42 at gmail dot com 2013-11-25 9:26 ` [Bug tui/16138] TUI commands when run from emacs exit " palves at redhat dot com 2013-11-25 9:26 ` [Bug tui/16138] layout asm when run from emacs exits " palves at redhat dot com 2013-12-15 21:40 ` [Bug tui/16138] TUI commands when run from emacs exit " b.r.longbons at gmail dot com 2013-12-16 9:54 ` palves at redhat dot com 2013-12-18 1:42 ` b.r.longbons at gmail dot com 2014-10-29 14:34 ` cvs-commit at gcc dot gnu.org [this message] 2014-10-29 14:52 ` cvs-commit at gcc dot gnu.org 2014-10-29 14:53 ` palves at redhat dot com 2014-12-25 0:46 ` cvs-commit at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-16138-4717-QGfACFcVg3@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).