[PATCH 1/5 v4] Remove tracepoint_action ops.

Pedro Alves palves@redhat.com
Tue Jun 30 09:57:00 GMT 2015


On 06/27/2015 05:21 PM, Wei-cheng Wang wrote:

> 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.
> 
> gdbserver/ChangeLog
> 
> 2015-06-27  Wei-cheng Wang  <cole945@gmail.com>
> 
> 	* tracepoint.c (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): Delete
> 	(tracepoint_action_send, tracepoint_action_download): New functions.
> 	Helpers for tracetion action handlers.
> 	(add_tracepoint_action): Remove setup actions ops.
> 	(download_tracepoint_1, tracepoint_send_agent): Call helper functions.
> ---

FAOD, this looks fine to me.

Thanks,
-- 
Pedro Alves



More information about the Gdb-patches mailing list