This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/5 v4] Remove tracepoint_action ops.
- From: Pedro Alves <palves at redhat dot com>
- To: Wei-cheng Wang <cole945 at gmail dot com>, uweigand at de dot ibm dot com, gdb-patches at sourceware dot org
- Date: Tue, 30 Jun 2015 10:57:13 +0100
- Subject: Re: [PATCH 1/5 v4] Remove tracepoint_action ops.
- Authentication-results: sourceware.org; auth=none
- References: <1435422102-39438-1-git-send-email-cole945 at gmail dot com>
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