From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3245 invoked by alias); 27 Apr 2016 08:47:43 -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 3236 invoked by uid 89); 27 Apr 2016 08:47:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=unattended X-HELO: mail-pa0-f47.google.com Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 27 Apr 2016 08:47:33 +0000 Received: by mail-pa0-f47.google.com with SMTP id iv1so16945639pac.2 for ; Wed, 27 Apr 2016 01:47:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=GKNvC2w3B0yE+aRxJnHNeYIXgIEGgJEBHPJynAufR6A=; b=QLbf8bhLUzKoFxH2VBbsMHK6pcoYVHB3Dfi7SCpNT0BIruqT3Q4/aYM9ET4id8uqfP 0AJQ/iLH4Cv85C/FESt0c7rkaICx2rUrj6OSPTlFhzOwNccrI+OAeGGKZZYXYs8a2+cD sw0TlEE9XlOjLZRvUUdIuQS/6M+VPJ/iI3aI9bh+Zzj7RVmkZ/PM9xi353PM1UcZHNWh vk5N1g/jEfo6bNiZ9gQB+3doMkYU7CcTrrhDEOywmFqbe8l7nguLgRtB29MnHH8Z6PMh Mdvk1AY88ADlrtJMt/Z2rAD3liyBnBYF7RcjyhZGNjXjwn6f+Y1VE8gMVe0kxwsTb9Cu P+2w== X-Gm-Message-State: AOPr4FWfkUOQk9tZUyYcy0Dwfg2ivjC+tWqH9rXchsk4zJ61zkBf77Hoja/thl1YpqZAPA== X-Received: by 10.66.80.72 with SMTP id p8mr10065837pax.38.1461746850617; Wed, 27 Apr 2016 01:47:30 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id uw2sm4639013pac.10.2016.04.27.01.47.27 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 27 Apr 2016 01:47:29 -0700 (PDT) From: Yao Qi To: Walfred Tedeschi Cc: qiyaoltc@gmail.com, palves@redhat.com, gdb-patches , brobecker@adacore.com Subject: Re: Fwd: FW: [PATCH V5 1/2] Initialize bnd register before performing inferior calls. References: <571F7CC8.7070702@intel.com> Date: Wed, 27 Apr 2016 08:47:00 -0000 In-Reply-To: <571F7CC8.7070702@intel.com> (Walfred Tedeschi's message of "Tue, 26 Apr 2016 16:35:52 +0200") Message-ID: <86h9enfnfn.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00574.txt.bz2 Walfred Tedeschi writes: [Could you reply to the mail rather than forward?] > That is true, but not unattended. In case BND registers are not set > to init state the current context value will be used for the inferior > call. > Causing with a higher chance a BND violation. > If the BND violation is caused by GDB inferior call, GDB should take care of the violation. If the violation is caused by the function itself we are doing inferior call, it is the right behavior. Take the breakpoint for example, if I set a breakpoint in function foo, and do the inferior call, the breakpoint is hit, (gdb) b foo Breakpoint 2 at 0x4004fa: file 2.c, line 11. (gdb) p foo () Breakpoint 2, foo () at 2.c:11 11 counter =3D 1; The program being debugged stopped while in a function called from GDB. Evaluation of the expression containing the function (foo) will be abandoned. When the function is done executing, GDB will silently stop. (gdb) bt #0 foo () at 2.c:11 #1 #2 main (argc=3D1, argv=3D0x7fffffffdfc8) at 2.c:15 > The question is was that intended by the user? Likely not. > It has nothing to do with user's intention. It is about the consistency of GDB behavior. If the execution of function foo triggers BND violation, the inferior call to function foo (with the same context) should trigger the BND violation as well. > Also it will invalidate the inferior call usage. The inferior call > will finish before returning the result back to the user. Looks the inferior call aborts when BND violation is triggered. IMO, GDB should stop and frame #0 is the place where BND violation is triggered. --=20 Yao (=E9=BD=90=E5=B0=A7)