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 2/2] S390: Fix gdbserver support for TDB


On Thu, Dec 04 2014, Pedro Alves wrote:

> On 12/03/2014 06:18 PM, Andreas Arnez wrote:
>> [...]
>> 
>> For illustration, why don't we do something like the (untested) patch
>> below?
>> 
>> --
>> diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c
>> index 718ae8c..b0f6a22 100644
>> --- a/gdb/gdbserver/regcache.c
>> +++ b/gdb/gdbserver/regcache.c
>> @@ -52,6 +52,8 @@ get_thread_regcache (struct thread_info *thread, int fetch)
>>        struct thread_info *saved_thread = current_thread;
>>  
>>        current_thread = thread;
>> +      memset (regcache->register_status, REG_UNAVAILABLE,
>> +	      regcache->tdesc->num_registers);
>
> This makes sense to me, it's similar to gdb's own handling.
> See gdb/regcache.c:regcache_raw_read (and regcache_invalidate).
>
> Can you check the patch on x86 too, please?  You'll need the
> same #ifdef guard as init_register_cache uses; s390
> doesn't build the IPA.
>
>>        fetch_inferior_registers (regcache, -1);
>>        current_thread = saved_thread;
>>        regcache->registers_valid = 1;

OK, did that, and it seems to work for me with the #ifdef guard added.
See the updated patch set:

  https://sourceware.org/ml/gdb-patches/2014-12/msg00193.html

--
Andreas


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