This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: continuations and breakpoint commands


A Wednesday 30 April 2008 15:41:40, Pierre Muller wrote:
> >> Just a minor gotcha:
> >>
> >> -      /* If the continuation did not start the target again,
> >> -        prepare for interation with the user.  */
> >> +      /* If no breakpoint command resumed the inferior, prepare for
> >> +        >>interation<< with the user.  */
> >>
> >> Is "interation" supposed to be "interaction"?
> >
> >Yep.  Thanks for spotting that.  We're going to display the prompt
> >so the user can enter commands, that's what it means.
> >
> >--
> >Pedro Alves
>
>   Hi Pedro,
>
>   I am confused, but it is probably because I didn't
> have time and courage to read the whole non-stop threads.
>
>   What happens if the user is currently typing some
> commands on prompt?

When the target supports async execution, and the exec
command was a background exec command (that is, continue& vs
continue; step& vs step), the user will be able to type
commands while the inferior is running.  If the target
supports async execution, but the exec command was
a foreground exec command (continue, next, step --
without an appended &), GDB will fake sync execution
by disabling stdin, transfering the terminal to the inferior
and not printing the prompt.  When the inferior stops, it needs
to print the prompt.  The user gets the same effect as
in a GDB where the target does not support async execution like so:

>/home/pedro/gdb/nonstop_head/build-32/gdb/gdb -ex "maint set 
linux-async" ./threads32
(gdb) r
Starting program: /home/pedro/gdb/tests/threads32
[Thread debugging using libthread_db enabled]
[New Thread 0xf7e27b90 (LWP 27641)]
[New Thread 0xf7626b90 (LWP 27642)]
any typed char is ignored by gdb   << enter
really                             << enter
                                   << ^C
Program received signal SIGINT, Interrupt.
[Switching to Thread 0x7f60629c96e0 (LWP 27505)]
0x00007f60625ba796 in pthread_join () from /lib/libpthread.so.0
(gdb)

>/home/pedro/gdb/nonstop_head/build-32/gdb/gdb -ex "maint set 
linux-async" ./threads32
(gdb) r&
Starting program: /home/pedro/gdb/tests/threads32
(gdb) [Thread debugging using libthread_db enabled]
[New Thread 0xf7d60b90 (LWP 27708)]
[New Thread 0xf755fb90 (LWP 27709)]
                                     << inferior is running, start typing,
(gdb) any char is ignored            << enter
Undefined command: "any".  Try "help".
(gdb)  

>   Are there two different prompts to let the
> user know if we are running or stopped?

No.

>   What happens to the already typed chars in the
> case of a prompt switch?
>

No sure I understood that.  When the inferior is running in
sync execution, any typed character goes to the inferior, while
in async execution the terminal stays with GDB and GDB interprets
any command you pass to it.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]