From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#21528: 25.0.50; gud tries to guess what file we're debugging, which can take a long time Date: Mon, 21 Sep 2015 00:39:13 -0700 Message-ID: <87pp1c8bmm.fsf@secretsauce.net> References: <87r3ls8p02.fsf@secretsauce.net> <83oagwnthf.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1442821234 20063 80.91.229.3 (21 Sep 2015 07:40:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Sep 2015 07:40:34 +0000 (UTC) Cc: 21528@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 21 09:40:23 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zdvi2-0005Sr-RJ for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Sep 2015 09:40:23 +0200 Original-Received: from localhost ([::1]:56362 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zdvhs-0005a4-2t for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Sep 2015 03:40:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zdvhn-0005Xf-TF for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2015 03:40:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zdvhj-0005n2-Us for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2015 03:40:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zdvhj-0005mS-PY for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2015 03:40:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zdvhj-0001p8-76 for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2015 03:40:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Sep 2015 07:40:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21528 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21528-submit@debbugs.gnu.org id=B21528.14428211586945 (code B ref 21528); Mon, 21 Sep 2015 07:40:03 +0000 Original-Received: (at 21528) by debbugs.gnu.org; 21 Sep 2015 07:39:18 +0000 Original-Received: from localhost ([127.0.0.1]:39454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zdvgz-0001nw-QE for submit@debbugs.gnu.org; Mon, 21 Sep 2015 03:39:18 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:47339) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zdvgx-0001nn-N2 for 21528@debbugs.gnu.org; Mon, 21 Sep 2015 03:39:16 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3A5BA2037D for <21528@debbugs.gnu.org>; Mon, 21 Sep 2015 03:39:15 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Mon, 21 Sep 2015 03:39:15 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=2vSw5 sLIdRp2OhEsAK0J8pVdD3o=; b=sg9M6S6IRkiWkLzaK+xrdjnAFVCZu0UYP1+Z+ Rc18mcBQ3j7922r+1pHa2+/JMc3zcjiMIFypJtzEgy23umS+yl9LpQENgaeEpPnf vYYUVUp7v8CM/j2rcBtumhmCj007b90PLXXymvVQte2Fdo+FdzFgDt/efSnCjG4L xjrgsk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=2vSw5sLIdRp2OhEsAK0J8pVdD3o=; b=JafvP LYv3d9O63B0pay4QbGbL/AFKHV/qsO5p8/O5iFuUdexZhL6MqvwIdE77BWsDScM+ IS93W/nlZRpoVAfLyIPBokJS7Va8+PSwzEZJpt28NJTPF4jD7rNq+D95WKNtOx/v WWGFY+K4WOQEkO1LXX/p4SWxcIh0YjCSl2Ebxg= X-Sasl-enc: WrzZOPA8rsSXhht/Q9DZtG0NKCfpNovSJE6MdgmOcPms 1442821154 Original-Received: from shorty.local (50-1-153-216.dsl.dynamic.fusionbroadband.com [50.1.153.216]) by mail.messagingengine.com (Postfix) with ESMTPA id E1319C00018; Mon, 21 Sep 2015 03:39:14 -0400 (EDT) Original-Received: from ip6-localhost ([::1] helo=shorty) by shorty.local with esmtp (Exim 4.84) (envelope-from ) id 1Zdvgv-0005Rl-Fk; Mon, 21 Sep 2015 00:39:13 -0700 In-reply-to: <83oagwnthf.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106760 Archived-At: Eli Zaretskii writes: >> If I'm doing remote debugging with tramp and the current directory >> has many files in it, then emacs can sit there for a very long time >> before opening the minibuffer, while it looks at all the files in the >> remote directory. I think this delay changes this behavior from >> not-useful to harmful, and I think it should be removed. Thoughts? > > Removing it altogether, based on your personal and very specific use > case, would be too drastic, IMO. Completely agree that my opinion should play only a small role. Let me push that argument a tiny bit more, and I'll leave it alone. The current heuristic assumes that both 1. The program we're debugging lives in the current directory 2. The program is executable Both of those could be true, but probably not all that often. Especially the "program is executable part" easily fails for interpreted languages. OK. Now for better solutions. The current logic is: (dolist (f (directory-files default-directory) file) (if (and (file-executable-p f) (not (file-directory-p f)) (or (not file) (file-newer-than-file-p f file))) (setq file f))) With tramp each of the file system calls above are a separate tramp call, and the overhead becomes very significant. I don't know enough about tramp to know if consolidating these would be possible. The heuristic could be more useful be filtering on file extensions. So for instance looking at only .py files for pdb could be good, but this could be wrong, and wouldn't really speed up the above code. Finally as currently written, perldb doesn't run that code at all, but simply tries to debug the script in the current buffer. This could easly apply to python too, if we decide.