diff mbox

Use thread_info and inferior pointers more throughout

Message ID 87lg2iidbf.fsf@euler.schwinge.homeip.net
State New
Headers show

Commit Message

Thomas Schwinge Feb. 14, 2019, 3:45 p.m. UTC
Hi!

On Thu, 21 Jun 2018 17:20:54 +0100, Pedro Alves <palves@redhat.com> wrote:
> >From 00431a78b28f913a9d5c912c49680e39cfd20847 Mon Sep 17 00:00:00 2001
> From: Pedro Alves <palves@redhat.com>
> Date: Thu, 21 Jun 2018 17:09:31 +0100
> Subject: [PATCH] Use thread_info and inferior pointers more throughout

> -void
> -detach_inferior (int pid)
> -{
> -  detach_inferior (find_inferior_pid (pid));
> -}

Pushed to master the attached commit
c29ee8d45ec2113821c006a18cfedb9023ef9ce1 '[gdb, hurd] Repair build after
"Use thread_info and inferior pointers more throughout"'.


Grüße
 Thomas
diff mbox

Patch

From c29ee8d45ec2113821c006a18cfedb9023ef9ce1 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Tue, 24 Jul 2018 18:04:18 +0200
Subject: [PATCH] [gdb, hurd] Repair build after "Use thread_info and inferior
 pointers more throughout"

..., that is commit 00431a78b28f913a9d5c912c49680e39cfd20847 causing:

    [...]/gdb/gnu-nat.c: In member function 'virtual void gnu_nat_target::detach(inferior*, int)':
    [...]/gdb/gnu-nat.c:2284:23: error: invalid conversion from 'int' to 'inferior*' [-fpermissive]
       detach_inferior (pid);
                           ^
    In file included from [...]/gdb/gnu-nat.c:61:0:
    [...]/gdb/inferior.h:523:13: note:   initializing argument 1 of 'void detach_inferior(inferior*)'
     extern void detach_inferior (inferior *inf);
                 ^~~~~~~~~~~~~~~

Fixed by inlining the removed code.

	gdb/
	* gnu-nat.c (gnu_nat_target::detach): Instead of
	'detach_inferior (pid)' call
	'detach_inferior (find_inferior_pid (pid))'.
---
 gdb/ChangeLog | 4 ++++
 gdb/gnu-nat.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2974d7275c..71c61bc909 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@ 
 2019-02-14  Thomas Schwinge  <thomas@codesourcery.com>
 
+	* gnu-nat.c (gnu_nat_target::detach): Instead of
+	'detach_inferior (pid)' call
+	'detach_inferior (find_inferior_pid (pid))'.
+
 	* configure.nat [gdb_host == i386gnu] (NATDEPFILES): Add
 	'nat/fork-inferior.o'.
 	* gnu-nat.c: #include "nat/fork-inferior.h".
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 5a47cb7d63..67cc95c68d 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -2279,7 +2279,7 @@  gnu_nat_target::detach (inferior *inf, int from_tty)
   inf_detach (gnu_current_inf);
 
   inferior_ptid = null_ptid;
-  detach_inferior (pid);
+  detach_inferior (find_inferior_pid (pid));
 
   maybe_unpush_target ();
 }
-- 
2.19.2