weirdNox / emacs-gdb

GDB graphical interface for GNU Emacs
GNU General Public License v3.0
175 stars 10 forks source link

How to use a specific gdb? #9

Closed lucaspeixotot closed 5 years ago

lucaspeixotot commented 5 years ago

I'm working with embedded systems and for them I use a specific arm gdb, how can I change the gdb executable that is used in this package? I really liked what you did with this package, is awesome.

weirdNox commented 5 years ago

Thanks! I have added support for changing GDB's executable name with the variable gdb-executable-name. You may now do something like this in your config:

(defun gdb-arm (&rest args)
  "ARM version of `gdb-executable'"
  (interactive (advice-eval-interactive-spec (cadr (interactive-form #'gdb-executable))))
  (let ((funcall (if (called-interactively-p 'any)
                     #'funcall-interactively
                   #'funcall))
        (exec-path (append "/new/path" exec-path))
        (gdb-executable-name "gdb-with-different-name"))
   (apply funcall #'gdb-executable args)))

If you only need a different path, change exec-path. You may also use something like "/usr/bin/gdb-arm" in gdb-executable-name directly.