Move trace file writer out of tracepoint.c
authorYao Qi <yao@codesourcery.com>
Mon, 10 Feb 2014 05:31:12 +0000 (13:31 +0800)
committerYao Qi <yao@codesourcery.com>
Sun, 23 Feb 2014 03:44:26 +0000 (11:44 +0800)
commit7951c4eb08bdb6843989e4dfdddbd7cad5e1fd9c
treeb0c4225e57fa7b395e1f6e610c2ac42e6f77ce9f
parentcb5111bcea8f96585f8b85270bc3c6c796ceebad
Move trace file writer out of tracepoint.c

This patch is a refactor which moves trace file writer related code
out of tracepoint.c, which has 6k LOC.  It moves general trace file
writer to a new file tracefile.c and moves tfile specific writer to
tracefile-tfile.c.

gdb:

2014-02-23  Yao Qi  <yao@codesourcery.com>

* Makefile.in (REMOTE_OBS): Append tracefile.o and
tracefile-tfile.o.
(HFILES_NO_SRCDIR): Add tracefile.h.
* ctf.c: Include "tracefile.h".
* tracefile.h: New file.
* tracefile.c: New file
* tracefile-tfile.c: New file.
* tracepoint.c: Include "tracefile.h".
(free_uploaded_tps, free_uploaded_tsvs): Remove declarations.
(stop_reason_names): Add const.
(trace_file_writer_xfree): Move it to tracefile.c.
(trace_save, trace_save_command, trace_save_tfile): Likewise.
(trace_save_ctf): Likewise.
(struct tfile_trace_file_writer): Move it to tracefile-tfile.c.
(tfile_target_save, tfile_dtor, tfile_start): Likewise.
(tfile_write_header, tfile_write_regblock_type): Likewise.
(tfile_write_status, tfile_write_uploaded_tsv): Likewise.
(tfile_write_uploaded_tp, tfile_write_definition_end): Likewise.
(tfile_write_raw_data, tfile_end): Likewise.
(tfile_trace_file_writer_new): Likewise.
(free_uploaded_tp): Make it extern.
(free_uploaded_tsv): Make it extern.
(_initialize_tracepoint): Move code to register command 'tsave'
to tracefile.c.
* tracepoint.h (stop_reason_names): Declare.
(struct trace_frame_write_ops): Move it to tracefile.h.
(struct trace_file_write_ops): Likewise.
(struct trace_file_writer): Likewise.
(free_uploaded_tsvs, free_uploaded_tps): Declare.
gdb/ChangeLog
gdb/Makefile.in
gdb/ctf.c
gdb/tracefile-tfile.c [new file with mode: 0644]
gdb/tracefile.c [new file with mode: 0644]
gdb/tracefile.h [new file with mode: 0644]
gdb/tracepoint.c
gdb/tracepoint.h