diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2003-04-08 18:52:04 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2003-04-08 18:52:04 +0000 |
commit | c54cfec8d4215ef2b4f8019a3431749b44ee0247 (patch) | |
tree | 1a427559c4b7a76401c704d73cdee043ddb44d36 /gdb/inferior.h | |
parent | 9cc92a36ed6e61f930a367557dc8e92dcdda5a79 (diff) | |
download | gdb-c54cfec8d4215ef2b4f8019a3431749b44ee0247.zip gdb-c54cfec8d4215ef2b4f8019a3431749b44ee0247.tar.gz gdb-c54cfec8d4215ef2b4f8019a3431749b44ee0247.tar.bz2 |
2003-04-08 Elena Zannoni <ezannoni@redhat.com>
* infrun.c (stop_soon_quietly): Make it an enum, to better
override the default behavior of handle_inferior_event.
(clear_proceed_status): Update uses of stop_soon_quietly to
reflect that it is now an enum.
(start_remote): Ditto.
(handle_inferior_event): Change logic a bit if stop_soon_quietly
is set to handle the new GNU/Linux kernel behavior for
attach/sigstop. Update uses of stop_soon_quietly.
* inferior.h (enum stop_kind): New enum.
* infcmd.c (attach_command): Use STOP_QUIETLY_NO_SIGSTOP.
Reset normal handle_inferior_event behavior, afterwards.
* fork-child.c (startup_inferior): Update.
* alpha-tdep.c (heuristic_proc_start): Update.
* solib-svr4.c (svr4_solib_create_inferior_hook): Update.
* solib-sunos.c (sunos_solib_create_inferior_hook): Update.
* solib-osf.c (osf_solib_create_inferior_hook): Update.
* solib-irix.c (irix_solib_create_inferior_hook): Update.
* remote-vx.c (vx_create_inferior): Update.
* mips-tdep.c (heuristic_proc_start): Update.
Diffstat (limited to 'gdb/inferior.h')
-rw-r--r-- | gdb/inferior.h | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/gdb/inferior.h b/gdb/inferior.h index ae041f2..3488597 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -390,12 +390,37 @@ extern enum step_over_calls_kind step_over_calls; extern int step_multi; -/* Nonzero means expecting a trap and caller will handle it themselves. - It is used after attach, due to attaching to a process; - when running in the shell before the child program has been exec'd; - and when running some kinds of remote stuff (FIXME?). */ +/* Nonzero means expecting a trap and caller will handle it + themselves. It is used when running in the shell before the child + program has been exec'd; and when running some kinds of remote + stuff (FIXME?). */ + +/* It is also used after attach, due to attaching to a process. This + is a bit trickier. When doing an attach, the kernel stops the + debuggee with a SIGSTOP. On newer GNU/Linux kernels (>= 2.5.61) + the handling of SIGSTOP for a ptraced process has changed. Earlier + versions of the kernel would ignore these SIGSTOPs, while now + SIGSTOP is treated like any other signal, i.e. it is not muffled. + + If the gdb user does a 'continue' after the 'attach', gdb passes + the global variable stop_signal (which stores the signal from the + attach, SIGSTOP) to the ptrace(PTRACE_CONT,...) call. This is + problematic, because the kernel doesn't ignore such SIGSTOP + now. I.e. it is reported back to gdb, which in turn presents it + back to the user. + + To avoid the problem, we use STOP_QUIETLY_NO_SIGSTOP, which allows + gdb to clear the value of stop_signal after the attach, so that it + is not passed back down to the kernel. */ + +enum stop_kind + { + NO_STOP_QUIETLY = 0, + STOP_QUIETLY, + STOP_QUIETLY_NO_SIGSTOP + }; -extern int stop_soon_quietly; +extern enum stop_kind stop_soon_quietly; /* Nonzero if proceed is being used for a "finish" command or a similar situation when stop_registers should be saved. */ |