* Patch for Hurd gdb bug
@ 1999-04-25 12:40 Mark Kettenis
1999-04-25 11:42 ` Mark Kettenis
1999-04-26 8:22 ` Jim Blandy
0 siblings, 2 replies; 3+ messages in thread
From: Mark Kettenis @ 1999-04-25 12:40 UTC (permalink / raw)
To: bug-gdb, gdb-patches
Hi,
The 19990412 snapshot compiles fine for the Hurd. Thanks for
integrating my patches! I'll try to track gdb development from now
on, on behalf of the Hurd developers.
Here is a patch for a nasty bug that makes it impossible to attach to
a crashed program. (The Hurd has this nice feature that it is possible
to suspend programs that crashed. You can then attach the debugger to
investigate why the program crashed. Very useful, especially since we
do not have core dumps yet.)
The problem is that inf_set_traced() ultimately calls
inf_validate_task_sc(), which under certain circumstances calls
target_terminal_inferior() to restore the terminal state. However
since the terminal state has not yet been saved (this happens after
gnu_attach() returns) this results in a segmentation fault.
I think calling target_terminal_init() in gnu_attach() is the most
effective and noninvasive way to solve the problem. At this point all
initializations that target_terminal_init() depends on have been
performed and calling target_terminal_init() twice seems to be no
problem.
Mark
1999-04-25 Mark Kettenis <kettenis@gnu.org>
* gnu-nat.c (gnu_attach): Call target_terminal_init before calling
inf_set_traced, since that function calls code that might try to
restore the terminal settings.
--- /home/kettenis/tmp/gdb-19990412/gdb/gnu-nat.c Sat Apr 3 01:11:56 1999
+++ gdb-19990412/gdb/gnu-nat.c Sun Apr 25 15:54:22 1999
@@ -2004,6 +2004,10 @@
attach_flag = 1;
push_target (&gnu_ops);
+ /* We have to initialize the terminal settings now, since the code
+ below might try to restore them. */
+ target_terminal_init ();
+
inf_update_signal_thread (inf);
inf_set_traced (inf, inf->want_signals);
From jimb@cygnus.com Mon Apr 26 09:32:00 1999
From: Jim Blandy <jimb@cygnus.com>
To: Mark Kettenis <kettenis@wins.uva.nl>
Cc: gdb-patches@cygnus.com, bug-gdb@cugnus.com
Subject: Re: Patch for Hurd gdb bug
Date: Mon, 26 Apr 1999 09:32:00 -0000
Message-id: <nppv4rpftg.fsf@zwingli.cygnus.com>
References: <199904251843.UAA00144@delius.kettenis.nl>
X-SW-Source: 1999-04/msg00044.html
Content-length: 725
Mark Kettenis <kettenis@wins.uva.nl> writes:
> Here is a patch for a nasty bug that makes it impossible to attach to
> a crashed program. (The Hurd has this nice feature that it is possible
> to suspend programs that crashed. You can then attach the debugger to
> investigate why the program crashed. Very useful, especially since we
> do not have core dumps yet.)
Thanks for the fix! It should be in future snapshots (although it
will not be in 4.18.1).
1999-04-26 Jim Blandy <jimb@zwingli.cygnus.com>
1999-04-25 Mark Kettenis <kettenis@gnu.org>
* gnu-nat.c (gnu_attach): Call target_terminal_init before calling
inf_set_traced, since that function calls code that might try to
restore the terminal settings.
From assign@gnu.org Thu Apr 01 00:00:00 1999
From: assignments <assign@gnu.org>
To: gdb-patches@cygnus.com
Subject: GDB
Date: Thu, 01 Apr 1999 00:00:00 -0000
Message-id: <199902121721.MAA17106@delysid.gnu.org>
X-SW-Source: 1999-q1/msg00039.html
Content-length: 606
The following disclaimers and/or assignments concerning GDB
have recently been added to the file copyright.list here at the
Free Software Foundation. If you have any questions or corrections,
please send them to my general work address, 3diff@gnu.org.
Thanks!
Brian Youmans
Assignments Clerk
GDB BFD MMALLOC OPCODES Apple Computer, Inc. 1999-01-22
Assigns past and future changes.
GDB Robert Hohne Germany 1968 1999-01-26
Assigns past and future changes.
robert.hoehne@gmx.net
^ permalink raw reply [flat|nested] 3+ messages in thread* Patch for Hurd gdb bug
1999-04-25 12:40 Patch for Hurd gdb bug Mark Kettenis
@ 1999-04-25 11:42 ` Mark Kettenis
1999-04-26 8:22 ` Jim Blandy
1 sibling, 0 replies; 3+ messages in thread
From: Mark Kettenis @ 1999-04-25 11:42 UTC (permalink / raw)
To: bug-gdb, gdb-patches
Hi,
The 19990412 snapshot compiles fine for the Hurd. Thanks for
integrating my patches! I'll try to track gdb development from now
on, on behalf of the Hurd developers.
Here is a patch for a nasty bug that makes it impossible to attach to
a crashed program. (The Hurd has this nice feature that it is possible
to suspend programs that crashed. You can then attach the debugger to
investigate why the program crashed. Very useful, especially since we
do not have core dumps yet.)
The problem is that inf_set_traced() ultimately calls
inf_validate_task_sc(), which under certain circumstances calls
target_terminal_inferior() to restore the terminal state. However
since the terminal state has not yet been saved (this happens after
gnu_attach() returns) this results in a segmentation fault.
I think calling target_terminal_init() in gnu_attach() is the most
effective and noninvasive way to solve the problem. At this point all
initializations that target_terminal_init() depends on have been
performed and calling target_terminal_init() twice seems to be no
problem.
Mark
1999-04-25 Mark Kettenis <kettenis@gnu.org>
* gnu-nat.c (gnu_attach): Call target_terminal_init before calling
inf_set_traced, since that function calls code that might try to
restore the terminal settings.
--- /home/kettenis/tmp/gdb-19990412/gdb/gnu-nat.c Sat Apr 3 01:11:56 1999
+++ gdb-19990412/gdb/gnu-nat.c Sun Apr 25 15:54:22 1999
@@ -2004,6 +2004,10 @@
attach_flag = 1;
push_target (&gnu_ops);
+ /* We have to initialize the terminal settings now, since the code
+ below might try to restore them. */
+ target_terminal_init ();
+
inf_update_signal_thread (inf);
inf_set_traced (inf, inf->want_signals);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Patch for Hurd gdb bug
1999-04-25 12:40 Patch for Hurd gdb bug Mark Kettenis
1999-04-25 11:42 ` Mark Kettenis
@ 1999-04-26 8:22 ` Jim Blandy
1 sibling, 0 replies; 3+ messages in thread
From: Jim Blandy @ 1999-04-26 8:22 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches, bug-gdb
Mark Kettenis <kettenis@wins.uva.nl> writes:
> Here is a patch for a nasty bug that makes it impossible to attach to
> a crashed program. (The Hurd has this nice feature that it is possible
> to suspend programs that crashed. You can then attach the debugger to
> investigate why the program crashed. Very useful, especially since we
> do not have core dumps yet.)
Thanks for the fix! It should be in future snapshots (although it
will not be in 4.18.1).
1999-04-26 Jim Blandy <jimb@zwingli.cygnus.com>
1999-04-25 Mark Kettenis <kettenis@gnu.org>
* gnu-nat.c (gnu_attach): Call target_terminal_init before calling
inf_set_traced, since that function calls code that might try to
restore the terminal settings.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1999-04-26 8:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-25 12:40 Patch for Hurd gdb bug Mark Kettenis
1999-04-25 11:42 ` Mark Kettenis
1999-04-26 8:22 ` Jim Blandy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox