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]

Re: [PATCH] Disable thread specific breakpoints when thread dies


Daniel Jacobowitz wrote:
I'm thinking about a check in insert_breakpoints, just before calling
insert_bp_location.  By the !breakpoint_enabled.  This may have other
side effects, so it would need testing.

This seems to work. I have run the regression testsuite on both i686-pc-linux-gnu native and sh-elf cross. There were no extra failures.


OK?

Andrew
2005-11-15  Andrew Stubbs  <andrew.stubbs@st.com>

	* breakpoint.c (insert_breakpoints): Check that a thread exists
	before inserting thread specific breakpoints.

Index: src/gdb/breakpoint.c
===================================================================
--- src.orig/gdb/breakpoint.c	2005-11-14 18:58:50.000000000 +0000
+++ src/gdb/breakpoint.c	2005-11-15 14:01:40.000000000 +0000
@@ -1142,6 +1142,15 @@ insert_breakpoints (void)
       if (!breakpoint_enabled (b->owner))
 	continue;
 
+      /* There is no point inserting thread-specific breakpoints if the
+	 thread no longer exists.  */
+      if (b->owner->thread != -1
+	  && !target_thread_alive(thread_id_to_pid(b->owner->thread)))
+	{
+	  printf_unfiltered ("Not placing breakpoint %d due to death of thread %d\n", b->owner->number, b->owner->thread);
+	  continue;
+	}
+
       /* FIXME drow/2003-10-07: This code should be pushed elsewhere when
 	 hardware watchpoints are split into multiple loc breakpoints.  */
       if ((b->loc_type == bp_loc_hardware_watchpoint

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