This is the mail archive of the gdb@sourceware.org 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]

In-Process Agent Protocol (v1)


This is the V1 of in-process agent protocol.  Finally, I hope it can be
one appendix in GDB manual.  I create it on the basis of gdb.texinfo,
but I don't post patch here, because I'd like the review is more focused
on its content and doc of texinfo format is not easier to read.
Polishing words and fixing syntax issues can be in next step (I'll post
patch to gdb-patches@ then).

The protocol was discussed "by accident" in this threads,

  http://sourceware.org/ml/gdb-patches/2012-02/msg00200.html

The objection there is about assuming the env, such as word size and
ABI, on both GDBserver and the IPA is the same.  This version of
protocol get rid of these assumptions, but still assume that the
endianess of both are the same.  It is rare to see two processes on the
same CPU are running in different endianess.

Note that command "TF" is a new command to install fast tracepoint, and
the rest of commands in this spec exist in gdbserver and
libinproctrace.so for some times.

Appendix K In-Process Agent Protocol

The in-process agent is able to communicate with both gdb and GDBserver
(see In-Process Agent). This chapter is to define the protocol of this
kind of communication. In general, gdb or GDBserver sends commands (see
IPA Protocol Commands) and data to in-process agent, and then in-process
agent replies data back to represent the return result of the command,
or some extra information. The data sent to in-process agent is composed
by primitive data types, such as 4-byte or 8-byte type, and composite
types, which are called objects (see IPA Protocol Objects).

K.1 Objects

The commands sent to and received from in-process agent may contain some
composed type of data, which is called object. Usually, object is the
unit to transfer composite data types in commands.

The in-process agent is running on the same machine with gdb or
GDBserver, so it doesn't have to handle as much differences between two
ends as remote protocol (see Remote Protocol) tries to handle. However,
there are still some differences of two ends in two processes,

  - word size. On some 64-bit machine, gdb or GDBserver can be compiled
in 64-bit, while in-process agent is 32-bit.
  - ABI. Some machine may have multiple types of ABI, gdb or GDBserver
is compiled with one, and in-process agent is compiled with a different one.

agent expression object
Name		Size	Description
length		4	length of bytes code
byte code	length	contents of byte code

tracepoint action object

Tracepoint action for collecting memory
Type	Size	Description
'M'	1	type of tracepoint action
addr	8	if basereg is â-1â, addr is the address of the lowest
		byte to collect, otherwise addr is the offset of
		basereg for memory collecting.
len	8	length of memory for collecting
basereg	4	the register number containing the starting memory
		address for collecting.

Tracepoint action for collecting registers
Type	Size	Description
'R'	1	type of tracepoint action

Tracepoint action for collecting static trace data
Type	Size	Description
'L'	1	type of tracepoint action

Tracepoint action for expression evaluation
Type			Size		Description
'X'			1		type of tracepoint action
agent expression	length of agent
			expression object

tracepoint object
Name		Size	Description
number		4	number of tracepoint
address		8	address of tracepoint inserted on
type		4	type of tracepoint
enabled		1	enable or disable of tracepoint
step_count	8	step
pass_count	8	pass
numactions	4	number of tracepoint actions
hit count	8	hit count
trace frame usage	8	trace frame usage
compiled_cond	8	compiled condition
orig_size	8	orig size
condition	4 if condition is NULL otherwise
		length of agent expression object.
actions		variable	numactions number of tracepoint action object

K.2 Commands

The spaces in each command are delimiters to ease reading this commands
specification. They don't exist in real commands.

âTF tracepoint_object gdb_jump_pad_headâ
Installs a new fast tracepoint described by tracepoint_object (see
tracepoint object). gdb_jump_pad_head, 8-byte long, is the head of jumppad.
Replies:

âtarget_address gdb_jump_pad_head fjump_size fjumpâ
target_address is address of tracepoint in the inferior.
gdb_jump_pad_head is updated head of jumppad. Both of target_address and
gdb_jump_pad_head are 8-byte long. fjump contains a sequence of
instructions jump to jumppad entry. fjump_size, 4-byte long, is the size
of fjump.

âqTfSTMâ
see qTfSTM
âqTsSTMâ
see qTsSTM
âqTSTMatâ
see qTSTMat

âprobe_marker_at:addressâ
Asks in-process agent to probe the marker at address.
Replies:

âE NNâ
for an error

âunprobe_marker_at:addressâ
Asks in-process agent to unprobe the marker at address.

-- 
Yao (éå)


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