This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] S390: Fix gdbserver support for TDB
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Ulrich Weigand <uweigand at de dot ibm dot com>
- Date: Tue, 09 Dec 2014 17:09:59 +0100
- Subject: Re: [PATCH 2/2] S390: Fix gdbserver support for TDB
- Authentication-results: sourceware.org; auth=none
- References: <1417002962-3424-1-git-send-email-arnez at linux dot vnet dot ibm dot com> <1417002962-3424-3-git-send-email-arnez at linux dot vnet dot ibm dot com> <87iohvp77u dot fsf at br87z6lw dot de dot ibm dot com> <547DD8C2 dot 9000403 at redhat dot com> <8761dtq2rx dot fsf at br87z6lw dot de dot ibm dot com> <871togppgg dot fsf at br87z6lw dot de dot ibm dot com> <54806247 dot 8050000 at redhat dot com>
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