From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21803 invoked by alias); 13 Nov 2013 05:50:40 -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 21787 invoked by uid 89); 13 Nov 2013 05:50:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.5 required=5.0 tests=AWL,BAYES_50,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RDNS_NONE,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pa0-f41.google.com Received: from Unknown (HELO mail-pa0-f41.google.com) (209.85.220.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 13 Nov 2013 05:50:38 +0000 Received: by mail-pa0-f41.google.com with SMTP id rd3so2166785pab.28 for ; Tue, 12 Nov 2013 21:50:30 -0800 (PST) X-Received: by 10.66.250.129 with SMTP id zc1mr12351702pac.153.1384321830698; Tue, 12 Nov 2013 21:50:30 -0800 (PST) Received: from seba.sebabeach.org.gmail.com (173-13-178-50-sfba.hfc.comcastbusiness.net. [173.13.178.50]) by mx.google.com with ESMTPSA id x8sm41746735pbf.0.2013.11.12.21.50.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Nov 2013 21:50:29 -0800 (PST) From: Doug Evans To: gdb-patches@sourceware.org Subject: [commit] breakpoint.c (breakpoint_cond_eval): Fix and enhance comment. Date: Wed, 13 Nov 2013 08:11:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00338.txt.bz2 Hi. fyi, I committed this. It took a bit to determine why breakpoint_cond_eval returns the inverted condition result, so I wrote it down. 2013-11-13 Doug Evans * breakpoint.c (breakpoint_cond_eval): Fix and enhance comment. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 36252ee..f0b496d 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -4649,10 +4649,12 @@ bpstat_print (bpstat bs, int kind) return PRINT_UNKNOWN; } -/* Evaluate the expression EXP and return 1 if value is zero. This is - used inside a catch_errors to evaluate the breakpoint condition. +/* Evaluate the expression EXP and return 1 if value is zero. + This returns the inverse of the condition because it is called + from catch_errors which returns 0 if an exception happened, and if an + exception happens we want execution to stop. The argument is a "struct expression *" that has been cast to a - "char *" to make it pass through catch_errors. */ + "void *" to make it pass through catch_errors. */ static int breakpoint_cond_eval (void *exp)