Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jie Zhang <jzhang918@gmail.com>
To: gdb-patches@sources.redhat.com, Daniel Jacobowitz <drow@false.org>
Subject: [PATCH] Fix a small bug in gdbserver
Date: Sat, 31 Dec 2005 05:46:00 -0000	[thread overview]
Message-ID: <43B3E771.9000705@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 143 bytes --]

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


[-- Attachment #2: gdbserver-delete-breakpoint.diff --]
[-- Type: text/x-patch, Size: 1049 bytes --]

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.");
 }
 


             reply	other threads:[~2005-12-29 13:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-31  5:46 Jie Zhang [this message]
2006-01-20 23:15 ` Daniel Jacobowitz
2006-01-21  0:18   ` Jim Blandy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43B3E771.9000705@gmail.com \
    --to=jzhang918@gmail.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox