unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Raimon Grau <raimon@konghq.com>
Cc: 31671@debbugs.gnu.org
Subject: bug#31671: 26.1; edebug-defun doesn't step if functions run in a separate thread
Date: Mon, 04 Jun 2018 19:56:28 +0300	[thread overview]
Message-ID: <83r2lmbidf.fsf@gnu.org> (raw)
In-Reply-To: <87muwfsp4i.fsf@konghq.com> (message from Raimon Grau on Thu, 31 May 2018 18:37:17 +0100)

> From: Raimon Grau <raimon@konghq.com>
> Date: Thu, 31 May 2018 18:37:17 +0100
> 
> Using edebug-defun to instrument a function and running that function in
> a separate thread using `make-thread' makes triggers the breakpoint but
> leaves the bufer in read-only-mode but the user can't interact with
> edebug in any way.
> 
> Steps to reproduce (ubuntu 16.04):
> - start emacs with emacs -Q  . 
> - in the *scratch* buffer, write:
> (defun foo ()
>   (message "hi"))
> 
> (make-thread 'foo)
> - edebug-defun function foo
> - c-x c-e the (make-thread 'foo) sexp
> - *scratch* buffer point moves to the beginning of function foo
> - press `n` and the minibuffers says: "No catch for tag: exit, nil". The
>   whole buffer is in read-only mode. modeline has
>   "(Lisp Interaction *Debugging* ElDoc)"

The problem here is that Edebug enters recursive-editing (on the
non-main thread which runs the function 'foo'), then waits for the
user to press a key.  While it waits, it releases the global lock, and
the main thread starts running.  So when you press a key, you are on a
different thread, and 'throw' doesn't have a matching 'catch' (because
that 'catch' is stored with the handlers of the thread which runs
'foo'.

Not yet sure how to deal with this.  Thoughts and ideas are welcome.





  reply	other threads:[~2018-06-04 16:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 17:37 bug#31671: 26.1; edebug-defun doesn't step if functions run in a separate thread Raimon Grau
2018-06-04 16:56 ` Eli Zaretskii [this message]
2018-06-05 14:51   ` Eli Zaretskii
     [not found] <<87muwfsp4i.fsf@konghq.com>
     [not found] ` <<83r2lmbidf.fsf@gnu.org>
2018-06-04 17:23   ` Drew Adams
2018-06-05 14:47     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83r2lmbidf.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=31671@debbugs.gnu.org \
    --cc=raimon@konghq.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).