This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Add CTF support to GDB [3/4] ctf target

This patch is for the CTF read.
It add a new target ctf like the tfile target to read the ctf file.
After use this target open the ctf dir, you can use tfind to select the ctf event.  Each field inside this event will add to GDB as a internalvar.  And tdump will show all of them.  And you can use python read the value of them.

All this function is based on libbabeltrace. To use it, you need install the babeltrace first. Because the libbabeltrace's version is too old in most of distribution, it have some bugs and some API is changed in the trunk verion. So I suggest you install the trunk version of babeltrace.

And another issue is libbabeltrace have a function named lookup_enum that is same with GDB. So I changed lookup_enum of GDB to lookup_enum_gdb to handle it.


2012-11-20 Hui Zhu <>

	* (HAVE_LIBBABELTRACE): new macro.
	* configure: New option "--enable-ctf-target".
	* ctf.c (babeltrace/babeltrace.h, babeltrace/types.h,
	babeltrace/ctf/events.h, babeltrace/ctf/iterator.h): New includes.
	(ctx, iter, current_tp, ctf_event, ctf_ops): New variables.
	(bt_ctf_close, bt_ctf_open, bt_ctf_find_field, bt_ctf_event_id,
	bt_ctf_def_to_val, bt_ctf_event_to_internalvar, bt_ctf_goto_begin,
	bt_ctf_find_num, bt_ctf_find_tp, ctf_open, ctf_close,
	ctf_trace_find, ctf_get_current_tracepoint_name, ctf_trace_dump,
	ctf_has_all_memory, ctf_has_memory, ctf_has_stack,
	ctf_has_registers, ctf_thread_alive, init_ctf_ops,
	_initialize_ctf): New functions.
	* gdbtypes.c (lookup_enum): Rename to lookup_enum_gdb.
	* python/py-type.c (typy_lookup_typename): Rename lookup_enum
	to lookup_enum_gdb.
	* symtab.h (lookup_enum): Rename to lookup_enum_gdb.
	* target.c (update_current_target): Add
	to_get_current_tracepoint_name and to_trace_dump.
	(update_current_target): Ditto.
	* target.h (target_ops): Add to_get_current_tracepoint_name and
	(target_get_current_tracepoint_name, target_trace_dump): New
	* tracepoint.c (tfind_1): Add checks for has_stack_frames ().
	Call target_get_current_tracepoint_name to show the name of
	(trace_dump_command): Call target_trace_dump.

Attachment: ctf-target.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]