Re: [PATCH] Consolidate target_mourn_inferior between GDB and gdbserver

Jon Turney
2016-09-23T13:17:56Z

[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]

On 19/09/2016 05:19, Sergio Durigan Junior wrote:
> On Thursday, September 15 2016, Pedro Alves wrote:
>> On 09/12/2016 05:51 AM, Sergio Durigan Junior wrote:
>> Thanks, patch is OK.
>>
>>> I'd appreciate a special look at gdb/windows-nat.c's modification
>>> because I wasn't really sure what to do there. It seemed to me that
>>> maybe I should build a ptid out of the process information there, but
>>> then I am almost sure the assertion on GDB's side would trigger.
>>
>> Just leave it passing inferior_ptid like all other places, which is
>> a no-op. We're certain the assertion does not fail this way.
>
> Thanks, pushed.
>
> bc1e6c81d5b77d78282c47f6fd7f697e564a6eb6

This seems to miss one use of target_mourn_inferior() in windows-nat.c.

> ../../gdb/windows-nat.c: In function ‘void windows_kill_inferior(target_ops*)’:
> ../../gdb/windows-nat.c:2467:26: error: too few arguments to function ‘void target_mourn_inferior(ptid_t)’
> target_mourn_inferior (); /* Or just windows_mourn_inferior? */
> ^

Patch attached.

[-- Attachment #2: 0001-Fix-a-use-of-target_mourn_inferior-in-windows-nat.c.patch --]
[-- Type: text/plain, Size: 1461 bytes --]

From 75869cf539056bcff2351f698ccf79286d137cfb Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Fri, 23 Sep 2016 14:07:55 +0100
Subject: [PATCH] Fix a use of target_mourn_inferior in windows-nat.c

One use of target_mourn_interior seems to have been missed in bc1e6c81

gdb/ChangeLog:

2016-09-23 Jon Turney <jon.turney@dronecode.org.uk>

* windows-nat.c (windows_delete_thread): Adjusting call to
target_mourn_inferior to include ptid_t argument.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
---
gdb/ChangeLog | 5 +++++
gdb/windows-nat.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ea14f04..c7a194f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-09-23 Jon Turney <jon.turney@dronecode.org.uk>
+
+ * windows-nat.c (windows_delete_thread): Adjusting call to
+ target_mourn_inferior to include ptid_t argument.
+
2016-09-22 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>

* rs6000-tdep.c (ppc_process_record_op31): Fix
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 31a9ecb..c6a809b 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -2464,7 +2464,7 @@ windows_kill_inferior (struct target_ops *ops)
break;
}

- target_mourn_inferior (); /* Or just windows_mourn_inferior? */
+ target_mourn_inferior (inferior_ptid); /* Or just windows_mourn_inferior? */
}

static void
--
2.8.3