解决emacs错误的想法:“apply:产生子进程:exec格式错误” [英] Ideas for troubleshooting emacs error: "apply: Spawning child process: exec format error"

查看:260
本文介绍了解决emacs错误的想法:“apply:产生子进程:exec格式错误”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用rdebug与emacs和cygwin和我遇到麻烦。每当我做一个Mx rdebug并给它适当的脚本运行,它停止与错误

I'm trying to use rdebug with emacs and cygwin and I'm running into trouble. Whenever I do a M-x rdebug and give it the appropriate script to run, it stops with the error

 "apply: Spawning child process: exec format error"

从一些googling,似乎这可能发生,如果我试图通过Windows命令提示符启动cygwin可执行文件,反之亦然。如果可执行文件的路径是unix风格的链接,也可能发生。

From some googling, it seems like this could happen if I'm trying to launch a cygwin executable via the windows command prompt or vice versa. It could also happen if the path to the executable is a unix style link.

我试图找出rdebug被执行的地方,以检查这些是哪里是问题,以及如何解决它。

I'm trying to figure out the place where rdebug is being exec'd from to check which of these is the problem and how to fix it.

我已经尝试了下面的尝试,但没有快乐:
*使用edebug on rdebug和它的callees:让我进入gud-common-init我很快失去了我的方式试图找出exec的呼叫发生在哪里。
*尝试将shell从cygwin切换到windows,然后返回查看是否有任何区别:完全没有区别。

I've tried the following so far, but no joy: * Use edebug on rdebug and it's callees: That got me into gud-common-init and I quickly lost my way trying to find out where the exec call is happening. * Try switching the shell from cygwin to windows and back to see if there is any difference: no difference at all.

注意,我可以运行rdebug我的Windows shell以及从我的cygwin shell(通过Mx shell调用)。我猜/ usr / bin / rdebug和/usr/bin/rdebug.bat与这有关。

Note that I can run rdebug from my windows shell as well as from my cygwin shell (invoked via M-x shell). I'm guessing the /usr/bin/rdebug and /usr/bin/rdebug.bat have something to do with this.

任何想法来修复或调试这个问题真的很棒。

Any ideas to fix this or to debug this issue would be really great.

我设法想出我可以复制尝试使用comint-run执行rdebug的问题(Mx Comint-run ENTER rdebug ENTER)。从一些调试和涉水代码,看起来emacs正在调用start-file-process(类似于comint-run)来启动rdebug进程。

I managed to figure out that I can replicate the same problem with attempting to execute rdebug using comint-run (M-x comint-run ENTER rdebug ENTER). From some debugging and wading thru' the code, it looks like emacs is calling start-file-process (similar to the comint-run) to start the rdebug process.

在加载cygwin时,我也有以下情况:

I also have the following while loading up cygwin:

;;; Use `bash' as the default shell in Emacs.
(setq exec-path (cons  cygwin-bin exec-path))
(setq shell-file-name (concat cygwin-bin "/bash.exe")) ; Subprocesses invoked via the shell.
(setenv "SHELL" shell-file-name)
(setenv "PATH" (concat 
        (getenv "PATH") 
        (concat ";" (substring data-directory 0 2) "\\cygwin\\bin")) )
(setq explicit-shell-file-name shell-file-name) ; Interactive shell
(setq explicit-shell-args '("--login" "-i"))
(setq w32-quote-process-args ?\") ;; " 



更多进度



暂时重命名rdebug.bat comint-run通过dos shell调用rdebug.bat。我想rdebug通过bash shell调用时调用comint-run。任何想法如何指定哪个shell comint-run使用?

More progress

Temporarily renaming rdebug.bat revealed that comint-run was invoking rdebug.bat via a dos shell. I'd like rdebug to be invoked via a bash shell when I invoke comint-run. Any ideas on how to specify which shell comint-run uses?

推荐答案

我有同样的问题,发现以下简单的解决方法。

I have the same problem and found the following simple workaround.

输入Mx rdebug后,它提示要执行的命令。以下命令显示为默认设置:

After entering M-x rdebug, it prompts the command to be executed. The following command is displayed as default setting:

Run rdebug (like this): rdebug --emacs 3 hanoi.rb

将此命令修改为:

Run rdebug (like this): ruby /usr/bin/rdebug --emacs 3 hanoi.rb


b $ b

将能够解决报告的问题。

will be able to workaround the reported problem.

这篇关于解决emacs错误的想法:“apply:产生子进程:exec格式错误”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆