* target.h (struct traceframe_info): Forward declare.
	(enum target_object): Add TARGET_OBJECT_TRACEFRAME_INFO.
	(struct target_ops) <to_traceframe_info>: New field.
	(target_traceframe_info): New.
	* target.c (update_current_target): Inherit and default
	to_traceframe_info.
	* remote.c (PACKET_qXfer_traceframe_info): New.
	(remote_protocol_features): Register qXfer:traceframe-info:read.
	(remote_xfer_partial): Handle TARGET_OBJECT_TRACEFRAME_INFO.
	(remote_traceframe_info): New.
	(init_remote_ops): Install it.
	(_initialize_remote): Install "set/show remote traceframe-info"
	commands.
	* tracepoint.h (parse_traceframe_info): Declare.
	* tracepoint.c (struct mem_range): New.
	(mem_range_s): New typedef.
	(struct traceframe_info): New.
	(traceframe_info): New global.
	(free_traceframe_info): New function.
	(clear_traceframe_info): New function.
	(start_tracing, tfind_1, set_traceframe_number): Clear traceframe
	info.
	(build_traceframe_info): New function.
	(tfile_traceframe_info): New function.
	(init_tfile_ops): Install tfile_traceframe_info.
	(traceframe_info_start_memory, free_result): New functions.
	(memory_attributes, traceframe_info_elements): New globals.
	(parse_traceframe_info, get_traceframe_info): New functions.
	* features/traceframe-info.dtd: New file.
	* Makefile.in (XMLFILES): Add traceframe-info.dtd.

	gdb/gdbserver/
	* server.c (handle_qxfer_traceframe_info): New.
	(qxfer_packets): Register "traceframe-info".
	(handle_query): Report support for qXfer:traceframe-info:read+.
	* tracepoint.c (match_blocktype): New.
	(traceframe_find_block_type): Rename to ...
	(traceframe_walk_blocks): ... this.  Add callback filter argument,
	and use it.
	(traceframe_find_block_type): New, reimplemented on top of
	traceframe_walk_blocks.
	(build_traceframe_info_xml): New.
	(traceframe_read_info): New.
	* server.h (traceframe_read_info): Declare.

	gdb/doc/
	* gdb.texinfo (Remote Configuration): Mention set/show remote
	traceframe-info.
	(Tools/Packages Optional for Building GDB): Mention that expat is
	used for traceframe info.
	(Remote Protocol) <Menu>: Add "Traceframe Info Format".
	(General Query Packets) <qSupported>: Describe the
	qXfer:traceframe-info:read feature.
	(qXfer::read): Describe qXfer:traceframe-info:read.
	(Traceframe Info Format): New section.
This commit is contained in:
Pedro Alves
2011-02-14 11:13:12 +00:00
parent 4e07d55ffb
commit b3b9301ef4
13 changed files with 568 additions and 6 deletions

View File

@ -1,3 +1,15 @@
2011-02-14 Pedro Alves <pedro@codesourcery.com>
* gdb.texinfo (Remote Configuration): Mention set/show remote
traceframe-info.
(Tools/Packages Optional for Building GDB): Mention that expat is
used for traceframe info.
(Remote Protocol) <Menu>: Add "Traceframe Info Format".
(General Query Packets) <qSupported>: Describe the
qXfer:traceframe-info:read feature.
(qXfer::read): Describe qXfer:traceframe-info:read.
(Traceframe Info Format): New section.
2011-02-04 Pedro Alves <pedro@codesourcery.com>
* gdbint.texinfo (Formatting): Mention some formatting guidelines

View File

@ -16698,6 +16698,10 @@ are:
@item @code{query-attached}
@tab @code{qAttached}
@tab Querying remote process attach state.
@item @code{traceframe-info}
@tab @code{qXfer:traceframe-info:read}
@tab Traceframe info
@end multitable
@node Remote Stub
@ -30848,6 +30852,8 @@ Target descriptions (@pxref{Target Descriptions})
Remote shared library lists (@pxref{Library List Format})
@item
MS-Windows shared libraries (@pxref{Shared Libraries})
@item
Traceframe info (@pxref{Traceframe Info Format})
@end itemize
@item zlib
@ -31670,6 +31676,7 @@ Show the current setting of the target wait timeout.
* Library List Format::
* Memory Map Format::
* Thread List Format::
* Traceframe Info Format::
@end menu
@node Overview
@ -33220,6 +33227,11 @@ These are the currently defined stub features and their properties:
@tab @samp{-}
@tab Yes
@item @samp{qXfer:traceframe-info:read}
@tab No
@tab @samp{-}
@tab Yes
@item @samp{QNonStop}
@tab No
@ -33322,6 +33334,10 @@ The remote stub understands the @samp{qXfer:siginfo:write} packet
The remote stub understands the @samp{qXfer:threads:read} packet
(@pxref{qXfer threads read}).
@item qXfer:traceframe-info:read
The remote stub understands the @samp{qXfer:traceframe-info:read}
packet (@pxref{qXfer traceframe info read}).
@item QNonStop
The remote stub understands the @samp{QNonStop} packet
(@pxref{QNonStop}).
@ -33560,6 +33576,16 @@ annex part of the generic @samp{qXfer} packet must be empty
This packet is not probed by default; the remote stub must request it,
by supplying an appropriate @samp{qSupported} response (@pxref{qSupported}).
@item qXfer:traceframe-info:read::@var{offset},@var{length}
@anchor{qXfer traceframe info read}
Return a description of the current traceframe's contents.
@xref{Traceframe Info Format}. The annex part of the generic
@samp{qXfer} packet must be empty (@pxref{qXfer read}).
This packet is not probed by default; the remote stub must request it,
by supplying an appropriate @samp{qSupported} response (@pxref{qSupported}).
@item qXfer:osdata:read::@var{offset},@var{length}
@anchor{qXfer osdata read}
Access the target's @dfn{operating system information}.
@ -35851,6 +35877,58 @@ identifies the thread (@pxref{thread-id syntax}). The
the thread was last executing on. The content of the of @samp{thread}
element is interpreted as human-readable auxilliary information.
@node Traceframe Info Format
@section Traceframe Info Format
@cindex traceframe info format
To be able to know which objects in the inferior can be examined when
inspecting a tracepoint hit, @value{GDBN} needs to obtain the list of
memory ranges, registers and trace state variables that have been
collected in a traceframe.
This list is obtained using the @samp{qXfer:traceframe-info:read}
(@pxref{qXfer traceframe info read}) packet and is an XML document.
@value{GDBN} must be linked with the Expat library to support XML
traceframe info discovery. @xref{Expat}.
The top-level structure of the document is shown below:
@smallexample
<?xml version="1.0"?>
<!DOCTYPE traceframe-info
PUBLIC "+//IDN gnu.org//DTD GDB Memory Map V1.0//EN"
"http://sourceware.org/gdb/gdb-traceframe-info.dtd">
<traceframe-info>
block...
</traceframe-info>
@end smallexample
Each traceframe block can be either:
@itemize
@item
A region of collected memory starting at @var{addr} and extending for
@var{length} bytes from there:
@smallexample
<memory start="@var{addr}" length="@var{length}"/>
@end smallexample
@end itemize
The formal DTD for the traceframe info format is given below:
@smallexample
<!ELEMENT traceframe-info (memory)* >
<!ATTLIST traceframe-info version CDATA #FIXED "1.0">
<!ELEMENT memory EMPTY>
<!ATTLIST memory start CDATA #REQUIRED
length CDATA #REQUIRED>
@end smallexample
@include agentexpr.texi
@node Trace File Format