From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14719 invoked by alias); 10 Dec 2014 12:23:36 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 14695 invoked by uid 48); 10 Dec 2014 12:23:36 -0000 From: "terry.guo at arm dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/17694] New: Terminal isn't properly restored after the change to rl_callback functions Date: Wed, 10 Dec 2014 12:23:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: terry.guo at arm dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q4/txt/msg00358.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17694 Bug ID: 17694 Summary: Terminal isn't properly restored after the change to rl_callback functions Product: gdb Version: HEAD Status: NEW Severity: critical Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: terry.guo at arm dot com Hi there, I am working on Ubuntu 12.04 64bit and using gdb trunk for arm-none-eabi target. Before this change: commit cbd6f6bf80881be4628622e369baafb337589578 Author: Pedro Alves Date: Thu Oct 23 17:13:35 2014 +0100 PR python/17372 - Python hangs when displaying help() This is more of a readline/terminal issue than a Python one. My command "arm-none-eabi-gdb -x gdb.cmd coremark.axf" works fine and I can get back to a normal terminal. Now with above change, after the execution of same command, the terminal is abnormal, I can't see what I typed, but I can see the results of typed command. Looks to me the echo feature of terminal isn't properly restored. I have to use shell 'reset' command to reset the terminal. However everything works fine if I source my script gdb.cmd in gdb terminal manually. This is an embedded project running on a small SOC board. I am sorry that I can't provide a test case. But I compared how those gdb_rl_callback_handler_* functions are called in above two different calling methods. Hope this can help you to understand the issue. Please let me know if further information is needed. First thing: before above change, the readline rl_callback_handler* functions are never called in my case. I just insert printf function into those functions and never see the output. So I assume they are not called. Now with above change, I insert three printf functions into new gdb_rl_callback_handler_* functions. With command "arm-none-eabi-gdb -x gdb.cmd coremark.axf", I got: arm-none-eabi-gdb -x g.cmd coremark.axf GNU gdb (GDB) 7.8.1.20141210-cvs <> Semihosting disabled. Breakpoint 1 at 0xa8 Note: automatically using hardware breakpoints for read-only addresses. Breakpoint 1, 0x000000a8 in _start () ------I am in gdb_rl_callback_handler_reinstall function and the condition is true ------I am in gdb_rl_callback_handler_install function Semihosting enabled. Breakpoint 2 at 0x6258 <> Correct operation validated. See readme.txt for run and reporting rules. Breakpoint 2, 0x00006258 in _exit () Program received signal SIGQUIT, Quit. 0x0000626c in _kill () Now the command is finished and I am in terminal, but I can't see what I typed. But if I manually source the gdb.cmd in gdb terminal, I got: arm-none-eabi-gdb coremark.axf GNU gdb (GDB) 7.8.1.20141210-cvs <<>> Reading symbols from coremark.axf...(no debugging symbols found)...done. ------I am in gdb_rl_callback_handler_remove function ------I am in gdb_rl_callback_handler_install function (gdb) source g.cmd 0x0000626c in _kill () Semihosting disabled. Breakpoint 1 at 0xa8 Note: automatically using hardware breakpoints for read-only addresses. Breakpoint 1, 0x000000a8 in _start () Semihosting enabled. Breakpoint 2 at 0x6258 <> Breakpoint 2, 0x00006258 in _exit () Program received signal SIGQUIT, Quit. 0x0000626c in _kill () Now the command is finished and I am in terminal. Everything is fine. -- You are receiving this mail because: You are on the CC list for the bug.