From: "Tedeschi, Walfred" <walfred.tedeschi@intel.com>
To: Pedro Alves <palves@redhat.com>,
eliz@gnu.org, qiyaoltc@gmail.com, brobecker@adacore.com
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v9] amd64-mpx: initialize BND register before performing inferior calls.
Date: Tue, 07 Mar 2017 12:38:00 -0000 [thread overview]
Message-ID: <91c43a69-057a-4f7b-ed16-0fa060f00b64@intel.com> (raw)
In-Reply-To: <8a64b4d9-dde5-32fa-2c71-836ed87f3640@redhat.com>
On 03/07/2017 12:18 PM, Pedro Alves wrote:
> Hi Walfred,
>
>> /* Determine the total space required for arguments and struct
>> return address in a first pass (allowing for 16-byte-aligned
>> arguments), then push arguments in a second pass. */
>> diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
>> index c986e39..4ce1208 100644
>> --- a/gdb/i387-tdep.c
>> +++ b/gdb/i387-tdep.c
>> @@ -1860,3 +1860,20 @@ i387_return_value (struct gdbarch *gdbarch, struct regcache *regcache)
>> regcache_raw_write_unsigned (regcache, I387_FTAG_REGNUM (tdep), 0x3fff);
>>
>> }
>> +
>> + /* See i387-tdep.h. */
> Please fix indentation here.
>
>> +
>> +void
>> +i387_reset_bnd_regs (struct gdbarch *gdbarch, struct regcache *regcache)
>> +{
> In the test:
>
>> +
>> +int
>> +lower (int *a, int *b, int *c, int *d, int len)
>> +{
>> + int value;
>> +
>> + value = *(a - len);
>> + value = *(b - len);
>> + value = *(c - len);
>> + value = *(d - len);
>> +
>> +
> Spurious double empty line.
>
>> + value = value - *a + 1;
>> + return value;
>> +}
>> +
>> +
>> +char
>> +char_upper (char *str, int lenght)
>> +{
>> + char ch;
>> + ch = *(str + lenght);
> More "lenght" typos. Please do a global search/replace in the patch.
>
>> +
>> + return ch;
>> +}
>> +
>
>> +int
>> +main (void)
>> +{
>> + if (have_mpx ())
>> + {
>> + int sa[ARRAY_LENGTH];
>> + int sb[ARRAY_LENGTH];
>> + int sc[ARRAY_LENGTH];
>> + int sd[ARRAY_LENGTH];
>> + int *x, *a, *b, *c, *d;
>> + char mchar;
>> + char hello[] = "Hello";
>> +
>> + x = malloc (sizeof (int) * ARRAY_LENGTH);
>> + a = malloc (sizeof (int) * ARRAY_LENGTH);
>> + b = malloc (sizeof (int) * ARRAY_LENGTH);
>> + c = malloc (sizeof (int) * ARRAY_LENGTH);
>> + d = malloc (sizeof (int) * ARRAY_LENGTH);
>> +
>> + *x = upper (sa, sb, sc, sd, 0); /* bkpt 1. */
>> + *x = lower (a, b, c, d, 0); /* bkpt 1. */
> Two lines with "bkpt 1" doesn't look right. The second one should
> probably be removed.
>
>> +
>> + mchar = char_upper (hello, 10);
>> + mchar = char_lower (hello, 10);
>> +
>> + free (x);
>> + free (a);
>> + free (b);
>> + free (c);
>> + free (d);
>> + }
>> + return 0; /* bkpt 3. */
> This "bkpt 3" marker isn't used anywhere AFAICS. Remove it.
>
>> +}
>
>> +gdb_test_multiple "print have_mpx ()" "have mpx" {
> ^^^^^^^^
>
> This ...
>
>> + -re ".*= 1\r\n$gdb_prompt " {
>> + pass "check whether processor supports MPX"
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> ... and this test message are inconsistent. See below.
>
>> + }
>> + -re ".*= 0\r\n$gdb_prompt " {
>> + untested "processor does not support MPX; skipping tests"
>> + return
>> + }
>> +}
>> +
> Write:
>
> set test "check whether processor supports MPX"
> gdb_test_multiple "print have_mpx ()" $test {
> -re ".*= 1\r\n$gdb_prompt " {
> pass $test
> }
> -re ".*= 0\r\n$gdb_prompt " {
> pass $test
> untested "processor does not support MPX; skipping tests"
> return
> }
> }
>
> OK with those changes.
>
> Thanks,
> Pedro Alves
>
Hello Pedro,
Thanks a lot!
Best regards,
/Fred
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
next prev parent reply other threads:[~2017-03-07 12:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-27 17:16 Walfred Tedeschi
2017-03-07 11:18 ` Pedro Alves
2017-03-07 12:38 ` Tedeschi, Walfred [this message]
2017-03-08 11:11 ` Jiong Wang
2017-03-08 12:02 ` Tedeschi, Walfred
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=91c43a69-057a-4f7b-ed16-0fa060f00b64@intel.com \
--to=walfred.tedeschi@intel.com \
--cc=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=qiyaoltc@gmail.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