public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Alan Hayward <Alan.Hayward@arm.com>
To: Simon Marchi <simark@simark.ca>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	nd <nd@arm.com>
Subject: Re: [PATCH v2 10/10] Remove reg2 section from Aarch64 SVE cores
Date: Mon, 11 Jun 2018 16:37:00 -0000	[thread overview]
Message-ID: <0E69B756-49D8-4802-8EBC-FCB27859F981@arm.com> (raw)
In-Reply-To: <ff6851b6-1fa4-c2ed-d01d-27f7bd68ba02@simark.ca>



> On 11 Jun 2018, at 03:47, Simon Marchi <simark@simark.ca> wrote:
> 
> On 2018-06-06 11:16 AM, Alan Hayward wrote:
>> reg2 sections in SVE binaries will cause gdb to segfault on loading
>> due to miscalculating the register size.
>> 
>> For now, simply remove reg2 from SVE core files. This results in
>> core files without any vector/float register. Full core support
>> for SVE will come in a later set of patches.
>> 
>> 2018-06-06  Alan Hayward  <alan.hayward@arm.com>
>> 
>> gdb/
>> 	* aarch64-linux-tdep.c
>> 	(aarch64_linux_iterate_over_regset_sections): Check for SVE.
>> ---
>> gdb/aarch64-linux-tdep.c | 7 +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>> 
>> diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
>> index 96dc8a1132..b05bb49ae8 100644
>> --- a/gdb/aarch64-linux-tdep.c
>> +++ b/gdb/aarch64-linux-tdep.c
>> @@ -227,10 +227,13 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
>> 					    void *cb_data,
>> 					    const struct regcache *regcache)
>> {
>> +  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
>> +
>>   cb (".reg", AARCH64_LINUX_SIZEOF_GREGSET, &aarch64_linux_gregset,
>>       NULL, cb_data);
>> -  cb (".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, &aarch64_linux_fpregset,
>> -      NULL, cb_data);
>> +  if (!tdep->has_sve ())
>> +    cb (".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, &aarch64_linux_fpregset,
>> +	NULL, cb_data);
>> }
>> 
>> /* Implement the "core_read_description" gdbarch method.  SVE not yet
>> 
> 
> IIUC, this doesn't remove existing features?  If a program was using the neon
> registers, they will still be available?
> 
> If so, this LGTM.
> 

With this patch, on SVE systems, gdb will create cores without any sve OR neon
registers. Whilst not ideal that’s better than gdb segfaulting.

...However, this got me thinking.

SVE core files produced by the kernel will have both FP and SVE sections, even
though the FP section is essentially redundant. So, gdb does need to support
that.

I'm working my way through fixing that. It’ll mostly be a change to regcache
to handle mismatched register sizes to core file slot sizes. I’ll drop this patch
for now, and will hopefully have a new patch posted Tuesday.


Alan.

  reply	other threads:[~2018-06-11 16:37 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06 15:16 [PATCH v2 00/10] gdb/gdbserver support for aarch64 SVE Alan Hayward
2018-06-06 15:17 ` [PATCH v2 08/10] Enable Aarch64 SVE for gdbserver Alan Hayward
2018-06-11  0:49   ` Simon Marchi
2018-06-06 15:17 ` [PATCH v2 10/10] Remove reg2 section from Aarch64 SVE cores Alan Hayward
2018-06-11  2:47   ` Simon Marchi
2018-06-11 16:37     ` Alan Hayward [this message]
2018-06-06 15:17 ` [PATCH v2 05/10] Ptrace support for Aarch64 SVE Alan Hayward
2018-06-10 22:52   ` Simon Marchi
2018-06-06 15:17 ` [PATCH v2 06/10] Add Aarch64 SVE dwarf regnums Alan Hayward
2018-06-11  0:43   ` Simon Marchi
2018-06-06 15:17 ` [PATCH v2 09/10] Ptrace support for AArch64 SVE gdbsever Alan Hayward
2018-06-11  2:43   ` Simon Marchi
2018-06-11  2:44   ` Simon Marchi
2018-06-06 15:17 ` [PATCH v2 02/10] Add Aarch64 SVE Linux headers Alan Hayward
2018-06-08 14:13   ` Alan Hayward
2018-06-08 14:37     ` Simon Marchi
2018-06-08 15:23       ` Simon Marchi
2018-06-12 14:37         ` Alan Hayward
2018-06-12 14:43           ` Pedro Alves
2018-06-12 15:06             ` Simon Marchi
2018-06-12 15:11               ` Pedro Alves
2018-06-12 15:21                 ` Simon Marchi
2018-06-12 15:09             ` Alan Hayward
2018-06-12 14:51           ` Simon Marchi
2018-06-12 16:34             ` Sergio Durigan Junior
2018-06-12 17:51               ` Alan Hayward
2018-06-12 20:29                 ` Sergio Durigan Junior
2018-06-15  9:45                   ` Ramana Radhakrishnan
2018-06-15 17:14                     ` Alan Hayward
2018-09-20 21:16                       ` Status of the AArch* builders (was: Re: [PATCH v2 02/10] Add Aarch64 SVE Linux headers) Sergio Durigan Junior
2018-09-24 14:16                         ` Alan Hayward
2018-09-24 14:42                           ` Status of the AArch* builders Sergio Durigan Junior
2018-10-11  9:23                             ` Alan Hayward
2018-10-12 19:06                               ` Sergio Durigan Junior
2018-10-15 10:16                                 ` Alan Hayward
2018-10-15 12:42                                   ` Sergio Durigan Junior
2018-10-15 14:02                                     ` Alan Hayward
2018-10-15 15:32                                       ` Sergio Durigan Junior
2018-10-17 18:46                                         ` Sergio Durigan Junior
2018-10-24  9:56                                           ` Alan Hayward
2018-10-25 16:26                                             ` Sergio Durigan Junior
2018-06-08 15:27       ` [PATCH v2 02/10] Add Aarch64 SVE Linux headers Alan Hayward
2018-06-06 15:17 ` [PATCH v2 01/10] Aarch64 SVE pseudo register support Alan Hayward
2018-06-06 22:17   ` Simon Marchi
2018-06-07  9:34     ` Alan Hayward
2018-06-06 15:17 ` [PATCH v2 07/10] Increase gdbsever PBUFSIZ Alan Hayward
2018-06-11  0:46   ` Simon Marchi
2018-06-06 15:17 ` [PATCH v2 03/10] Add reg_buffer_common Alan Hayward
2018-06-07 20:19   ` Simon Marchi
2018-06-07 20:42     ` Simon Marchi
2018-06-08 14:14     ` Alan Hayward
2018-06-10 22:21       ` Simon Marchi
2018-06-06 15:17 ` [PATCH v2 04/10] Add regcache raw_compare method Alan Hayward
2018-06-07 20:56   ` Simon Marchi
2018-06-08 15:16     ` Alan Hayward
2018-06-10 22:26       ` Simon Marchi

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=0E69B756-49D8-4802-8EBC-FCB27859F981@arm.com \
    --to=alan.hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.com \
    --cc=simark@simark.ca \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).