This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Forbid run with a core file loaded
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 21 May 2010 08:02:31 -0700
- Subject: Re: [patch] Forbid run with a core file loaded
- References: <20100521134718.GA17157@host0.dyn.jankratochvil.net>
> (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