From: Jim Blandy <jimb@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: Re: RFC: Don't kill the program after "file"
Date: Wed, 14 Jun 2006 20:06:00 -0000 [thread overview]
Message-ID: <vt2r71r4i3z.fsf@theseus.home.> (raw)
In-Reply-To: <20060613205014.GA20822@nevyn.them.org> (Daniel Jacobowitz's message of "Tue, 13 Jun 2006 16:50:14 -0400")
Daniel Jacobowitz <drow@false.org> writes:
> The "file" command currently prompts if a program is running:
>
> (gdb) file /bin/cat
> A program is being debugged already. Kill it? (y or n)
>
> I've encountered a couple problems with this:
>
> 1. If you say "no", it aborts the "file" command. So there is no way
> to deliberately change the file.
> 2. If you say yes, it doesn't just do the equivalent of "kill", but
> "kill" and "disconnect". For target extended-remote, this means you
> come unexpectedly disconnected from your target.
>
> This patch completely removes the prompt. Instead, we simply allow it.
> It's occasionally useful, even during native debugging (at least I know
> I've attached to a running program with the wrong file specified
> before). It's more useful during remote debugging, where I've seen
> users frequently confused that "target remote; file" doesn't work even
> though "file; target remote" does.
>
> I talked with Jim about this. He wasn't entirely happy with discarding
> the prompt for native debugging, where it traditionally makes sense; we
> didn't quite make it to an agreement on what ought to happen. He
> suggested adding a "process-oriented" flag to target vectors. For a
> process oriented target (i.e. one which can handle "run" and "kill" and
> so forth) it makes sense to offer to kill at this point; for
> board oriented targets it makes less sense. Another thing which just
> occured to me would be to make the file command succeed if you say "n"
> at the query.
I think something like that is workable. What if we simply left the
killing to the 'kill' and 'run' commands, and let the prompt say:
A program is being debugged already.
Are you sure you want to change the file? (y or n)
Saying 'y' would not kill the program.
This would mean that 'exec-file; run' when a program is running would
ask the user two questions: one to confirm the file change, and then
another to confirm the kill before restarting.
next prev parent reply other threads:[~2006-06-14 20:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-13 20:50 Daniel Jacobowitz
2006-06-14 19:55 ` Jim Blandy
2006-06-14 20:06 ` Jim Blandy [this message]
2006-06-26 19:00 ` Kevin Buettner
2006-07-12 20:16 ` Daniel Jacobowitz
2006-07-24 20:36 ` Daniel Jacobowitz
2006-08-01 20:17 Fred Fish
2006-08-01 22:11 ` Daniel Jacobowitz
2006-08-10 20:08 ` Fred Fish
2006-08-17 18:48 ` Daniel Jacobowitz
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=vt2r71r4i3z.fsf@theseus.home. \
--to=jimb@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox