This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH/gdbserver] Remove current_inferior's save/restore when call get_thread_regcache.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]