From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13616 invoked by alias); 20 Jul 2009 14:53:47 -0000 Received: (qmail 13606 invoked by uid 22791); 20 Jul 2009 14:53:47 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Jul 2009 14:53:37 +0000 Received: from tschwinge by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MSuFC-0006KM-La; Mon, 20 Jul 2009 10:53:34 -0400 Date: Mon, 20 Jul 2009 15:08:00 -0000 From: Thomas Schwinge To: Pedro Alves Cc: gdb-patches@sourceware.org, bug-hurd@gnu.org Subject: Re: Restore GNU/Hurd functionality Message-ID: <20090720145334.GB5192@fencepost.gnu.org> References: <200902160549.49108.pedro@codesourcery.com> <200902241438.58802.pedro@codesourcery.com> <20090720095521.GA5192@fencepost.gnu.org> <200907201122.34853.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bCsyhTFzCvuiizWE" Content-Disposition: inline In-Reply-To: <200907201122.34853.pedro@codesourcery.com> User-Agent: Mutt/1.5.11 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00484.txt.bz2 --bCsyhTFzCvuiizWE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2742 Hello! On Mon, Jul 20, 2009 at 11:22:34AM +0100, Pedro Alves wrote: > I've had the patch below here for months already (I think I wrote it > around the the time of the solaris changes), but, > since I had borked by GNU/Hurd setup and hadn't found the energy > yet to restore it, I completelly forgot about it. :-( Well, thanks to you for helping with maintining GDB's Hurd port! If you need help with a new Hurd image, or want shell access to a system (), please just speak up. (Likewise everyone else who is interested, of course!) > It does some house cleaning on the gnu target (by making it inherit from > the inf-child target), and ends up up making those functions static > (while at the same time, getting the port a bit more into shape for > a future !x86 Hurd port). >=20 > What do you think about it? Could you try it if you like it? I did review it and did some testing in the areas that could most likely be touched by it and found no problems. I only had to do three very minor corrections: > Index: src/gdb/gnu-nat.c > @@ -2082,6 +2080,7 @@ gnu_create_inferior (struct target_ops * > int from_tty) > { > struct inf *inf =3D cur_inf (); > + int pid; >=20=20 > void trace_me () > { > @@ -2090,34 +2089,31 @@ gnu_create_inferior (struct target_ops * > if (ptrace (PTRACE_TRACEME) !=3D 0) > error (_("ptrace (PTRACE_TRACEME) failed!")); > } > - void attach_to_child (int pid) > - { > - /* Attach to the now stopped child, which is actually a shell... */ > - inf_debug (inf, "attaching to child: %d", pid); >=20=20 > - inf_attach (inf, pid); > + inf_debug (inf, "creating inferior"); >=20=20 > - push_target (&gnu_ops); > + pid =3D fork_inferior (exec_file, allargs, env, trace_me, NULL, NULL, = NULL); > [...] Whether it is better to do it the old way ( have a nested function attach_to_child that will be passed to and called from within fork_inferior), or do it like your patch does (inline the former attach_to_child to be executed after fork_inferior has returned) -- I have no idea, so I'll leave that to you. > +/* Create a prototype generic GNU/Hurd target. The client can > + override it with local methods. */ > + > +struct target_ops * > +gnu_target (void) > +{ > + struct target_ops *t =3D inf_child_target (); That one needs ``#include "inf-child.h"''. > + t->to_can_run =3D gnu_can_run; This statement should be removed: the default value (as set by inf_child_target) is alright and you removed gnu_can_run just above. > + t->to_thread_alive =3D gnu_thread_alive; > + t->to_pid_to_str =3D gnu_pid_to_str; > + t->to_stop =3D gnu_stop; > +} ``return t;'' is missing. Regards, Thomas --bCsyhTFzCvuiizWE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline Content-length: 191 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFKZITusmqaiQAHQR4RAm9aAJ9ArP+ujgQ+q/qse4lY+HNYd1mHQQCfaEQy UwJQ7KSrGU9MovIIoS+pjdY= =e0uD -----END PGP SIGNATURE----- --bCsyhTFzCvuiizWE--