From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: [OT] Deugging optimized code (was: [22.1.90]: Point before start of properties) Date: Fri, 22 Feb 2008 10:18:13 -0500 Message-ID: References: <6EE216E1AA959543A555C60FF34FB76702E48034@maileube01.misys.global.ad> <87wspcj0ou.fsf@stupidchicken.com> <6EE216E1AA959543A555C60FF34FB76702EED4A1@maileube01.misys.global.ad> <6EE216E1AA959543A555C60FF34FB76702EEDA6E@maileube01.misys.global.ad> <6EE216E1AA959543A555C60FF34FB7670300E86B@maileube01.misys.global.ad> <6EE216E1AA959543A555C60FF34FB7670305B82C@maileube01.misys.global.ad> <6EE216E1AA959543A555C60FF34FB7670305BF82@maileube01.misys.global.ad> <874pc1ist1.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1203693534 13606 80.91.229.12 (22 Feb 2008 15:18:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Feb 2008 15:18:54 +0000 (UTC) Cc: Simon.Marshall@misys.com, emacs-pretest-bug@gnu.org, Eli Zaretskii , rms@gnu.org, cyd@stupidchicken.com To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 22 16:19:08 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JSZfv-0006SF-S5 for ged-emacs-devel@m.gmane.org; Fri, 22 Feb 2008 16:19:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JSZfQ-0005K7-Hh for ged-emacs-devel@m.gmane.org; Fri, 22 Feb 2008 10:18:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JSZfN-0005Jw-GH for emacs-devel@gnu.org; Fri, 22 Feb 2008 10:18:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JSZfL-0005JX-Lw for emacs-devel@gnu.org; Fri, 22 Feb 2008 10:18:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JSZfL-0005JR-HD for emacs-devel@gnu.org; Fri, 22 Feb 2008 10:18:23 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JSZfL-0000oI-8l for emacs-devel@gnu.org; Fri, 22 Feb 2008 10:18:23 -0500 Original-Received: from mx10.gnu.org ([199.232.76.166]) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JSZfK-0004Bm-Sr for emacs-pretest-bug@gnu.org; Fri, 22 Feb 2008 10:18:22 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JSZfH-0000nJ-KG for emacs-pretest-bug@gnu.org; Fri, 22 Feb 2008 10:18:22 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JSZfD-0000lq-Rj; Fri, 22 Feb 2008 10:18:16 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAALN2vkfO+J2cdGdsb2JhbACQYAEwnnWBAXo X-IronPort-AV: E=Sophos;i="4.25,391,1199682000"; d="scan'208";a="14844812" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 22 Feb 2008 10:18:14 -0500 Original-Received: from pastel.home ([206.248.157.156]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id CRO12914; Fri, 22 Feb 2008 10:18:14 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id A5C738A37; Fri, 22 Feb 2008 10:18:13 -0500 (EST) In-Reply-To: <874pc1ist1.fsf@uwakimon.sk.tsukuba.ac.jp> (Stephen J. Turnbull's message of "Fri, 22 Feb 2008 12:16:58 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:89969 gmane.emacs.pretest.bugs:21265 Archived-At: >> Debugging optimized code is [...] a wrong question. > Intel thanks you for your marketing of their future products! I guess I do, but I don't think you quite understood what I meant: I indeed value correctness over speed (and really, Emacs is a good example of low-speed program, both as a program (difficult to make it fly) and as a language design&implementation); but my comment was pointing out something else about "debugging optimized programs". Basically such debugging comes up in a few different cases: 1 - the need to debug a program that is too-slow if not optimized. 2 - a bug in the compiler optimization phase. 3 - a bug that is depends on an unspecified behavior in the language, and which happens not to be triggered unless some optimization phase of the compiler is used. 4 - a timing-dependent bug. Case 1 is best solved by using a different approach to debugging: instead of a GDB-style approach (where the compiler does its thing regardless of debugging and then the debugger is expected to be able to present the result in a meaningful manner to the programmer), you can take an Edebug-style approach where the *source* program is annotated (maybe on the fly and then recompiled/reoptimized), in which case there may not even be *any* need for "debugging-info" and the compiler&optimizer can hence be made simpler and the debugger can be (somewhat) independent from the compiler. That's what I meant by "a wrong question": instead of solving the impossible debugging problem after-the-fact (after the optimizer has done its thing), you can solve a different problem (annotate the source program) instead. As for the other 3 situations, here's my take on it: 2 - use better software engineering technology, based on formal systems, to rule out these possibilities. That's my area of research ;-) 3 - use a better specified language. 4 - There are all kinds of approaches to debug and/or formally verify race conditions. Stefan