senny / emacs-eclim

This project brings some of the great eclipse features to emacs developers. It is based on the eclim project, which provides eclipse features for vim.
http://www.emacswiki.org/emacs/EmacsEclim
587 stars 102 forks source link

eclim-debug/jdb: Symbol's function definition is void: toggle-maximize-buffer #253

Open ghost opened 8 years ago

ghost commented 8 years ago

I want to debug java code, I run eclim-debug-attach, get error: eclim-debug/jdb: Symbol's function definition is void: toggle-maximize-buffer

My os is mac 10.11 emacs version: 24.5.1

ProjectMoon commented 8 years ago

Having this as well. It appears toggle-maximize-buffer is not a standard emacs function. The only thing I found for it is https://gist.github.com/mads379/3402786.

skybert commented 8 years ago

ProjectMoon writes:

Having this as well. It appears toggle-maximize-buffer is not a standard emacs function. The only thing I found for it is https://gist.github.com/mads379/3402786.

You're right. The call to toggle-maximize-buffer was introduces in 79d6e3a70e99d2e47fdaaba7a030300f6a010b99 to open jdb in a different window but keep focus in the current one.

Adding this gist to your .emacs solves the problem.

Cheers,

-Torstein

ghost commented 8 years ago

Thank you @ProjectMoon and @skybert, I have another question: how to add breakpoint, and how to add debug configure with maven?

skybert commented 8 years ago

zwb-ict writes:

I have another question: how to add breakpoint, and how to add debug configure with maven?

After you've started jdb with eclim-debug-attach, everything is set up for you with regards to source and classpath. The interface to jdb is gud, so you set breakpoints with gud-break and navigate the debugger with C-c C-n (next) and so on.

See the GUD manual for more: https://www.gnu.org/software/emacs/manual/html_node/emacs/Commands-of-GUD.html

Also, I'd recommend you to enter "monitor locals" into jdb once it's running so that it's constantly updating the local variables for you.

I'm using a very simple command that I call once my gud/jdb session is open, which does that as well as giving me some colour coding on the variables and any references to the project's classes:

(defun tkj-java-debug-highlighting()
  (interactive)
  (insert "monitor locals\n")
  (highlight-regexp "^[a-zA-Z].* =" "hi-green")
  (highlight-phrase "com.escenic" "hi-red-b"))

That's it. You don't need anything more for debugging local JUnit tests or remote Java processes (given that they're started with standard JVM parameters for remote debugging and that you enter the right port after you run attach).

Cheers,

-Torstein

ghost commented 8 years ago

Thank you, @skybert, I did as you told, it works greate now!

ProjectMoon commented 8 years ago

This shouldn't be closed, I would think. This is a problem with emacs-eclim because Emacs itself does not have the function referenced in this issue. I say this should be reopened as a request to include the function referenced in the gist a part of emacs-eclim so the debugger works out of the box.

ulises commented 8 years ago

+1 to not closing. Having to add a gist to your .emacs is by no means a fix to this issue.