lkml.org 
[lkml]   [1997]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPatch for kernel 2.0.3x to fix debugger reparenting problem
After a grand total of 1 (one) person encouraged me, I
put together the following patch (which turned out to be
much easier than I had thought!)

Philip

--- kernel/exit.c.parent Mon Jul 14 18:17:07 1997
+++ kernel/exit.c Mon Jul 14 18:28:30 1997
@@ -532,11 +532,20 @@
while ((p = current->p_cptr) != NULL) {
current->p_cptr = p->p_osptr;
p->p_ysptr = NULL;
- p->flags &= ~(PF_PTRACED|PF_TRACESYS);
- if (task[smp_num_cpus] && task[smp_num_cpus] != current)
/* init */
- p->p_pptr = task[smp_num_cpus];
- else
- p->p_pptr = task[0];
+ if (p->flags & (PF_PTRACED | PF_TRACESYS)) {
+ /* If we are tracing, then the parent pointer
(which is the debugger)
+ * should be switched back to the original
parent (if it still
+ * exists). Happily 'forget_original_parent'
will zap the p_opptr
+ * field if the original parent has died, and
switch it to 'init'
+ */
+ p->flags &= ~(PF_PTRACED|PF_TRACESYS);
+ p->p_pptr = p->p_opptr;
+ } else {
+ if (task[smp_num_cpus] && task[smp_num_cpus] !=
current) /* init */
+ p->p_pptr = task[smp_num_cpus];
+ else
+ p->p_pptr = task[0];
+ }
p->p_osptr = p->p_pptr->p_cptr;
p->p_osptr->p_ysptr = p;
p->p_pptr->p_cptr = p;
--
Philip Gladstone +1 617 487 7700
Raptor Systems, Waltham, MA http://www.raptor.com/

\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.017 / U:1.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site