From: Kevin Buettner <kevinb@cygnus.com>
To: Joel Brobecker <brobecker@act-europe.fr>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] Fix compilation failure in hpux-thread.c under HPUX 11.00
Date: Thu, 27 Sep 2001 10:05:00 -0000 [thread overview]
Message-ID: <1010927170437.ZM4452@ocotillo.lan> (raw)
In-Reply-To: <20010927155347.F21075@act-europe.fr>
On Sep 27, 3:53pm, Joel Brobecker wrote:
> The GDB build on HPUX-11.00 failed in two places on hpux-thread.c. In
> both cases, this is because we tried to assign a pid (a number) inside
> a variable of type ptid_t (a struct). This pid needs to be converted
> to a ptid_t first, using pid_to_ptid ().
>
> The following patch fixes that, although I haven't had time to test it
> at all. I just verified that it compiles. I'm sorry I can't go further
> with this, but I'm really time-short at the moment (preparing a trip to
> a customer's site next week). It seems obvious enough to be suggested as
> is, but if somebody else could try it out for me, that would be
> excellent.
>
>
> 2001-09-27 J. Brobecker <brobecker@gnat.com>
>
> * hpux-thread.c: fix two compilations errors caused by an attempt to
> assign a pid (a number) into a variable of type ptid_t (a struct).
> Convert the pids into ptid_t using pid_to_ptid () first.
Joel,
Thanks for looking into this. Looking at your patch, my first
impulse was to declare your changes as obvious and tell you to
commit it.
But now that I've taken a closer look at find_active_thread(), I
see the following:
static int
find_active_thread (void)
{
...
return (cma_thread_get_unique (&tcb.prolog.client_thread) << 16)
| PIDGET (main_ptid);
}
It appears to me that this code is still utilizing the old technique
of overloading a thread and a pid into the same 32-bit identifier.
So, find_active_thread() should probably be rewritten as follows:
static ptid_t
find_active_thread (void)
{
...
return (ptid_build (PIDGET (main_ptid), 0,
cma_thread_get_unique (&tcb.prolog.client_thread)));
}
My guess is that making the above change will allow hpux-thread.c to
compile, but that it won't really work right (or even at all) until
find_tcb() is rewritten. I think that find_tcb should take a ptid_t
instead of an int as its thread argument. It needs to fetch the thread
by invoking ptid_get_tid() instead of right shifting by 16.
Once this is done, hpux_pid_to_str() also needs to be revised to
call ptid_get_tid() instead of shifting the pid result right by 16.
Kevin
next prev parent reply other threads:[~2001-09-27 10:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-27 6:53 Joel Brobecker
2001-09-27 10:05 ` Kevin Buettner [this message]
2001-09-28 14:31 ` Joel Brobecker
2001-10-01 11:40 ` Kevin Buettner
2001-10-01 12:12 ` Andrew Cagney
2001-10-08 13:50 ` Joel Brobecker
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=1010927170437.ZM4452@ocotillo.lan \
--to=kevinb@cygnus.com \
--cc=brobecker@act-europe.fr \
--cc=gdb-patches@sources.redhat.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