From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84553 invoked by alias); 7 Mar 2017 11:18:44 -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 84518 invoked by uid 89); 7 Mar 2017 11:18:40 -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_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Mar 2017 11:18:39 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C3BDA4E4D1; Tue, 7 Mar 2017 11:18:39 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v27BIbBj005281; Tue, 7 Mar 2017 06:18:38 -0500 Subject: Re: [PATCH v9] amd64-mpx: initialize BND register before performing inferior calls. To: Walfred Tedeschi , eliz@gnu.org, qiyaoltc@gmail.com, brobecker@adacore.com References: <1488215745-5625-1-git-send-email-walfred.tedeschi@intel.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <8a64b4d9-dde5-32fa-2c71-836ed87f3640@redhat.com> Date: Tue, 07 Mar 2017 11:18:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1488215745-5625-1-git-send-email-walfred.tedeschi@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-03/txt/msg00059.txt.bz2 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