Alexandre Bourget

geek joy

Geben + Emacs + Ubuntu, and Make the debugging work

September 13, 2010 at 09:55 AM

Geben is a neat piece of debugging tool for Emacs, which allows to remotely debug your applications.

I found that neat page that gives a quick how-to install Geben to debug PHP (xdebug) / Python apps.. but it doesn't close the loop.

Here's what you'll need to wire-in your emacs installation to have it actually work:

Add this to your ~/.emacs file:

(add-to-list 'load-path "/usr/share/emacs/23.1/site-lisp/geben") ; Geben directory
; Optionally load it on every run (only the library, won't run the server automatically)
(require 'geben)

If you haven't loaded it with require, then you'll need to run this in your emacs session:

M-x load-library geben

That is ESC and then 'x' on my machine, then type load-library in the bottom box, then it'll ask the library to load, and enter geben

The moment you want to start debugging, run M-x geben, and Emacs will start listening on port 9000 for incoming connections from your debugging server

To discover the shortcuts, in emacs, run C-h b and look at the Geben minor mode key bindings.

Here's a quick glance:

SPC             geben-step-again
>               geben-set-redirect
?               geben-mode-help
B               geben-breakpoint-menu
U               geben-clear-breakpoints
b               geben-set-breakpoint-line
c               geben-run-to-cursor
d               geben-show-backtrace
e               geben-eval-expression
g               geben-run
i               geben-step-into
o               geben-step-over
q               geben-stop
r               geben-step-out
t               geben-show-backtrace
u               geben-unset-breakpoint-line
v               geben-display-context
w               geben-where

C-x SPC         geben-set-breakpoint-line

C-c C-c         geben-run
C-c C-d         geben-unset-breakpoint-line
C-c C-l         geben-where
C-c C-n         geben-step-over
C-c C-s         geben-step-into
C-c C-t         geben-set-breakpoint-line
C-c b           geben-show-breakpoint-list
C-c f           geben-find-file
C-c p           geben-toggle-pause-at-entry-line-flag

Hope this helps.

blog comments powered by Disqus