Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH/gdbserver] Remove current_inferior's save/restore when call get_thread_regcache.
Date: Fri, 04 May 2012 13:45:00 -0000	[thread overview]
Message-ID: <4FA3DD56.8040303@redhat.com> (raw)
In-Reply-To: <4FA3D4B6.2040502@codesourcery.com>

On 05/04/2012 02:08 PM, Yao Qi wrote:

> So any code needs inferior should be wrapped in the follow manner?

Almost.  The exception is code that takes an explicit thread argument
(current_inferior is a thread pointer).  So when you call:

void foo (struct thread_info *thread)

you don't have to care to swap the current_inferior global.  `foo' will do
it internally if necessary.

-- 
Pedro Alves


      reply	other threads:[~2012-05-04 13:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-04 10:52 Yao Qi
2012-05-04 12:32 ` Pedro Alves
2012-05-04 13:08   ` Yao Qi
2012-05-04 13:45     ` Pedro Alves [this message]

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=4FA3DD56.8040303@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@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