gdbserver: Remove tracepoint_action ops.
This patch removes 'ops' in tracepoint, and uses helper functions to
call action handler instead.
The object layout of tracepoint_action may differ in gdbserver and
inferior depend on the alignment rule of target ABI, so gdbserver cannot
simply copy the object from its memory to inferior memory.
For example,
struct collect_memory_action
{
struct tracepoint_action base;
{
#ifndef IN_PROCESS_AGENT
const struct tracepoint_action_ops *ops;
#if
- char type;
| }
| ULONGEST addr;
| ULONGEST len;
- int32_t basereg;
};
and on PowerPC,
Wihtout ops with ops
0 1 2 3 0 1 2 3
0 |type| PADDING... 0 |ops-------------|
4 ................. 4 |type|PADDING....|
8 |addr------------ 8 |addr-------------
c ----------------| c -----------------|
10 |len------------- 10 |len--------------
14 ----------------| 14 -----------------|
18 |basereg--------| 18 |basereg---------|
so we cannot directly copy the object.
In this patch, 'ops' is removed in order to make the objects identical.
gdb/gdbserver/ChangeLog:
2016-02-11 Wei-cheng Wang <cole945@gmail.com>
Marcin Kościelnicki <koriakin@0x04.net>
* tracepoint.c (struct tracepoint_action_ops): Remove.
(struct tracepoint_action): Remove ops.
(m_tracepoint_action_download, r_tracepoint_action_download)
(x_tracepoint_action_download, l_tracepoint_action_download): Adjust
size and offset accordingly.
(m_tracepoint_action_ops, r_tracepoint_action_ops)
(x_tracepoint_action_ops, l_tracepoint_action_ops): Remove.
(tracepoint_action_send, tracepoint_action_download): New functions.
Helpers for trace action handlers.
(add_tracepoint_action): Remove setup actions ops.
(download_tracepoint_1, tracepoint_send_agent): Call helper functions.