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]

[patch][ob] Fix possible crash in disable_thread_event_reporting


Greetings,

Apparently we don't have many systems which don't have td_ta_set_event.
AFAICT, this has been broken since rev. 1.1

Still, it's a trivial patch, and we might as well handle this correctly.

I also deleted remove_thread_event_breakpoints() call, since the caller
already does it on it's own.

Thanks,

--
Paul Pluzhnikov

2009-10-27  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* linux-thread-db.c (disable_thread_event_reporting): Adjust.

Index: linux-thread-db.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-thread-db.c,v
retrieving revision 1.66
diff -u -p -u -r1.66 linux-thread-db.c
--- linux-thread-db.c	27 Oct 2009 21:32:49 -0000	1.66
+++ linux-thread-db.c	27 Oct 2009 22:14:40 -0000
@@ -905,20 +905,18 @@ thread_db_load (void)
 }
 
 static void
-disable_thread_event_reporting (void)
+disable_thread_event_reporting (struct thread_db_info *info)
 {
-  td_thr_events_t events;
-  struct thread_db_info *info;
-
-  info = get_thread_db_info (GET_PID (inferior_ptid));
+  if (info->td_ta_set_event_p != NULL)
+    {
+      td_thr_events_t events;
 
-  /* Set the process wide mask saying we aren't interested in any
-     events anymore.  */
-  td_event_emptyset (&events);
-  info->td_ta_set_event_p (info->thread_agent, &events);
+      /* Set the process wide mask saying we aren't interested in any
+	 events anymore.  */
+      td_event_emptyset (&events);
+      info->td_ta_set_event_p (info->thread_agent, &events);
+    }
 
-  /* Delete thread event breakpoints, if any.  */
-  remove_thread_event_breakpoints ();
   info->td_create_bp_addr = 0;
   info->td_death_bp_addr = 0;
 }
@@ -1088,7 +1086,7 @@ thread_db_detach (struct target_ops *ops
 
   if (info)
     {
-      disable_thread_event_reporting ();
+      disable_thread_event_reporting (info);
 
       /* Delete the old thread event breakpoints.  Note that unlike
 	 when mourning, we can remove them here because there's still


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