bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs gud does not work with libtool


From: Justin Randall
Subject: emacs gud does not work with libtool
Date: Tue, 26 Aug 2003 11:38:24 -0500 (CDT)
User-agent: SquirrelMail/1.4.1

The gud.el included with emacs 21.3 prepends arguments to gdb
M-x gdb
Run gdb as: gdb <target>
which appearantly is executed as
gdb -cd <path> -fullname <target>

When fronting gdb with libtool to debug not-yet-installed programs
M-x gdb
Run gdb as: libtool gdb <target>
it's executed as
libtool -cd <path> -fullname gdb <target>

Which libtool doesn't like. This could arguably be a shortcoming of
libtool. I've made a change to gud.el to workaround this behavior:

--- gud-original.el     2003-08-26 09:50:28.000000000 -0500
+++ gud.el      2003-08-26 10:47:01.000000000 -0500
@@ -307,8 +307,7 @@
 (defvar gud-gdb-history nil)

 (defun gud-gdb-massage-args (file args)
-  (cons "-cd" (cons (expand-file-name default-directory)
-                   (cons "-fullname" args))))
+  (append args (list "-cd" (expand-file-name default-directory)
"-fullname" )))

 (defvar gud-gdb-marker-regexp
   ;; This used to use path-separator instead of ":";

gud mode will spawn gdb correctly in both cases
M-x gdb
Run gdb as: gdb <target>
executs as:
gdb <target> -cd <path> -fullname

and
M-x gdb
Run gdb as: libtool gdb <target>
executs as
libtool gdb <target> -cd <path> -fullname

Which is the correct behavior for libtool and is appearantly also correct
for gdb. I've tested this with gdb-5.3 and emacs 21.3 debugging programs
and core dumps with no problems.

Thanks to Todd Fiala for helping me grok the el change necessary to get
gdb + libtool working correctly.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]