From: Thomas Schwinge <tschwinge@gnu.org>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, bug-hurd@gnu.org
Subject: Re: Restore GNU/Hurd functionality
Date: Mon, 20 Jul 2009 15:08:00 -0000 [thread overview]
Message-ID: <20090720145334.GB5192@fencepost.gnu.org> (raw)
In-Reply-To: <200907201122.34853.pedro@codesourcery.com>
[-- Attachment #1: Type: text/plain, Size: 2791 bytes --]
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
(<http://www.gnu.org/software/hurd/public_hurd_boxen.html>), 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).
>
> 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 = cur_inf ();
> + int pid;
>
> void trace_me ()
> {
> @@ -2090,34 +2089,31 @@ gnu_create_inferior (struct target_ops *
> if (ptrace (PTRACE_TRACEME) != 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);
>
> - inf_attach (inf, pid);
> + inf_debug (inf, "creating inferior");
>
> - push_target (&gnu_ops);
> + pid = 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 = inf_child_target ();
That one needs ``#include "inf-child.h"''.
> + t->to_can_run = 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 = gnu_thread_alive;
> + t->to_pid_to_str = gnu_pid_to_str;
> + t->to_stop = gnu_stop;
> +}
``return t;'' is missing.
Regards,
Thomas
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
next prev parent reply other threads:[~2009-07-20 14:53 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-16 8:57 Modernize solaris threads support Pedro Alves
2009-02-16 19:35 ` Eli Zaretskii
2009-02-16 20:45 ` Pedro Alves
2009-02-16 20:50 ` Eli Zaretskii
2009-02-17 0:07 ` Pedro Alves
2009-02-17 4:12 ` Eli Zaretskii
2009-02-17 13:30 ` Pedro Alves
2009-02-17 19:20 ` Eli Zaretskii
2009-02-17 20:01 ` Pedro Alves
2009-02-17 20:28 ` Tom Tromey
2009-02-17 20:50 ` Eli Zaretskii
2009-02-17 21:12 ` Tom Tromey
2009-02-18 2:06 ` Stan Shebs
2009-02-18 10:13 ` Eli Zaretskii
2009-02-18 14:47 ` Mark Kettenis
2009-02-18 19:50 ` Eli Zaretskii
2009-02-23 0:49 ` Pedro Alves
2009-02-23 1:22 ` Pedro Alves
2009-02-23 20:09 ` Pedro Alves
2009-02-24 14:48 ` Pierre Muller
2009-02-24 14:52 ` Pedro Alves
2009-02-24 15:04 ` Pierre Muller
2009-02-24 15:31 ` Pedro Alves
2009-02-24 15:58 ` [Commit] obvious: fix compilation failure for windows-nat.c Pierre Muller
2009-07-20 12:07 ` Restore GNU/Hurd functionality (was: Modernize solaris threads support.) Thomas Schwinge
2009-07-20 13:02 ` Pedro Alves
2009-07-20 15:08 ` Thomas Schwinge [this message]
2009-07-20 17:33 ` Restore GNU/Hurd functionality Pedro Alves
2009-02-26 19:45 ` Modernize solaris threads support David Daney
2009-02-27 18:22 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090720145334.GB5192@fencepost.gnu.org \
--to=tschwinge@gnu.org \
--cc=bug-hurd@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox