all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hannu Koivisto <azure@iki.fi>
To: nickrob@snap.net.nz (Nick Roberts)
Cc: 4437@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
Subject: bug#4437: 23.1.50; Quitting gdb leaves a process behind
Date: Fri, 18 Sep 2009 15:44:10 +0300	[thread overview]
Message-ID: <83zl8se82t.fsf@kalahari.s2.org> (raw)
In-Reply-To: <19120.18090.883591.554535@totara.tehura.co.nz> (Nick Roberts's message of "Wed, 16 Sep 2009 14:00:10 +1200")

nickrob@snap.net.nz (Nick Roberts) writes:

>  > Start emacs with -q option, start gdb to debug any program
>  > (M-x gdb RET C-a gdb -i=mi ./some-program), quit immediately by typing
>  > quit RET to gdb command line (and answer "yes" to the question
>  > whether to kill the process associated to the buffer) and finally list
>  > processes with M-x list-processes RET.
>  >
>  > Expected result: no processes.
>  > Actual result:
>  > 
>  > Proc	     Status   Buffer   Tty	   Command
>  > ----	     ------   ------   ---	   -------
>  > gdb-inferior run      (Killed) /dev/pts/15 
>  > 
>  > If I start gdb again after this, I get a new gdb-inferior<1>
>  > process which again is left running when I quit gdb.
>
> If you want to run the same, but possibly newly compiled executable it's
> generally best not to quit GDB.  GDB will automatically load the new code
> and it has the advantage of keeping shell history, breakpoints etc.  You
> may need to change the line numbers on some breakpoints if the surrounding
> code has changed. 

Did you mean to give this advice as a workaround for the leakage
problem?  Sure.  I can even restart Emacs, I have no problem living
with the problem till it gets fixed.

As a general comment to this history stuff, it wouldn't be a bad
feature if Emacs could provide history and breakpoint persistence
over gud/gdb sessions.

> If you want to run a different executable then it's best to kill the GUD
> buffer before starting a new session.

>  > I've also seen cases where "quit" command to gdb does absolutely
>  > nothing.  In at least some sub-cases, if I then say M-x list-processes
>  > RET, _then_ I get the question whether to kill the process associated to
>  > the buffer and if I say "yes", the debugger quits and I get "Debugger
>  > finished" in the gdb buffer.
>
> Similar problems were reported as part of bug#4375.  I'm still looking in
> to it.

I read through that bug entry some time ago (after I got your mail)
and I think I saw the process leakage being mentioned there, but I
don't think I saw this particular quit problem.  There were some
other quit problems, though, and maybe many of these are related.

For what it's worth, I now know how to reproduce this one.  All I
need to do in addition to what I did to reproduce the leakage
problem is to set a temporary breakpoint to main function and "run"
to it before invoking quit.

I forgot to mention that I'm using gdb 6.8.

-- 
Hannu





  reply	other threads:[~2009-09-18 12:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-14 20:54 bug#4437: 23.1.50; Quitting gdb leaves a process behind Hannu Koivisto
2009-09-16  2:00 ` Nick Roberts
2009-09-18 12:44   ` Hannu Koivisto [this message]
2009-09-22  5:36     ` Nick Roberts
2012-04-20  6:40 ` Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zl8se82t.fsf@kalahari.s2.org \
    --to=azure@iki.fi \
    --cc=4437@emacsbugs.donarmstrong.com \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=nickrob@snap.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.