This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: How to tell gdb to exit?
- From: Daniel Jacobowitz <drow at false dot org>
- To: Grant Edwards <grante at visi dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Thu, 6 May 2004 12:10:34 -0400
- Subject: Re: How to tell gdb to exit?
- References: <20040506155013.GB12206@grante.dsl.visi.com>
On Thu, May 06, 2004 at 10:50:14AM -0500, Grant Edwards wrote:
>
> 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.
It should. Whether it does or not depends on your remote stub, though.
--
Daniel Jacobowitz