Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: David Smith <dsmith@redhat.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: GDB Patches <gdb-patches@sources.redhat.com>
Subject: Re: [RFC, RFA] multi-arch PREPARE_TO_PROCEED()
Date: Mon, 02 Apr 2001 07:28:00 -0000	[thread overview]
Message-ID: <3AC88BF9.1060009@redhat.com> (raw)
In-Reply-To: <3AC4E993.7B23D144@cygnus.com>

Andrew,

Thanks for taking the time to look at this patch.  See comments below.

Andrew Cagney wrote:

> David Smith wrote:
> 
> David two thoughts:
> 
> 	o	is the parameter ``select_it'' needed?

Not really, since the only call to PREPARE_TO_PROCEED (in infrun.c) always 
passes a 1.  However:

- This macro is already documented in gdbint.texinfo as taking the 
"select_it" parameter.

- If I change the call interface, the possibilities are much higher that I'll 
screw up the 4 existing implementations of PREPARE_TO_PROCEED.  Three of them 
(hppa-tdep.c, lin-lwp.c, linux-thread.c) should be easy enough to compile, 
but the last one, m3-nat.c, will not be easy.  I've searched and can't find a 
Mach3 system anywhere (and that port doesn't cross-compile).

I was trying not to affect the existing implementations.

> 
> 	o	In your opinion, is there any reason
> 		to have anything other than the
> 		generic_prepare_to_proceed()?
> 
> I'm thinking that we should dump the HP/UX and Linux implementations and
> instead, always use your code.  So ... can someone test David's change
> under linux threads?

There is no logical reason why the generic_prepare_to_proceed() couldn't 
suffice for the 4 existing ports that define PREPARE_TO_PROCEED().  However, 
the actual implementation gets a bit tricky.

None of the 4 existing implementations (hppa-tdep.c, lin-lwp.c, 
linux-thread.c, m3-nat.c) are multi-arched.  The 4 existing implementations 
also are a bit odd.  The Mach3 (m3-nat.c) and HP/UX (hppa-tdep.c) 
implementations are quite odd in the way they figure out if the threads have 
been switched.  The two linux implementations (linux-thread.c and lin-lwp.c) 
are fairly normal, with the newest Linux implementation (lin-lwp.c) being 
pretty straight-forward, except for its integration with thread-db.c.

All 4 implementations switch threads in different ways.  Here's a bad ascii 
chart of what they do (and don't do).  The list of things to do I got from 
switch_to_thread() (in thread.c).

                         hppa-tdep.c   linux-thread.c   lin-lwp.c   m3-nat.c
Switch "inferior_pid"?      X                              X
Flush cached frames?        X                              X
Flush register data?        X                              X
Update "stop_pc"?
Select a new frame?

linux-thread.c just sets an internal variable (linuxthreads_step_pid) and 
then does some magic with that variable in linuxthreads_resume().  m3-nat.c 
calls a Mach3 specific switch_to_thread() function, which doesn't change 
inferior_pid at all (?).

> 
> Anyway, I'm ok with the multi-arch part (both with and without the
> ``select_it'' parameter) and the change to infrun.c.
> 
> With respect to the possibility of dumping the HP/UX and linux
> implementations - MichaelS or MarkK?
> 
> 	Andrew
> 

I think I've read that the HP/UX port compiles, but can't actually debug 
programs, so testing that change would be quite difficult...

-- 
David Smith
dsmith@redhat.com
Red Hat, Inc.
http://www.redhat.com
256.704.9222 (direct)
256.837.3839 (fax)


  reply	other threads:[~2001-04-02  7:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-29 18:25 David Smith
2001-03-30 12:16 ` Andrew Cagney
2001-04-02  7:28   ` David Smith [this message]
2001-04-04 14:54     ` Andrew Cagney
2001-04-06 10:55       ` David Smith

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=3AC88BF9.1060009@redhat.com \
    --to=dsmith@redhat.com \
    --cc=ac131313@cygnus.com \
    --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