From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>, Pedro Alves <palves@redhat.com>
Cc: Jon Burgess <jburgess777@gmail.com>, gdb-patches@sourceware.org
Subject: Re: [RFC][PATCH] arm-tdep.c (arm_m_exception_cache): Handle stack switching to PSP during exception unwind.
Date: Tue, 23 Sep 2014 12:45:00 -0000 [thread overview]
Message-ID: <54216B60.3050409@redhat.com> (raw)
In-Reply-To: <87wq8uwmp1.fsf@codesourcery.com>
On 09/23/2014 01:22 PM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
>> Let's start by fixing this properly, please. If GDB needs to know
>> about these registers, then they should be part of a known feature
>> in the target description. According to B1.4 in the same document,
>> we see:
>>
>> "The ARMv7-M profile has the following registers closely coupled to the core:
>>
>> - general purpose registers R0-R12
>> - 2 Stack Pointer registers, SP_main and SP_process (banked versions of R13)
>> - the Link Register, LR (R14)
>> - the Program Counter, PC
>> - status registers for flags, exception/interrupt level, and execution state bits
>> - mask registers associated with managing the prioritization scheme
>> for exceptions and interrupts
>> - a control register (CONTROL) to identify the current stack and
>> thread mode privilege level.
>> "
>>
>> Seems like even more core things other than SP_main/SP_process are
>> missing from org.gnu.gdb.arm.m-profile, when debugging at this level.
>>
>
> If we add more registers to feature org.gnu.gdb.arm.m-profile, xml files
> provided by gdb stubs (such as openocd) have to be updated too,
> otherwise GDB will reject the target description, right? Does this
> cause any compatibility issue? new gdb rejects the target description
> from old openocd.
Right, just making GDB expect more registers in the existing feature
would be a problem for compatibility. So we don't add new registers to
existing features. Instead we either:
- create a replacement feature for "org.gnu.gdb.arm.m-profile" with
the full set of core registers.
- or create a separate feature for the missing registers, and have
the reported target description include both
the "org.gnu.gdb.arm.m-profile" feature and the new feature.
I'm guessing org.gnu.gdb.arm.m-profile doesn't include those
exception/interrupt related registers as these aren't available to
userspace programs (*) ? Do non-M-profile ARMs have them too?
(*) BTW, if so, what does ARM call the mode that allows access
to these registers? "kernel mode", or something else?
Thanks,
Pedro Alves
next prev parent reply other threads:[~2014-09-23 12:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-20 22:47 Jon Burgess
2014-09-22 18:16 ` Sergio Durigan Junior
2014-09-23 5:30 ` Yao Qi
2014-09-23 8:38 ` Pedro Alves
2014-09-23 12:27 ` Yao Qi
2014-09-23 12:45 ` Pedro Alves [this message]
2015-05-07 18:00 ` Simon Schubert
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=54216B60.3050409@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=jburgess777@gmail.com \
--cc=yao@codesourcery.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