aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-06-07 15:34:36 -0600
committerTom Tromey <tom@tromey.com>2018-06-08 07:05:49 -0600
commit8dcc53b37f4fe4797825c2a43bb1fb3df56b30d1 (patch)
treeaf3cd396cb7b198f651eb45986be87911a01c35b /gdb/gdbserver
parentcb36699271e2f3308b6f1aa40086950111308020 (diff)
downloadgdb-8dcc53b37f4fe4797825c2a43bb1fb3df56b30d1.zip
gdb-8dcc53b37f4fe4797825c2a43bb1fb3df56b30d1.tar.gz
gdb-8dcc53b37f4fe4797825c2a43bb1fb3df56b30d1.tar.bz2
Remove cleanups from btrace code
This removes some cleanups from the btrace code by minorly C++-ifying struct btrace_data. gdb/ChangeLog 2018-06-08 Tom Tromey <tom@tromey.com> * common/btrace-common.h (struct btrace_data): Add constructor, destructor, move assignment operator. <empty, clear, fini>: New methods. <format>: Initialize. (btrace_data_init, btrace_data_fini, btrace_data_clear) (btrace_data_empty): Don't declare. * common/btrace-common.c (btrace_data_init): Remove. (btrace_data::fini): Rename from btrace_data_fini. (btrace_data::empty): Rename from btrace_data_empty. (btrace_data::clear): Rename from btrace_data_clear. Return bool. * btrace.h (make_cleanup_btrace_data): Don't declare. * btrace.c (btrace_add_pc, btrace_stitch_trace, btrace_clear) (parse_xml_btrace): Update. (do_btrace_data_cleanup, make_cleanup_btrace_data): Remove. (maint_btrace_clear_packet_history_cmd): Update. gdb/gdbserver/ChangeLog 2018-06-08 Tom Tromey <tom@tromey.com> * linux-low.c (linux_low_read_btrace): Update.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog4
-rw-r--r--gdb/gdbserver/linux-low.c13
2 files changed, 7 insertions, 10 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 3bd9a68..4e55c36 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,7 @@
+2018-06-08 Tom Tromey <tom@tromey.com>
+
+ * linux-low.c (linux_low_read_btrace): Update.
+
2018-06-04 Stan Cox <scox@redhat.com>
* server.h (struct client_state): New.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index f8507b7..1211944 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -7250,8 +7250,6 @@ linux_low_read_btrace (struct btrace_target_info *tinfo, struct buffer *buffer,
enum btrace_error err;
int i;
- btrace_data_init (&btrace);
-
err = linux_read_btrace (&btrace, tinfo, type);
if (err != BTRACE_ERR_NONE)
{
@@ -7260,14 +7258,14 @@ linux_low_read_btrace (struct btrace_target_info *tinfo, struct buffer *buffer,
else
buffer_grow_str0 (buffer, "E.Generic Error.");
- goto err;
+ return -1;
}
switch (btrace.format)
{
case BTRACE_FORMAT_NONE:
buffer_grow_str0 (buffer, "E.No Trace.");
- goto err;
+ return -1;
case BTRACE_FORMAT_BTS:
buffer_grow_str (buffer, "<!DOCTYPE btrace SYSTEM \"btrace.dtd\">\n");
@@ -7298,15 +7296,10 @@ linux_low_read_btrace (struct btrace_target_info *tinfo, struct buffer *buffer,
default:
buffer_grow_str0 (buffer, "E.Unsupported Trace Format.");
- goto err;
+ return -1;
}
- btrace_data_fini (&btrace);
return 0;
-
-err:
- btrace_data_fini (&btrace);
- return -1;
}
/* See to_btrace_conf target method. */