From: will schmidt via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: rogerio <rogealve@br.ibm.com>,
Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Subject: RFC gdbserver and tdesc and powerpc (stuck on a gdbserver assert)
Date: Tue, 01 Feb 2022 15:48:07 -0600 [thread overview]
Message-ID: <0f8ec5130c4f798083a52129138241e130f1ee7e.camel@vnet.ibm.com> (raw)
Hi,
I've been working on a target-description rework for powerpc, this is
a continuation of work that Rogerio has posted rfc patches for sometime last year.
I've run into a stumbling block with the init_target_desc code in gdbserver,
and am not sure how to best proceed.
gdbserver/tdesc.cc: init_target_desc(...) iterates through the provided
features and populates the reg_defs structure. The code currently has an assert
with a comment:
/* Register number will increase (possibly with gaps) or be zero. */
gdb_assert (regnum == 0 || regnum >= tdesc->reg_defs.size ());
This trips on powerpc (with the WIP tdesc patch set), potentially in several
locations, since our features contain registers that are intermixed across the
ranges, so we end up with regnos that numerically belong earlier in the
tdesc->reg_defs structure, but they belong in the features where they are.
In particular;
The Powerpc "core" features includes regnums 0-31 (gprs r0..r31),
a gap, then 64-69 (PC,MSR,CR,LR,CTR,XER).
The subsequent "fpu" feature fills in that gap as it includes regnums
32-63 (f0..f31), and 70 (fpscr).
There may or may not be an issue with the subsequent altivec and vsx register sets,
since we have some overlapping ranges there.
I could split apart the features into smaller bits, but this would scramble the
documented powerpc features descriptions (as seen in gdb.texinfo).
I've tried just disabling the assert, but I'm not certain that is sufficient, I currently
also see some partial transfer errors between gdb and gdbserver that i've not sorted out.
Appreciate any thoughts on how I should proceed.
Thanks
-Will
next reply other threads:[~2022-02-01 21:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-01 21:48 will schmidt via Gdb-patches [this message]
2022-02-02 1:27 ` Simon Marchi via Gdb-patches
2022-02-02 1:53 ` will schmidt via Gdb-patches
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=0f8ec5130c4f798083a52129138241e130f1ee7e.camel@vnet.ibm.com \
--to=gdb-patches@sourceware.org \
--cc=Ulrich.Weigand@de.ibm.com \
--cc=rogealve@br.ibm.com \
--cc=will_schmidt@vnet.ibm.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