From: Antoine Tremblay <antoine.tremblay@ericsson.com>
To: gdb-patches@sourceware.org,
"Marcin Kościelnicki" <koriakin@0x04.net>,
"Pedro Alves" <palves@redhat.com>
Subject: Re: [PATCH] gdb.trace: Remove struct tracepoint_action_ops.
Date: Mon, 08 Feb 2016 13:05:00 -0000 [thread overview]
Message-ID: <56B89277.9000903@ericsson.com> (raw)
In-Reply-To: <56B546EB.5060201@0x04.net>
On 02/05/2016 08:05 PM, Marcin Kościelnicki wrote:
> On 29/01/16 11:14, Marcin Kościelnicki wrote:
>> On 25/01/16 12:53, Pedro Alves wrote:
>>> On 01/23/2016 07:31 PM, Marcin Kościelnicki wrote:
>>>> The struct tracepoint_action has an ops field, pointing to
>>>> a tracepoint_action_ops structure, containing send and download ops.
>>>> However, this field is only present when compiled in gdbserver, and not
>>>> when compiled in IPA. When gdbserver is downloading tracepoint actions
>>>> to IPA, it skips offsetof(struct tracepoint_action, type) bytes from
>>>> its struct tracepoint_action, to get to the part that corresponds to
>>>> IPA's struct tracepoint_action.
>>>>
>>>> Unfortunately, this fails badly on ILP32 platforms where alignof(long
>>>> long)
>>>> == 8. Consider struct collect_memory_action layout in gdbserver:
>>>>
>>>> 0-3: base.ops
>>>> 4: base.type
>>>> 8-15: addr
>>>> 16-23: len
>>>> 24-27: basereg
>>>> sizeof == 32
>>>>
>>>> and its layout in IPA:
>>>>
>>>> 0: base.type
>>>> 8-15: addr
>>>> 16-23: len
>>>> 24-27: basereg
>>>> sizeof == 32
>>>>
>>>> When gdbserver tries to download it to IPA, it skips the first 4 bytes
>>>> (base.ops), figuring the rest will match what IPA expects - which is
>>>> not true, since addr is aligned to 8 bytes and will be at a different
>>>> relative position to base.type.
>>>>
>>>> The problem went unnoticed on the currently supported platforms, since
>>>> aarch64 and x86_64 have ops aligned to 8 bytes, and i386 has only
>>>> 4-byte
>>>> alignment for long long.
>>>>
>>>> There are a few possible ways around this problem. I decided on
>>>> removing
>>>> ops altogether, since they can be easily inlined in their (only) places
>>>> of use - in fact allowing us share the code between 'L' and 'R'. Any
>>>> approach where struct tracepoint_action is different between IPA and
>>>> gdbserver is just asking for trouble.
>>>>
>>>> Found on s390. Tested on x86_64, s390, s390x.
>>>
>>> Hmm, this is essentially the same as:
>>>
>>> https://sourceware.org/ml/gdb-patches/2015-03/msg00995.html
>>>
>>> Right?
>>>
>>> Seems that other patch inlines things a bit less though, which offhand
>>> looks preferable. WDYT?
>>>
>>> Not sure what happened to that series. I thought most of it (if not
>>> all)
>>> had been approved already.
>>>
>>> Thanks,
>>> Pedro Alves
>>>
>>
>> So - what should I do to get these patches pushed? The original
>> developer seems not to be responding, but the work is mostly good, and
>> some patches can be pushed unchanged. What's the procedure for that? Do
>> I commit as myself, but with the author's name in ChangeLog? What if
>> the patch needs some fixes?
>>
>> Marcin Kościelnicki
>>
>
>
> Ping.
I have a similar situation and was advised that I could commit someone
else patch if he's in the Commit After Approval list, which Wei-cheng is.
You can keep the author of the patch to be the original author in the
commit and have his name in the ChangeLog. (git commit -a
--author=<orignal> if you need too)
If the patch needs some changes and you're willing to do them, you can
do the same procedure as above and add your name to the ChangeLog.
Providing you've submitted the changes to the list and that they are
approved of course...
Regards,
Antoine
next prev parent reply other threads:[~2016-02-08 13:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-23 19:32 Marcin Kościelnicki
2016-01-25 11:54 ` Pedro Alves
2016-01-25 12:17 ` Marcin Kościelnicki
2016-01-29 13:11 ` Antoine Tremblay
2016-02-08 11:55 ` Marcin Kościelnicki
2016-01-29 10:14 ` Marcin Kościelnicki
2016-02-06 1:05 ` Marcin Kościelnicki
2016-02-08 13:05 ` Antoine Tremblay [this message]
2016-02-11 16:30 ` [PATCH] gdbserver: Remove tracepoint_action ops Marcin Kościelnicki
2016-02-11 16:50 ` Pedro Alves
2016-02-11 22:24 ` Marcin Kościelnicki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56B89277.9000903@ericsson.com \
--to=antoine.tremblay@ericsson.com \
--cc=gdb-patches@sourceware.org \
--cc=koriakin@0x04.net \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox