GNU bug report logs -
#21528
25.0.50; gud tries to guess what file we're debugging, which can take a long time
Previous Next
Reported by: Dima Kogan <dima <at> secretsauce.net>
Date: Mon, 21 Sep 2015 02:51:02 UTC
Severity: minor
Found in version 25.0.50
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21528 in the body.
You can then email your comments to 21528 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21528
; Package
emacs
.
(Mon, 21 Sep 2015 02:51:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Dima Kogan <dima <at> secretsauce.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 21 Sep 2015 02:51:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi. Currently when the user invokes any gud-based mode ('M-x pdb' for
instance) the minibuffer pops up with a suggested command. This command
tries to guess what you're trying to debug based on some pretty
arbitrary heuristics. This is in 'gud-query-cmdline' in gud.el
These heuristics include looking at each file in the current directory
to find the most recent executable file. In my experience this almost
never is what I want. 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?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21528
; Package
emacs
.
(Mon, 21 Sep 2015 07:05:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 21528 <at> debbugs.gnu.org (full text, mbox):
> From: Dima Kogan <dima <at> secretsauce.net>
> Date: Sun, 20 Sep 2015 19:50:21 -0700
>
> Hi. Currently when the user invokes any gud-based mode ('M-x pdb' for
> instance) the minibuffer pops up with a suggested command. This command
> tries to guess what you're trying to debug based on some pretty
> arbitrary heuristics. This is in 'gud-query-cmdline' in gud.el
>
> These heuristics include looking at each file in the current directory
> to find the most recent executable file. In my experience this almost
> never is what I want. 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. Can you propose some less drastic
measure? If nothing smarter could be done automatically, a defcustom
to control this should be a stopgap, I think.
And while at that: the search for executables could bypass certain
files, like shell scripts, for example.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21528
; Package
emacs
.
(Mon, 21 Sep 2015 07:40:03 GMT)
Full text and
rfc822 format available.
Message #11 received at 21528 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> 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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21528
; Package
emacs
.
(Mon, 21 Sep 2015 08:00:05 GMT)
Full text and
rfc822 format available.
Message #14 received at 21528 <at> debbugs.gnu.org (full text, mbox):
> From: Dima Kogan <dima <at> secretsauce.net>
> Cc: 21528 <at> debbugs.gnu.org
> Date: Mon, 21 Sep 2015 00:39:13 -0700
>
> 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.
How about bypassing this search in 2 situations:
. the debuggee is on a remote system
. the debugger being invoked is for an interpreted language
Would that be "good enough"?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21528
; Package
emacs
.
(Mon, 21 Sep 2015 09:04:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 21528 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> How about bypassing this search in 2 situations:
>
> . the debuggee is on a remote system
> . the debugger being invoked is for an interpreted language
>
> Would that be "good enough"?
That would be fine by me. What do you want to do with perldb? Currently
it always bypasses this search.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21528
; Package
emacs
.
(Mon, 21 Sep 2015 09:44:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 21528 <at> debbugs.gnu.org (full text, mbox):
> From: Dima Kogan <dima <at> secretsauce.net>
> Cc: 21528 <at> debbugs.gnu.org
> Date: Mon, 21 Sep 2015 02:03:53 -0700
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > How about bypassing this search in 2 situations:
> >
> > . the debuggee is on a remote system
> > . the debugger being invoked is for an interpreted language
> >
> > Would that be "good enough"?
>
> That would be fine by me. What do you want to do with perldb? Currently
> it always bypasses this search.
Perldb is of the "interpreted language" type, isn't it?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21528
; Package
emacs
.
(Mon, 21 Sep 2015 18:25:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 21528 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> > How about bypassing this search in 2 situations:
>> >
>> > . the debuggee is on a remote system
>> > . the debugger being invoked is for an interpreted language
>> >
>> > Would that be "good enough"?
>>
>> That would be fine by me. What do you want to do with perldb? Currently
>> it always bypasses this search.
>
> Perldb is of the "interpreted language" type, isn't it?
Yep. Just making sure that you're proposing touching that too. Works for
me. Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21528
; Package
emacs
.
(Mon, 24 Jan 2022 13:58:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 21528 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Both of those could be true, but probably not all that often. Especially
>> the "program is executable part" easily fails for interpreted languages.
>
> How about bypassing this search in 2 situations:
>
> . the debuggee is on a remote system
> . the debugger being invoked is for an interpreted language
>
> Would that be "good enough"?
I don't think it's all that useful to separate interpreted vs compiled
here -- it'll be slow (or not) in any case (and interpreted files are
normally executable).
So I've just made it not do the loop if it's on a remote system, and
there's a lot of files there in Emacs 29.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug marked as fixed in version 29.1, send any further explanations to
21528 <at> debbugs.gnu.org and Dima Kogan <dima <at> secretsauce.net>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Mon, 24 Jan 2022 13:58:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 22 Feb 2022 12:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 118 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.