Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
To: Yao Qi <yao@codesourcery.com>
Cc: <gdb-patches@sourceware.org>, Mark Kettenis <mark.kettenis@xs4all.nl>
Subject: Re: [PATCH 00/12] Regset rework preparations part 2
Date: Wed, 28 May 2014 17:36:00 -0000	[thread overview]
Message-ID: <87k3956c0q.fsf@br87z6lw.de.ibm.com> (raw)
In-Reply-To: <5383FE52.7040404@codesourcery.com> (Yao Qi's message of "Tue, 27	May 2014 10:54:10 +0800")

On Tue, May 27 2014, Yao Qi wrote:

> On 05/27/2014 12:36 AM, Andreas Arnez wrote:
>> This part adds a collect_regset method to all Linux regsets where it
>> had been missing.  This is necessary, but not sufficient, to make the
>> "gcore" command multi-arch capable for the affected targets.  When
>> this part is approved, I can provide a follow-on patch set that fills
>> the remaining gaps to multi-arch capable core file handling for all
>> Linux targets.
>
> Your multi-arch core file handling patches can justify the changes in
> this series.  You don't have to post them, but descriptions on how
> multi-arch core file handling needs such regset interface are useful.

OK, let's try.  The following description applies to GNU/Linux targets:

1. What's needed for multi-arch capable "gcore" functionality?

With the current implementation (see linux_make_corefile_notes_1()), the
gdbarch field 'core_regset_sections' must be set; it specifies the names
and sizes of the corefile register note sections to be written.  In
addition, the gdbarch method 'regset_from_core_section' must assign a
regset structure to each of the 'core_regset_sections'.  And all the
returned regsets must contain platform-independent 'collect_regset'
methods.

  1a. What if a target does not fulfil these requirements?

  If 'core_regset_sections' is missing, the current implementation falls
  back to the (deprecated) target method 'make_corefile_notes',
  implemented for generic GNU/Linux targets by
  linux_nat_make_corefile_notes().  This invokes the native-dependent
  fill_gregset() and fill_fpregset() global functions, or (if available)
  uses the 'collect_regset' methods for each of the regsets associated
  with ".reg" and ".reg2".  In the latter case the sizes of the register
  note sections are derived from the type definitions 'gregset_t' and
  'fpregset_t' in the native-dependent system header files.

2. What's needed for multi-arch capable core file reading?

As above, the gdbarch method 'regset_from_core_section' must be set.
The 'core_regset_sections' list is optional, and if not set, is assumed
to consist of ".reg" and ".reg2".  The register note sizes are retrieved
from the core file.  Each of the regsets returned by
'regset_from_core_section' must have a platform-independent
'supply_regset' method.

  2a. What if a target does not fulfil these requirements?

  If 'regset_from_core_section' is missing, the current code falls back
  to the 'core_read_registers' method from the core_fns object that has
  been registered by deprecated_add_core_fns().  This
  'core_read_register' method then calls one of the native-dependent
  global functions supply_gregset() or supply_fpregset(), as
  appropriate.

(4) What does the series at hand provide, and how about the follow-on
    series?

This series defines 'collect_regset' methods and, where missing, also
the 'supply_regset' methods and 'regset_from_core_section'.  Since it
does not set 'core_regset_sections', "gcore" still falls back to the
native-dependent approach, but should at least use the new
'collect_regset' methods.  Core file *reading* should be made multi-arch
capable with this series already.

My follow-on series merges 'core_regset_sections' with
'regset_from_core_section' and defines the merged method for all
GNU/Linux targets.


      reply	other threads:[~2014-05-28 17:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-26 16:37 Andreas Arnez
2014-05-26 16:37 ` [PATCH 12/12] IA64 Linux: Define regset structures Andreas Arnez
2014-05-26 16:37 ` [PATCH 04/12] ALPHA Linux: Fill 'collect_regset' in " Andreas Arnez
2014-05-26 16:37 ` [PATCH 06/12] HPPA " Andreas Arnez
2014-05-26 16:37 ` [PATCH 09/12] SCORE: Fill 'collect_regset' in regset structure Andreas Arnez
2014-05-26 16:37 ` [PATCH 10/12] TILEGX Linux: " Andreas Arnez
2014-05-26 16:37 ` [PATCH 01/12] regcache: Add functions suitable for regset_supply/collect Andreas Arnez
2014-05-27  2:49   ` Yao Qi
2014-05-27 11:54     ` Andreas Arnez
2014-05-27 12:22       ` Yao Qi
2014-05-27 14:21         ` Andreas Arnez
2014-05-26 16:37 ` [PATCH 02/12] S390: Migrate to regcache_supply/collect_regset Andreas Arnez
2014-05-26 16:37 ` [PATCH 07/12] M32R Linux: Fill 'collect_regset' in regset structure Andreas Arnez
2014-05-26 16:37 ` [PATCH 03/12] AARCH64 Linux: Fill 'collect_regset' in regset structures Andreas Arnez
2014-05-27 21:36   ` Yufeng Zhang
2014-05-26 16:37 ` [PATCH 08/12] NIOS2 Linux: Fill 'collect_regset' in regset structure Andreas Arnez
2014-05-27  2:15   ` Yao Qi
2014-06-02  9:09     ` Andreas Arnez
2014-05-26 16:37 ` [PATCH 05/12] FRV Linux: Fill 'collect_regset' in regset structures Andreas Arnez
2014-05-26 16:37 ` [PATCH 11/12] M68K Linux: Define " Andreas Arnez
2014-05-27  1:37   ` Yao Qi
2014-05-27  8:51     ` Andreas Arnez
2014-05-27 12:48       ` Yao Qi
2014-05-27  2:56 ` [PATCH 00/12] Regset rework preparations part 2 Yao Qi
2014-05-28 17:36   ` Andreas Arnez [this message]

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=87k3956c0q.fsf@br87z6lw.de.ibm.com \
    --to=arnez@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    --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