aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSergio Durigan Junior <sergiodj@redhat.com>2013-10-16 02:41:42 +0000
committerSergio Durigan Junior <sergiodj@redhat.com>2013-10-16 02:41:42 +0000
commitd92f7ee31f8752821adac3785a8460d0f3d366ee (patch)
tree851da164970485643a316714a847d75f08f85694 /gdb
parent26505cc0c4e4257c36df3e80507e531c8b1380e5 (diff)
downloadgdb-d92f7ee31f8752821adac3785a8460d0f3d366ee.zip
gdb-d92f7ee31f8752821adac3785a8460d0f3d366ee.tar.gz
gdb-d92f7ee31f8752821adac3785a8460d0f3d366ee.tar.bz2
This is a simple bug. target_disable_btrace and target_teardown_btrace,
both from gdb/target.c, do a "return" calling another function. But both are marked as void. Despite the fact that the functions being called are void as well, this is wrong. This patch fixes this by calling the functions and then returning in the next line. 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/target.c10
2 files changed, 15 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index da2c84d..b2f1fc8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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
diff --git a/gdb/target.c b/gdb/target.c
index 7279359..22d7fb6 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -4165,7 +4165,10 @@ target_disable_btrace (struct btrace_target_info *btinfo)
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 @@ target_teardown_btrace (struct btrace_target_info *btinfo)
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 ();
}