This is the mail archive of the gdb-patches@sourceware.cygnus.com 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]

RFC: Targets that do not call generic_mourn_inferior() ?


It seems to me that, except for very exceptional circustances, all
remote targets should be calling generic_mourn_inferior().  It does some
gdb cleanup that is necessary if the user ever reconnects to the target
within the same session.

An alternative is to have gdb forcifully calling this when unpushing a
target, but the current way is more flexible (and more error prone as
well).

Here is a patch for two targets that missed that call and act very silly
if one does a "I reg" or "bt" after reconnecting.

-- 
Fernando Nasser
Red Hat, Inc. - Toronto                 E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300           Tel:  416-482-2661 ext. 311
Toronto, Ontario   M4P 2C9              Fax:  416-482-6299


Index: remote-rdi.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-rdi.c,v
retrieving revision 1.2
diff -c -p -r1.2 remote-rdi.c
*** remote-rdi.c        2000/02/09 08:52:47     1.2
--- remote-rdi.c        2000/02/23 16:28:24
*************** arm_rdi_close (quitting)
*** 462,467 ****
--- 462,468 ----
        closed_already = 1;
        inferior_pid = 0;
        Adp_CloseDevice ();
+       generic_mourn_inferior ();
      }
  }
  
Index: remote-sim.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-sim.c,v
retrieving revision 1.2
diff -c -p -r1.2 remote-sim.c
*** remote-sim.c        2000/02/09 08:52:47     1.2
--- remote-sim.c        2000/02/23 16:28:24
*************** gdbsim_close (quitting)
*** 560,565 ****
--- 560,566 ----
      }
  
    end_callbacks ();
+   generic_mourn_inferior ();
  }
  
  /* Takes a program previously attached to and detaches it.

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