public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/17694] New: Terminal isn't properly restored after the change to rl_callback functions
@ 2014-12-10 12:23 terry.guo at arm dot com
  2014-12-10 12:24 ` [Bug gdb/17694] " terry.guo at arm dot com
  0 siblings, 1 reply; 2+ messages in thread
From: terry.guo at arm dot com @ 2014-12-10 12:23 UTC (permalink / raw)
  To: gdb-prs

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 <palves@redhat.com>
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
<<snip it for the sake of simplicity>>
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
<<snip it for the sake of simplicity>>
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
<<<snip it>>>
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
<<snip it>>
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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug gdb/17694] Terminal isn't properly restored after the change to rl_callback functions
  2014-12-10 12:23 [Bug gdb/17694] New: Terminal isn't properly restored after the change to rl_callback functions terry.guo at arm dot com
@ 2014-12-10 12:24 ` terry.guo at arm dot com
  0 siblings, 0 replies; 2+ messages in thread
From: terry.guo at arm dot com @ 2014-12-10 12:24 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17694

Terry Guo <terry.guo at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |palves at redhat dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-10 12:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-10 12:23 [Bug gdb/17694] New: Terminal isn't properly restored after the change to rl_callback functions terry.guo at arm dot com
2014-12-10 12:24 ` [Bug gdb/17694] " terry.guo at arm dot com

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).