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] Fix a small bug in gdbserver


Hi,

This patch will make gdbserver search through the whole breakpoint list
when it's finding the being deleted one.

Is it OK?

Thanks,
Jie

2005-12-29  Jie Zhang  <jie.zhang@analog.com>

	* mem-break.c (delete_breakpoint): Search through the whole
	breakpoint list for the being deleted one.


Index: mem-break.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/mem-break.c,v
retrieving revision 1.5
diff -u -p -r1.5 mem-break.c
--- mem-break.c	23 Dec 2005 18:11:55 -0000	1.5
+++ mem-break.c	29 Dec 2005 13:16:47 -0000
@@ -84,18 +84,15 @@ delete_breakpoint (struct breakpoint *bp
       free (bp);
       return;
     }
-  cur = breakpoints;
-  while (cur->next)
-    {
-      if (cur->next == bp)
-	{
-	  cur->next = bp->next;
-	  (*the_target->write_memory) (bp->pc, bp->old_data,
-				       breakpoint_len);
-	  free (bp);
-	  return;
-	}
-    }
+  for (cur = breakpoints; cur->next; cur = cur->next)
+    if (cur->next == bp)
+      {
+	cur->next = bp->next;
+	(*the_target->write_memory) (bp->pc, bp->old_data,
+				     breakpoint_len);
+	free (bp);
+	return;
+      }
   warning ("Could not find breakpoint in list.");
 }
 


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