Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Grant Edwards <grante@visi.com>
Cc: gdb@sources.redhat.com
Subject: Re: How to tell gdb to exit?
Date: Thu, 06 May 2004 19:14:00 -0000	[thread overview]
Message-ID: <20040506191452.GA15113@nevyn.them.org> (raw)
In-Reply-To: <20040506163520.GA12806@grante.dsl.visi.com>

On Thu, May 06, 2004 at 11:35:21AM -0500, Grant Edwards wrote:
> On Thu, May 06, 2004 at 12:18:58PM -0400, Daniel Jacobowitz wrote:
> 
> > > My bad.  It looks like -target-disconnect works afer all.  [of
> > > course I swear I tried it before and it didn't.] -gdb-exit
> > > still refuses to exit, but it will exit on EOF.
> > > 
> > > So, this seems to work:
> > > 
> > >   #!/bin/bash
> > >   h8300-elf-gdb -interpreter=mi <<EOF
> > >   10-target-select async /dev/ttyS0
> > >   20-target-download test.elf
> > >   30-exec-continue
> > >   40-target-disconnect
> > >   EOF
> > > 
> > > I messed around with this on and off for days, and couldn't
> > > find the answer, but as soon as I put my foot in my mouth
> > > publically, the answer appears.  Odd, that.
> > 
> > This will leave your target stopped, presumably.
> 
> Perhaps it tries to stop the target, but it can't. Once the
> program starts, the gdb stub is "gone".  My app has taken over
> the UART for use as console I/O, and it's no longer possible to
> communicate with the gdb stub[1].  It would be nice to have
> another UART so one could be used for console I/O and the other
> for GDB, but such is life.
> 
> > The "disconnect" commandd for the CLI will do the same thing.
> > Is that what you want?
> 
> With the CLI, you can only send the disconnect command after
> you've stopped the target.  In my script above, I'm sending the
> disconnect command while the target is still running. I guess
> since it's no longer possible to stop the applicaion from gdb,
> it keeps running.

Try target async-remote?  I hadn't realized you were using async in the
MI mode; in that case, disconnect will just break the connection.

-- 
Daniel Jacobowitz


  reply	other threads:[~2004-05-06 19:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-06 15:50 Grant Edwards
2004-05-06 16:09 ` Grant Edwards
2004-05-06 16:16   ` Grant Edwards
2004-05-06 16:18     ` Daniel Jacobowitz
2004-05-06 16:35       ` Grant Edwards
2004-05-06 19:14         ` Daniel Jacobowitz [this message]
2004-05-06 18:36     ` Ian Lance Taylor
2004-05-06 18:42       ` Grant Edwards
2004-05-06 16:10 ` Daniel Jacobowitz
2004-05-06 16:11   ` Grant Edwards

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=20040506191452.GA15113@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb@sources.redhat.com \
    --cc=grante@visi.com \
    /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