Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch][ob] Fix possible crash in disable_thread_event_reporting
@ 2009-10-27 22:16 Paul Pluzhnikov
  2009-11-03 16:46 ` Paul Pluzhnikov
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Pluzhnikov @ 2009-10-27 22:16 UTC (permalink / raw)
  To: gdb-patches; +Cc: ppluzhnikov

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch][ob] Fix possible crash in disable_thread_event_reporting
  2009-10-27 22:16 [patch][ob] Fix possible crash in disable_thread_event_reporting Paul Pluzhnikov
@ 2009-11-03 16:46 ` Paul Pluzhnikov
  2009-11-03 16:52   ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Pluzhnikov @ 2009-11-03 16:46 UTC (permalink / raw)
  To: gdb-patches; +Cc: ppluzhnikov

On Tue, Oct 27, 2009 at 2:16 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:

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

Ping?
http://sourceware.org/ml/gdb-patches/2009-10/msg00666.html

Thanks,
-- 
Paul Pluzhnikov


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch][ob] Fix possible crash in disable_thread_event_reporting
  2009-11-03 16:46 ` Paul Pluzhnikov
@ 2009-11-03 16:52   ` Pedro Alves
  2009-11-03 17:05     ` Paul Pluzhnikov
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2009-11-03 16:52 UTC (permalink / raw)
  To: gdb-patches; +Cc: Paul Pluzhnikov

On Tuesday 03 November 2009 16:46:12, Paul Pluzhnikov wrote:
> On Tue, Oct 27, 2009 at 2:16 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
> 
> > Apparently we don't have many systems which don't have td_ta_set_event.
> > AFAICT, this has been broken since rev. 1.1
> 
> Ping?
> http://sourceware.org/ml/gdb-patches/2009-10/msg00666.html

Okay.   [OOC, do you have a libc where this function isn't present?]

Since the subject indicated the patch was obvious, I assumed
you had checked it in already.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch][ob] Fix possible crash in disable_thread_event_reporting
  2009-11-03 16:52   ` Pedro Alves
@ 2009-11-03 17:05     ` Paul Pluzhnikov
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Pluzhnikov @ 2009-11-03 17:05 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Tue, Nov 3, 2009 at 8:52 AM, Pedro Alves <pedro@codesourcery.com> wrote:

>> http://sourceware.org/ml/gdb-patches/2009-10/msg00666.html
>
> Okay.  [OOC, do you have a libc where this function isn't present?]

The oldest glibc I have access to is from RedHat-6.2 (glibc-2.1.3-29),
and it has all of the "optional" functions:

$ nm libthread_db.so.1 | egrep 'td_ta_.*event|get_info'
00002a80 T td_ta_clear_event
00002410 T td_ta_event_addr
00002860 T td_ta_event_getmsg
000027a0 T td_ta_set_event
00001b50 T td_thr_get_info

> Since the subject indicated the patch was obvious, I assumed
> you had checked it in already.

Ah, sorry. It's obvious to me, but I wanted to make sure I am not missing
something. I will not mark future patches I want reviewed as obvious.

Thanks,
-- 
Paul Pluzhnikov


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-03 17:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-27 22:16 [patch][ob] Fix possible crash in disable_thread_event_reporting Paul Pluzhnikov
2009-11-03 16:46 ` Paul Pluzhnikov
2009-11-03 16:52   ` Pedro Alves
2009-11-03 17:05     ` Paul Pluzhnikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox