Re: gdb adds random filename to command

2007-01-19 Thread Stefan Monnier
 (In my case, I would never notice that it selected the wrong file, because
 I bypass the confirmation step using a macro that presses return for me
 and then changes to the directory from which I want to be in when I run).

So that's the source of your problem.

I think a better request would be to change the UI such that M-x gdb can do
what your macro does.


Stefan


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: gdb adds random filename to command

2007-01-19 Thread David L
 (In my case, I would never notice that it selected the wrong file, 
because

 I bypass the confirmation step using a macro that presses return for me
 and then changes to the directory from which I want to be in when I 
run).


So that's the source of your problem.

Fair enough, although I'm guessing that many people get in the habit of
accepting the default without inspecting it too closely.  Most times, the
default will be correct and everyone is happy... sometimes the default
will be wrong but will be immediately obvious (for example emacs
decided I was trying to debug an excel spreadsheet with gdb because
it was executable... ask Bill Gates why ;) ).  But every once in a while,
people will think they're debugging one program and they'll actually
be debugging another.  That will be very frustrating for them (although
it's their own fault for not paying closer attention I guess).



I think a better request would be to change the UI such that M-x gdb can do
what your macro does.



To get my old build process working with the new emacs (with the help
of Nick Roberts), I have a section of my makefile that looks like the
following:

@echo (defun debug-project ()$(EXECDIR)$(EXECROOT).lisp
@echo (interactive)$(EXECDIR)$(EXECROOT).lisp
@echo (switch-to-buffer \*scratch*\)  $(EXECDIR)$(EXECROOT).lisp
	@echo (cd \$(CVSROOTLEVEL)/$(MAKEFILEDIR)\)  
$(EXECDIR)$(EXECROOT).lisp
	@echo (gdb \gdb --annotate=3 $(CVSROOTLEVEL)/$(EXECDIR)$(EXECROOT)\)  
$(EXECDIR)$(EXECROOT).lisp

@echo (switch-to-buffer \*scratch*\)  $(EXECDIR)$(EXECROOT).lisp
@echo (bury-buffer))  $(EXECDIR)$(EXECROOT).lisp
@echo (global-set-key [f4]  'debug-project)  
$(EXECDIR)$(EXECROOT).lisp

This generates a file with emacs lisp code that defines a function 
debug-project that
can be invoked using the f4 key.  It changes to the *scratch* buffer in 
preparation
for running a cd (change directory) command to prevent a buffer I care about 
from
having its directory changed.  Then it changes to the directory containing 
my
makefile (which in my case is the directory I want to be in when I run the 
debugger).
Then it runs gdb with the appropriate executable filename.  Then it buries 
the

*scratch* buffer so it isn't the default next buffer.

I have an emacs target in my makefile that generates an etags file (which 
is nice
because your makefile knows about all of your source code) and also 
generates
a lisp file including the section above.  emacs is opened automatically and 
loads
the tags table and the lisp file... by doing this, my emacs session knows 
about all
of my source code which may be scattered across multiple directories and 
knows
the executable filename/location and the directory I want to be in when I 
debug.


So my problems with the new executable filename guessing feature are solved.
Thanks!  I still am of the opinion that this feature should be able to be 
disabled,
but I think this discussion has run its course on this list.  It seemed like 
a bug at

the time. :}

   David

_
Turn searches into helpful donations. Make your search count. 
http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_donationFORM=WLMTAG




___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: gdb adds random filename to command

2007-01-17 Thread David L



  I loaded a lisp file like this emacs -l foo.lisp at the command line.
  That file contained one line:
  (setq gud-gdb-command-name gdb --annotate=3 /tmp/foo)
 
  When I tried to run gdb using M-x gdb, it added a random filename from
  the working directory to the end of the gdb command like this:
  gdb --annotate=3 foo randomfilename

That's because it tries now to guess the name of the executable that you
want to debug.

  Although it's possible, I'm doing something wrong, the behavior is
  different with older versions of emacs.

It looks like gud-gdb-command-name wasn't documented in earlier Emacsen but
it is now:

  Documentation:
  Default command to execute an executable under the GDB debugger.

It's also mentioned in the Emacs manual now.  I suggest that you leave it 
at

it's default value and type in the name of the executable.


I use makefiles for a project to open emacs with etags and a preconfigured
gud-gdb-command-name.  When using emacs as an IDE, this makes my life
easier... especially since in real life, my gud command has a filename
a lot more complicated than /tmp/foo:

gdb --annotate=3 
/projects/dl/cvstrunk/shared/sw/gvu/bin/fc6debug1_singlethread/gvu


I don't like typing that long filename.  If the new behavior is not a bug 
that will be fixed,

any suggestions for getting the old behavior?

Thanks...

 David



--
Nick   
http://www.inet.net.nz/~nickrob


_
Search for grocery stores. Find gratitude. Turn a simple search into 
something more. 
http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_gratitudeFORM=WLMTAG




___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: gdb adds random filename to command

2007-01-17 Thread Nick Roberts
  I use makefiles for a project to open emacs with etags and a preconfigured
  gud-gdb-command-name.  When using emacs as an IDE, this makes my life
  easier... especially since in real life, my gud command has a filename
  a lot more complicated than /tmp/foo:
  
  gdb --annotate=3 
  /projects/dl/cvstrunk/shared/sw/gvu/bin/fc6debug1_singlethread/gvu
  
  I don't like typing that long filename.  If the new behavior is not a bug 
  that will be fixed,
  any suggestions for getting the old behavior?

I don't know the exact details but maybe, in your lisp file, you could put:

(setq default-directory 
/projects/dl/cvstrunk/shared/sw/gvu/bin/fc6debug1_singlethread/)

Emacs doesn't add a random filename, as you suggest, but the most recently
compiled executable, so it might even find your executable in this case.  If
not, you will only have to type gvu.

I think gud-gdb-command-name was never meant to include the executable, it just
worked.  The reason for not including it, I guess, is that users generally want
to debug more than one filename.  I think that, generally, the convenience of
Emacs guessing the right name of the executable is greateer than the
inconvenience of guessing the wrong one.

-- 
Nick   http://www.inet.net.nz/~nickrob


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: gdb adds random filename to command

2007-01-17 Thread Kevin Rodgers

David L wrote:


  I loaded a lisp file like this emacs -l foo.lisp at the command 
line.

  That file contained one line:
  (setq gud-gdb-command-name gdb --annotate=3 /tmp/foo)
 
  When I tried to run gdb using M-x gdb, it added a random filename from
  the working directory to the end of the gdb command like this:
  gdb --annotate=3 foo randomfilename

That's because it tries now to guess the name of the executable that you
want to debug.

  Although it's possible, I'm doing something wrong, the behavior is
  different with older versions of emacs.

It looks like gud-gdb-command-name wasn't documented in earlier 
Emacsen but

it is now:

  Documentation:
  Default command to execute an executable under the GDB debugger.

It's also mentioned in the Emacs manual now.  I suggest that you leave 
it at

it's default value and type in the name of the executable.


I use makefiles for a project to open emacs with etags and a preconfigured
gud-gdb-command-name.  When using emacs as an IDE, this makes my life
easier... especially since in real life, my gud command has a filename
a lot more complicated than /tmp/foo:

gdb --annotate=3 
/projects/dl/cvstrunk/shared/sw/gvu/bin/fc6debug1_singlethread/gvu


I don't like typing that long filename.  If the new behavior is not a 
bug that will be fixed,

any suggestions for getting the old behavior?


Use environment variables for the directory and/or file name?


--
Kevin Rodgers
Denver, Colorado, USA



___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


gdb adds random filename to command

2007-01-16 Thread David L

I loaded a lisp file like this emacs -l foo.lisp at the command line.
That file contained one line:
(setq gud-gdb-command-name gdb --annotate=3 /tmp/foo)

When I tried to run gdb using M-x gdb, it added a random filename from
the working directory to the end of the gdb command like this:
gdb --annotate=3 foo randomfilename

Although it's possible, I'm doing something wrong, the behavior is
different with older versions of emacs.


In GNU Emacs 22.0.92.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2007-01-10 on beavis.linux.home
X server distributor `The X.Org Foundation', version 11.0.70101000
Important settings:
 value of $LC_ALL: nil
 value of $LC_COLLATE: nil
 value of $LC_CTYPE: nil
 value of $LC_MESSAGES: nil
 value of $LC_MONETARY: nil
 value of $LC_NUMERIC: nil
 value of $LC_TIME: nil
 value of $LANG: en_US.UTF-8
 locale-coding-system: utf-8
 default-enable-multibyte-characters: t

Major mode: Debugger

Minor modes in effect:
 tooltip-mode: t
 tool-bar-mode: t
 mouse-wheel-mode: t
 menu-bar-mode: t
 file-name-shadow-mode: t
 global-font-lock-mode: t
 font-lock-mode: t
 blink-cursor-mode: t
 unify-8859-on-encoding-mode: t
 utf-translate-cjk-mode: t
 auto-compression-mode: t
 line-number-mode: t

Recent input:
escape x g d b return return help-echo help-echo
help-echo help-echo help-echo help-echo help-echo
help-echo help-echo help-echo help-echo help-echo
help-echo help-echo help-echo help-echo help-echo
help-echo menu-bar help-menu report-emacs-b
ug

Recent messages:
(emacs -l foo.lisp)
For information about the GNU Project and its goals, type C-h C-p. [2 times]
Loading gud...
Loading easy-mmode...done
Loading gud...done
Loading emacsbug...
Loading regexp-opt...done
Loading emacsbug...done

_
Dave vs. Carl: The Insignificant Championship Series.  Who will win? 
http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://davevscarl.spaces.live.com/?icid=T001MSN38C07001




___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: gdb adds random filename to command

2007-01-16 Thread Nick Roberts
  I loaded a lisp file like this emacs -l foo.lisp at the command line.
  That file contained one line:
  (setq gud-gdb-command-name gdb --annotate=3 /tmp/foo)
 
  When I tried to run gdb using M-x gdb, it added a random filename from
  the working directory to the end of the gdb command like this:
  gdb --annotate=3 foo randomfilename

That's because it tries now to guess the name of the executable that you
want to debug.

  Although it's possible, I'm doing something wrong, the behavior is
  different with older versions of emacs.

It looks like gud-gdb-command-name wasn't documented in earlier Emacsen but
it is now:

  Documentation:
  Default command to execute an executable under the GDB debugger.

It's also mentioned in the Emacs manual now.  I suggest that you leave it at
it's default value and type in the name of the executable.

-- 
Nick   http://www.inet.net.nz/~nickrob


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug