Re: RFC: Don't kill the program after "file"

Daniel Jacobowitz
2006-08-01T22:11:10Z

On Tue, Aug 01, 2006 at 04:17:28PM -0400, Fred Fish wrote:
> I'm currently getting new failures with a mips-elf toolchain, and
> other toolchains, when using the simulator for testing. I'm not
> entirely sure that they are due to this change, but it seems likely.
>
> Here is a snippet from the gdb.log file:

> (gdb) kill
> The program is not being run.
> (gdb) file /links/build/latest/trunk/mips-elf/gdb/gdb/testsuite/gdb.base/opaque
> A program is being debugged already.
> Are you sure you want to change the file? (y or n) ERROR: couldn't load /links/build/latest/trunk/mips-elf/gdb/gdb/testsuite/gdb.base/opaque into /links/build/latest/trunk/mips-elf/gdb/gdb/testsuite/../../gdb/gdb (timed out).

The simulator is being a bit schizophrenic. It is not running, yet it
is. This happens because inferior_ptid is set to null_ptid after kill
or before execution, and the sim target is left on the stack, but
to_has_execution is always set for "target sim".

As it happens I have patches for a similar issue with target
extended-remote. The remote patches are substantial, but I can
probably break out the simulator related bits. I'll try to do that.

They change target_has_execution from "is capable of running" to
"is running right now".