This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix invoking "[kill|detach] inferiors" on inferiors that are not running
- From: Patrick Palka <patrick at parcs dot ath dot cx>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Cc: Patrick Palka <patrick at parcs dot ath dot cx>
- Date: Thu, 13 Aug 2015 10:59:45 -0400
- Subject: Re: [PATCH] Fix invoking "[kill|detach] inferiors" on inferiors that are not running
- Authentication-results: sourceware.org; auth=none
- References: <1438270143-23621-1-git-send-email-patrick at parcs dot ath dot cx>
On Thu, Jul 30, 2015 at 11:29 AM, Patrick Palka <patrick@parcs.ath.cx> wrote:
> Invoking either of the above commands on an inferior that's not running
> triggers the following assert failure:
>
> .../binutils-gdb/gdb/thread.c:514: internal-error: any_thread_of_process: Assertion `pid != 0' failed.
>
> The fix is straightforward. This patch adds a test to check the basic
> functionality of these commands, along with testing this fix in
> particular. Tested on x86_64 Linux.
>
> gdb/ChangeLog:
>
> * inferior.c (detach_inferior_command): Don't call
> any_thread_of_process when pid is 0.
> (kill_inferior_command): Likewise.
>
> gdb/testsuite/ChangeLog:
>
> * gdb.base/kill-detach-inferiors-cmd.exp: New test file.
> * gdb.base/kill-detach-inferiors-cmd.c: New test file.
Ping.