From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52781 invoked by alias); 7 Mar 2017 12:38:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 52767 invoked by uid 89); 7 Mar 2017 12:38:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=H*RU:HELO, Hx-spam-relays-external:HELO, Hx-languages-length:3368, Tel X-HELO: mga06.intel.com Received: from mga06.intel.com (HELO mga06.intel.com) (134.134.136.31) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Mar 2017 12:38:51 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP; 07 Mar 2017 04:38:49 -0800 X-ExtLoop1: 1 Received: from labpc305.iul.intel.com (HELO [172.28.50.132]) ([172.28.50.132]) by fmsmga001.fm.intel.com with ESMTP; 07 Mar 2017 04:38:48 -0800 Subject: Re: [PATCH v9] amd64-mpx: initialize BND register before performing inferior calls. To: Pedro Alves , eliz@gnu.org, qiyaoltc@gmail.com, brobecker@adacore.com References: <1488215745-5625-1-git-send-email-walfred.tedeschi@intel.com> <8a64b4d9-dde5-32fa-2c71-836ed87f3640@redhat.com> Cc: gdb-patches@sourceware.org From: "Tedeschi, Walfred" Message-ID: <91c43a69-057a-4f7b-ed16-0fa060f00b64@intel.com> Date: Tue, 07 Mar 2017 12:38:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <8a64b4d9-dde5-32fa-2c71-836ed87f3640@redhat.com> Content-Type: text/plain; charset="windows-1252"; format="flowed" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg00063.txt.bz2 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, struc= t regcache *regcache) >> regcache_raw_write_unsigned (regcache, I387_FTAG_REGNUM (tdep), 0x3f= ff); >>=20=20=20 >> } >> + >> + /* 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 =3D *(a - len); >> + value =3D *(b - len); >> + value =3D *(c - len); >> + value =3D *(d - len); >> + >> + > Spurious double empty line. > >> + value =3D value - *a + 1; >> + return value; >> +} >> + >> + >> +char >> +char_upper (char *str, int lenght) >> +{ >> + char ch; >> + ch =3D *(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[] =3D "Hello"; >> + >> + x =3D malloc (sizeof (int) * ARRAY_LENGTH); >> + a =3D malloc (sizeof (int) * ARRAY_LENGTH); >> + b =3D malloc (sizeof (int) * ARRAY_LENGTH); >> + c =3D malloc (sizeof (int) * ARRAY_LENGTH); >> + d =3D malloc (sizeof (int) * ARRAY_LENGTH); >> + >> + *x =3D upper (sa, sb, sc, sd, 0); /* bkpt 1. */ >> + *x =3D 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 =3D char_upper (hello, 10); >> + mchar =3D 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 ".*=3D 1\r\n$gdb_prompt " { >> + pass "check whether processor supports MPX" > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > ... and this test message are inconsistent. See below. > >> + } >> + -re ".*=3D 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 ".*=3D 1\r\n$gdb_prompt " { > pass $test > } > -re ".*=3D 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