[2/7] Fixes for aarch64-linux core file support

Message ID 1409233743-26944-1-git-send-email-omair.javaid@linaro.org
State New
Headers show

Commit Message

Omair Javaid Aug. 28, 2014, 1:49 p.m.
Updated after regset rework pushed upstream.

gdb:

2014-08-28  Omair Javaid  <omair.javaid@linaro.org>

	* aarch64-linux-tdep.c 	(aarch64_linux_init_abi): Install AArch64
	register note sections.
	(struct core_regset_section aarch64_linux_regset_sections[]): Declare
	AArch64	register note sections.

---
 gdb/aarch64-linux-tdep.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Yao Qi Aug. 30, 2014, 2:56 a.m. | #1
Omair Javaid <omair.javaid@linaro.org> writes:

> 2014-08-28  Omair Javaid  <omair.javaid@linaro.org>
>
> 	* aarch64-linux-tdep.c 	(aarch64_linux_init_abi): Install AArch64
                              ^^
One redundant space.

> 	register note sections.
> 	(struct core_regset_section aarch64_linux_regset_sections[]): Declare
> 	AArch64	register note sections.

I don't understand how does this patch relate to your whole patch
series, which is about process record and reverse debugging for
aarch64.  If it is not related, please submit separately with a NEWS
entry for it.
Omair Javaid Sept. 1, 2014, 7:37 p.m. | #2
On 30 August 2014 07:56, Yao Qi <yao@codesourcery.com> wrote:
> Omair Javaid <omair.javaid@linaro.org> writes:
>
>> 2014-08-28  Omair Javaid  <omair.javaid@linaro.org>
>>
>>       * aarch64-linux-tdep.c  (aarch64_linux_init_abi): Install AArch64
>                               ^^
> One redundant space.
OK.

>
>>       register note sections.
>>       (struct core_regset_section aarch64_linux_regset_sections[]): Declare
>>       AArch64 register note sections.
>
> I don't understand how does this patch relate to your whole patch
> series, which is about process record and reverse debugging for
> aarch64.  If it is not related, please submit separately with a NEWS
> entry for it.

Record/Replay requires corefiles support as pre-req, record data is
stored in the form of core files.

>
> --
> Yao (齐尧)
Yao Qi Oct. 21, 2014, 1:24 p.m. | #3
Omair Javaid <omair.javaid@linaro.org> writes:

> @@ -376,6 +385,9 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
>    /* Enable longjmp.  */
>    tdep->jb_pc = 11;
>  
> +  /* Install supported register note sections.  */
> +  set_gdbarch_core_regset_sections (gdbarch, aarch64_linux_regset_sections);
> +
>    set_gdbarch_regset_from_core_section (gdbarch,
>  					aarch64_linux_regset_from_core_section);

Is this patch stale?  I don't see the definition of
set_gdbarch_core_regset_sections.  On the other hand, I see
aarch64-linux-tdep.c already has:

/* Implement the "regset_from_core_section" gdbarch method.  */

static void
aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                            iterate_over_regset_sections_cb *cb,
                                            void *cb_data,
                                            const struct regcache *regcache)
{
  cb (".reg", AARCH64_LINUX_SIZEOF_GREGSET, &aarch64_linux_gregset,
      NULL, cb_data);
  cb (".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, &aarch64_linux_fpregset,
      NULL, cb_data);
}

...
  set_gdbarch_iterate_over_regset_sections
    (gdbarch, aarch64_linux_iterate_over_regset_sections);

I assume this patch is no longer needed.
Omair Javaid Oct. 27, 2014, 12:33 p.m. | #4
On 21 October 2014 18:24, Yao Qi <yao@codesourcery.com> wrote:
> Omair Javaid <omair.javaid@linaro.org> writes:
>
>> @@ -376,6 +385,9 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
>>    /* Enable longjmp.  */
>>    tdep->jb_pc = 11;
>>
>> +  /* Install supported register note sections.  */
>> +  set_gdbarch_core_regset_sections (gdbarch, aarch64_linux_regset_sections);
>> +
>>    set_gdbarch_regset_from_core_section (gdbarch,
>>                                       aarch64_linux_regset_from_core_section);
>
> Is this patch stale?  I don't see the definition of
> set_gdbarch_core_regset_sections.  On the other hand, I see
> aarch64-linux-tdep.c already has:
>
> /* Implement the "regset_from_core_section" gdbarch method.  */
>
> static void
> aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
>                                             iterate_over_regset_sections_cb *cb,
>                                             void *cb_data,
>                                             const struct regcache *regcache)
> {
>   cb (".reg", AARCH64_LINUX_SIZEOF_GREGSET, &aarch64_linux_gregset,
>       NULL, cb_data);
>   cb (".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, &aarch64_linux_fpregset,
>       NULL, cb_data);
> }
>
> ...
>   set_gdbarch_iterate_over_regset_sections
>     (gdbarch, aarch64_linux_iterate_over_regset_sections);
>
> I assume this patch is no longer needed.

Agreed!

>
> --
> Yao (齐尧)

Patch

diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 6377977..e5565a8 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -231,6 +231,15 @@  aarch64_linux_regset_from_core_section (struct gdbarch *gdbarch,
   return NULL;
 }
 
+/* Core file register set sections.  */
+
+static struct core_regset_section aarch64_linux_regset_sections[] =
+{
+  { ".reg", AARCH64_LINUX_SIZEOF_GREGSET, "general-purpose" },
+  { ".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, "floating-point" },
+  { NULL, 0}
+};
+
 /* Implementation of `gdbarch_stap_is_single_operand', as defined in
    gdbarch.h.  */
 
@@ -376,6 +385,9 @@  aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   /* Enable longjmp.  */
   tdep->jb_pc = 11;
 
+  /* Install supported register note sections.  */
+  set_gdbarch_core_regset_sections (gdbarch, aarch64_linux_regset_sections);
+
   set_gdbarch_regset_from_core_section (gdbarch,
 					aarch64_linux_regset_from_core_section);