This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RFC: fix bug in compare_breakpoints
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 17 Oct 2012 13:35:58 -0600
- Subject: RFC: fix bug in compare_breakpoints
I built gdb with clang today.
This found a bunch of nits (I'll send a nit-cleanup patch later) but
also a couple real bugs.
Here's the first one. compare_breakpoints has an invalid comparison.
Built (with clang and gcc) and regtested (gcc only) on x86-64 F16.
Tom
2012-10-17 Tom Tromey <tromey@redhat.com>
* breakpoint.c (compare_breakpoints): Fix comparison.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index bebad75..76e3e89 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -11766,7 +11766,7 @@ compare_breakpoints (const void *a, const void *b)
the number 0. */
if (ua < ub)
return -1;
- return ub > ub ? 1 : 0;
+ return ua > ub ? 1 : 0;
}
/* Delete breakpoints by address or line. */