This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Bug 20936 - provide sparc and sparcv9 target description XML files
- From: Ivo Raisr <ivo dot raisr at oracle dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Wed, 25 Jan 2017 17:05:10 +0100
- Subject: Re: [PATCH] Bug 20936 - provide sparc and sparcv9 target description XML files
- Authentication-results: sourceware.org; auth=none
- References: <46200a1e-29f7-8e20-c0b5-3f6f25c82d45@oracle.com> <20161206152616.GC28789@E107787-LIN> <af1a22bb-15c5-4963-8371-4eb5d22378db@oracle.com> <83d4c58d-0834-4fc2-6194-72408510aa8a@oracle.com> <20161212125331.GB25542@E107787-LIN> <082f9ac8-3e46-42cd-198d-91866d83ebb8@oracle.com> <20170105143109.GA21293@E107787-LIN> <e6065f2e-f76d-0190-dc34-d04da1a33e84@oracle.com> <9351d864-e939-cc66-97e3-1c768bf78df1@redhat.com>
On 25.1.2017 16:46, Pedro Alves wrote:
(I know I'm quite behind this thread.)
On 01/06/2017 03:12 PM, Ivo Raisr wrote:
ChangeLog entry:
2017-01-06 Ivo Raisr <ivo.raisr@oracle.com>
Split real and pseudo registers in preparation for registers provided
by a target. Registers provided by target description can have more real
registers and pseudo registers need to be positioned after them.
I don't quite understand this rationale, and I'm wondering if there's
a misunderstanding of register numbering somewhere (maybe mine!).
What exactly would go wrong if you just added the new registers
between the existing raw and pseudo registers? Other ports do
that routinely.
Good question.
The rationale is target provided registers.
Consider a typical Valgrind use case where target (gdbserver stub
implemented inside Valgrind) supplies 3 times more raw registers than
the architecture normally supports.
One set mimics the "normal" registers, the other two sets are shadow
copies used internally by Memcheck tool to keep track of
defined/undefined bits and their origins.
So when gdb'ing ordinary process, you have:
- raw registers (one set)
- pseudo registers
However when gdb'ing Valgrind'ed process over gdb remote protocol
with --vgdb-shadow-registers=yes, target provides:
- first set of raw registers (describes guest state)
- second set of raw registers (describes the first shadow copy)
- third set of raw registers (describes the second shadow copy)
- pseudo registers (actually provided by gdb)
So this means pseudo registers numbering must be flexible.
Other targets (such as s390x, aarch64, amd64) do it in similar ways.
Kind regards,
I.