[RFA,12/22] Remove unnecessary null_cleanup

Message ID 1474949330-4307-13-git-send-email-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey Sept. 27, 2016, 4:08 a.m. UTC
  This patch removes an unnecessary null_cleanup.

2016-09-26  Tom Tromey  <tom@tromey.com>

	* tracepoint.c (trace_dump_command): Remove unnecessary
	null_cleanup.
---
 gdb/ChangeLog    | 5 +++++
 gdb/tracepoint.c | 4 +---
 2 files changed, 6 insertions(+), 3 deletions(-)
  

Comments

Pedro Alves Oct. 9, 2016, 5:06 p.m. UTC | #1
On 09/27/2016 05:08 AM, Tom Tromey wrote:
> This patch removes an unnecessary null_cleanup.
> 
> 2016-09-26  Tom Tromey  <tom@tromey.com>
> 
> 	* tracepoint.c (trace_dump_command): Remove unnecessary
> 	null_cleanup.

Obviously OK.  Feel free to push immediately.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 66e9236..d3b8a45 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@ 
 2016-09-26  Tom Tromey  <tom@tromey.com>
 
+	* tracepoint.c (trace_dump_command): Remove unnecessary
+	null_cleanup.
+
+2016-09-26  Tom Tromey  <tom@tromey.com>
+
 	* maint.h (scoped_command_stats): New class.
 	(make_command_stats_cleanup): Don't declare.
 	* maint.c (struct cmd_stats): Remove.
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index c89c77e..e5c353c 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -3061,11 +3061,9 @@  trace_dump_command (char *args, int from_tty)
   printf_filtered ("Data collected at tracepoint %d, trace frame %d:\n",
 		   tracepoint_number, traceframe_number);
 
-  old_chain = make_cleanup (null_cleanup, NULL);
-
   /* This command only makes sense for the current frame, not the
      selected frame.  */
-  make_cleanup_restore_current_thread ();
+  old_chain = make_cleanup_restore_current_thread ();
   select_frame (get_current_frame ());
 
   actions = all_tracepoint_actions_and_cleanup (loc->owner);