This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Patch, microblaze]: Add slr and shr regs
- From: Pedro Alves <palves at redhat dot com>
- To: Ajit Kumar Agarwal <ajit dot kumar dot agarwal at xilinx dot com>, Michael Eager <eager at eagercon dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Yao Qi <yao at codesourcery dot com>
- Cc: Joel Brobecker <brobecker at adacore dot com>, Vinod Kathail <vinodk at xilinx dot com>, Vidhumouli Hunsigida <vidhum at xilinx dot com>, Nagaraju Mekala <nmekala at xilinx dot com>
- Date: Mon, 09 Jun 2014 18:57:28 +0100
- Subject: Re: [Patch, microblaze]: Add slr and shr regs
- Authentication-results: sourceware.org; auth=none
- References: <c6fe468a-5e02-430a-b34b-73de6bfd2b97 at BY2FFO11FD021 dot protection dot gbl> <537EFA08 dot 1060309 at eagercon dot com> <f0c2c22a-d3d6-45d1-92ba-660dd364fd89 at BL2FFO11FD051 dot protection dot gbl> <537FCEDA dot 9030504 at eagercon dot com> <2e5c185d-329c-46cf-930c-8cc2288891aa at BN1BFFO11FD019 dot protection dot gbl> <538431FB dot 2070904 at eagercon dot com> <865132b2-a593-4147-a7c6-cee25c1ed0fd at BN1AFFO11FD052 dot protection dot gbl> <53845299 dot 5080601 at redhat dot com> <f576a927-8250-4649-ae76-531c4a30df92 at BN1BFFO11FD026 dot protection dot gbl>
On 06/09/2014 06:26 PM, Ajit Kumar Agarwal wrote:
> The slr(stack low register) and shr(stack high registers) are implemented based
> on C_USE_STACK_PROTECTION is set 0/1. Microblaze being the reconfigurable architecture
> the design can be selected with and without these registers. Its hard to identify in gdb
> whether these registers is being implemented for the design or not. In XMD where the gdb
> client connects to the local host we always display the shr and shl registers irrespective
> of C_USE_STACK_PROTECTION is set or not. In the case where the design is not
> implemented with these register we always display the content to be 0 or ? to the user.
> gdb will also display these registers when the C_USE_STACK_PROTECTION is set 0/1.
This is exactly what target descriptions are supposed to solve. With those,
you can have the target tell GDB about any random register, and GDB will
know about it, without having to change GDB. If the register in question
are an important group that GDB needs to be aware of them (seems to be the
case here), then target descriptions have this concept of "target features"
to address it. Grep for tdesc_find_feature in the source tree for numerous
examples, and see the "Target Description" and "Standard Target Features" in
the manual.
--
Pedro Alves