Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Grant Edwards <grante@visi.com>
To: gdb@sources.redhat.com
Subject: How to tell gdb to exit?
Date: Thu, 06 May 2004 15:50:00 -0000	[thread overview]
Message-ID: <20040506155013.GB12206@grante.dsl.visi.com> (raw)


I'm trying to figure out how to run gdb from a shell script,
and everything works, except I can't get gdb to exit.  What I
want to do is:

 1) set target to /dev/ttyS0
 2) load an elf file
 3) start it (continue)
 4) exit gdb

Steps 1-3 work great, but at step 4) gdb won't accept a new
command in human-interface mode, so this doesn't work:

  #!/bin/bash
  h8300-elf-gdb <<EOF
  set arch h8300h
  target remote /dev/ttyS0
  load test.elf
  cont
  quit
  EOF

I tried "detach" instead of "cont" since the info file says
that it continues exection, but it doesn't actual seem to do
that for remote targets.

  
In MI mode, I can't figure out what the "quit" command is, and
it just hangs on EOF -- so this doesn't work either:

  #!/bin/bash
  h8300-elf-gdb -interpreter=mi <<EOF
  10-target-select async /dev/ttyS0
  20-target-download test.elf
  30-exec-continue
  EOF

I'm sure I'm missing an obvious clue, could somebody point it
out to me?
  
-- 
Grant Edwards
grante@visi.com


             reply	other threads:[~2004-05-06 15:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-06 15:50 Grant Edwards [this message]
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
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=20040506155013.GB12206@grante.dsl.visi.com \
    --to=grante@visi.com \
    --cc=gdb@sources.redhat.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