X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=guile18%2Femacs%2Fgud-guile.el;fp=guile18%2Femacs%2Fgud-guile.el;h=bd1b0ff269e1e5fa4334de9a0b8edd600664e0a5;hb=139c38d9204dd07f6b235f83bae644faedbc63fd;hp=0000000000000000000000000000000000000000;hpb=652ed35a2013489d0a14fede6307cd2595abb2c4;p=lilypond.git diff --git a/guile18/emacs/gud-guile.el b/guile18/emacs/gud-guile.el new file mode 100644 index 0000000000..bd1b0ff269 --- /dev/null +++ b/guile18/emacs/gud-guile.el @@ -0,0 +1,81 @@ +;;; gud-guile.el --- Support for debugging guile internals + +;; Copyright (C) 2001, 2006 Free Software Foundation, Inc. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Author: Thien-Thi Nguyen +;;; Version: 1 +;;; Favorite-Favorite: Favorite-Favorite + +;;; Commentary: + +;; This is a grab bag of stuff for doing "gdb guile" in Emacs. +;; The var `gdb-guile-suggested-gdbinit' has a string that is +;; snarfed from ../HACKING. (todo: Write `gdb-guile-init' to +;; send it to gdb...) + +;;; Code: + +(require 'cl) + +(defun gdb-guile-display-scm () + (interactive) + (save-excursion + (let ((sym (thing-at-point 'symbol)) + (proc (get-buffer-process + (find-if (lambda (buf) + (string-match "^.gud-." (buffer-name buf))) + (buffer-list))))) + (mapc (lambda (template) + (process-send-string proc (format template sym))) + (list + "set gdb_print(%s)\n" + "printf \"%s: %%s\\n\", gdb_output\n"))))) + +(defvar gdb-guile-suggested-gdbinit " +define gp +set gdb_print($arg0) +print gdb_output +end +document gp +Executes (object->string arg) +end + +define ge +call gdb_read($arg0) +call gdb_eval(gdb_result) +set gdb_print(gdb_result) +print gdb_output +end +document ge +Executes (print (eval (read arg))): ge \"(+ 1 2)\" => 3 +end + +define gh +call g_help(scm_str2symbol($arg0), 20) +set gdb_print($1) +print gdb_output +end +document gh +Prints help string for arg: gh \"enved-target\" +end +" + "A useful .gdbinit") + +(provide 'gud-guile) + +;;; gud-guile.el ends here