From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18744 invoked by alias); 20 Dec 2014 17:19:59 -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 18731 invoked by uid 89); 20 Dec 2014 17:19:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sat, 20 Dec 2014 17:19:58 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 582CD11640B; Sat, 20 Dec 2014 12:19:56 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 5z7CrRmRnkPU; Sat, 20 Dec 2014 12:19:56 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 46416116409; Sat, 20 Dec 2014 12:19:56 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id DA96B40164; Sat, 20 Dec 2014 12:19:55 -0500 (EST) Date: Sat, 20 Dec 2014 17:19:00 -0000 From: Joel Brobecker To: David Taylor Cc: Stan Shebs , "gdb-patches@sourceware.org" Subject: Re: two agent expression nits (one line each) Message-ID: <20141220171955.GG12884@adacore.com> References: <14583.1410458050@usendtaylorx2l> <547E24E5.8050908@earthlink.net> <20141213134428.GF5457@adacore.com> <23074.1418658035@usendtaylorx2l> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23074.1418658035@usendtaylorx2l> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-12/txt/msg00590.txt.bz2 Hi David, > > Would you mind taking care of that for us? I kept that message around > > in the hope that I'd have a clearer picture with a little extra time, > > but I am still not sure whether you're just suggesting a documentation > > fix, or if you're saying we should fix the implementation... > > The first part is pure documentation -- the description is correct but > the summary line is wrong. The second part is implementation -- the > consumed and produced fields are used to check for stack underflow and > overflow. > > The fields are used by gdb and gdbserver for sanity checking the > bytecode expression -- checking for underflow and overflow. > > The underflow check catches bad bytecode sequences generated by GDB. > > Since DEFOP has consumed as 0 when it is really 1, that means that GDB > will think that there is more on the stack than there really is. > > So, if GDB generates a bytecode sequence that underflows it might not > catch it. It does not currently generate bad sequences, so fixing it > will merely help catch future lossage. > > As I recall, the overflow check is used by gdbserver to verify that it > has sufficent stack space for the expression. The bad DEFOP line makes > it think that the expression is using one more stack slot than reality. > But, gdbserver has fairly generous bytecode stack space -- so unless the > expression is really complicated, that won't happen. Since you understand what should be done, would you mind sending a patch in for Stan to review? -- Joel