This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH][commit/obvious] Fix for PR gdb/16042
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Date: Tue, 15 Oct 2013 23:44:25 -0300
- Subject: [PATCH][commit/obvious] Fix for PR gdb/16042
- Authentication-results: sourceware.org; auth=none
Hi,
This is a simple bug. Both target_disable_btrace and
target_teardown_btrace, from gdb/target.c, do a "return" calling another
function. However, both are marked as void. Despite the fact that the
functions being called on the "return" are also void, this is still a
bad style. I checked this in as obvious.
https://sourceware.org/ml/gdb-cvs/2013-10/msg00098.html
Thanks,
--
Sergio
Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.16103
diff -u -r1.16103 ChangeLog
--- gdb/ChangeLog 14 Oct 2013 08:16:45 -0000 1.16103
+++ gdb/ChangeLog 16 Oct 2013 02:39:29 -0000
@@ -1,3 +1,10 @@
+2013-10-16 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ PR gdb/16042
+ * target.c (target_disable_btrace): Fix invalid return value for
+ void function.
+ (target_teardown_btrace): Likewise.
+
2013-10-14 Yao Qi <yao@codesourcery.com>
* varobj.c (struct varobj): Move most of the fields to
Index: gdb/target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.350
diff -u -r1.350 target.c
--- gdb/target.c 9 Oct 2013 17:00:00 -0000 1.350
+++ gdb/target.c 16 Oct 2013 02:39:29 -0000
@@ -4165,7 +4165,10 @@
for (t = current_target.beneath; t != NULL; t = t->beneath)
if (t->to_disable_btrace != NULL)
- return t->to_disable_btrace (btinfo);
+ {
+ t->to_disable_btrace (btinfo);
+ return;
+ }
tcomplain ();
}
@@ -4179,7 +4182,10 @@
for (t = current_target.beneath; t != NULL; t = t->beneath)
if (t->to_teardown_btrace != NULL)
- return t->to_teardown_btrace (btinfo);
+ {
+ t->to_teardown_btrace (btinfo);
+ return;
+ }
tcomplain ();
}