Re: [patch] Forbid run with a core file loaded

Joel Brobecker
2010-05-21T15:02:45Z

> (gdb) start
> Starting program: /bin/sleep
> ^^^^^^^^^^^^^^^^ !!!
> [...]

Hah! I was convinced we would ask confirmation to the user in this case...
I agree we should.

> 2010-05-21 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> Forbid run with a core file loaded.
> * infcmd.c (run_command_1) <core_bfd>: New.

This looks fine to me (but let's wait for Mark to confirm that there
was a misunderstanding - I'll followup separately).

> gdb/testsuite/
> 2010-05-21 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> Forbid run with a core file loaded.
> * gdb.base/corefile.exp (load core again, start with core)
> (started with core): New tests.

> +set test "start with core"
> +gdb_test_multiple "start" $test {
> + -re {Core file is already loaded. Unload it[?] [(]y or n[)] } {
> + pass $test
> + }
> +}

We should not use the "start" command in testcases, as it does not
work with remote targets. I'm afraid we're going to have to rely on
the run command instead.

--
Joel