all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Starting gdb
@ 2009-09-03  8:14 Kay Ulbrich
  2009-09-03 10:10 ` Torsten Mueller
  0 siblings, 1 reply; 5+ messages in thread
From: Kay Ulbrich @ 2009-09-03  8:14 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I have a question concerning gdb under Emacs. When debugging, I do the
normal thing, i.e.,

	M-x gdb

and then enter the executable name. After this, in the gdb window, I can
set arguments with the gdb-command "set args".

Are there functions, which enable me to write custom Elisp-functions,
which would do this in one turn, i.e., something like

	M-x debug-myprog

which then would start debugging the desired executable and set the
arguments.

Thus one could write an Elisp-function for frequently needed executables
and argument list combinations.

Thanks for hints!

Kay



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Starting gdb
  2009-09-03  8:14 Starting gdb Kay Ulbrich
@ 2009-09-03 10:10 ` Torsten Mueller
  2009-09-03 10:27   ` Kay Ulbrich
  0 siblings, 1 reply; 5+ messages in thread
From: Torsten Mueller @ 2009-09-03 10:10 UTC (permalink / raw)
  To: help-gnu-emacs

Kay Ulbrich <kay_ulbrich@arcor.de> schrieb:

> Are there functions, which enable me to write custom
> Elisp-functions, which would do this in one turn, i.e., something
> like
>
> 	M-x debug-myprog
>
> which then would start debugging the desired executable and set the
> arguments.

Many years ago I did this using a gdb-init file. I don't remember the
exact name, look into gdb documentation, but I surely know that gdb
reads a file in the current directory while starting up. This file can
also contain paths to source files and much more.

T.M.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Starting gdb
  2009-09-03 10:10 ` Torsten Mueller
@ 2009-09-03 10:27   ` Kay Ulbrich
  2009-09-03 12:37     ` Colin S. Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Kay Ulbrich @ 2009-09-03 10:27 UTC (permalink / raw)
  To: help-gnu-emacs

Torsten Mueller wrote:

> Many years ago I did this using a gdb-init file. I don't remember the
> exact name, look into gdb documentation, but I surely know that gdb
> reads a file in the current directory while starting up. This file can
> also contain paths to source files and much more.
> 
> T.M.

Hello,

thank you for your suggestion.

It implies an entry in ~/.gdbinit like:

define myprog
  file myprog.exe
  set args --arg val
end

The problem is, that, when starting gdb in Emacs and running this macro,
one nice feature is not realized. This is the automatic opening of the
file containing the main() - function.

I thought, maybe gdb-mode offers some interface ...

Greetings
Kay





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Starting gdb
  2009-09-03 10:27   ` Kay Ulbrich
@ 2009-09-03 12:37     ` Colin S. Miller
  2009-09-03 16:04       ` Kay Ulbrich
  0 siblings, 1 reply; 5+ messages in thread
From: Colin S. Miller @ 2009-09-03 12:37 UTC (permalink / raw)
  To: help-gnu-emacs

Kay Ulbrich wrote:
> Torsten Mueller wrote:
> 
> thank you for your suggestion.
> 
> It implies an entry in ~/.gdbinit like:
> 
> define myprog
>   file myprog.exe
>   set args --arg val
> end
> 
> The problem is, that, when starting gdb in Emacs and running this macro,
> one nice feature is not realized. This is the automatic opening of the
> file containing the main() - function.
> 
> I thought, maybe gdb-mode offers some interface ...
> 
> Greetings
> Kay
> 
> 
> 
Kay,

Do the commands
   break main
   run
help?

HTH,
Colin S. Miller


-- 
Replace the obvious in my email address with the first three letters of the hostname to reply.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Starting gdb
  2009-09-03 12:37     ` Colin S. Miller
@ 2009-09-03 16:04       ` Kay Ulbrich
  0 siblings, 0 replies; 5+ messages in thread
From: Kay Ulbrich @ 2009-09-03 16:04 UTC (permalink / raw)
  To: help-gnu-emacs

Colin S. Miller wrote:

> Do the commands
>   break main
>   run
> help?
> 
> HTH,
> Colin S. Miller

Hello Colin,

this helps, i.e., now the file is displayed, with the slight difference,
that now the program is already running.

But as it stops at main, this is no big deal.

Thanks for the suggestion!
Kay


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-09-03 16:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-03  8:14 Starting gdb Kay Ulbrich
2009-09-03 10:10 ` Torsten Mueller
2009-09-03 10:27   ` Kay Ulbrich
2009-09-03 12:37     ` Colin S. Miller
2009-09-03 16:04       ` Kay Ulbrich

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.