Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: cseo@linux.vnet.ibm.com (Carlos Eduardo Seo)
Cc: gdb-patches@sourceware.org (GDB Patches Mailing List)
Subject: Re: [RFC] Add support for PPC Altivec registers in gcore
Date: Mon, 17 Mar 2008 19:07:00 -0000	[thread overview]
Message-ID: <200803171906.m2HJ6YCB030691@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <47D543F9.20201@linux.vnet.ibm.com> from "Carlos Eduardo Seo" at Mar 10, 2008 11:21:45 AM

Carlos Eduardo Seo wrote:

> +# Supported register notes in core files
'.' at the end.

> +v:struct core_regset_section *:core_regset_sections:const char *name, int len::::default_regset_sections::(char *) '0'

Not '0' -- just 0.  (That *is* a difference!)


> @@ -2653,35 +2657,31 @@ linux_nat_do_thread_registers (bfd *obfd
>  					       lwp,
>  					       stop_signal, &gregs);
>  
> -  if (core_regset_p
> -      && (regset = gdbarch_regset_from_core_section (gdbarch, ".reg2",
> -						     sizeof (fpregs))) != NULL
> -      && regset->collect_regset != NULL)
> -    regset->collect_regset (regset, regcache, -1,
> -			    &fpregs, sizeof (fpregs));
> -  else
> -    fill_fpregset (regcache, &fpregs, -1);
> -
> -  note_data = (char *) elfcore_write_prfpreg (obfd,
> -					      note_data,
> -					      note_size,
> -					      &fpregs, sizeof (fpregs));

Ah.  I think I asked you to do this, but I overlooked something
here:  there are quite a number of Linux targets that either do
not define gdbarch_regset_from_core_section or do not implement
a collect_regset function.

We don't want to break those, so we'll probably have to keep
the fall-back to fill_fpregset for now.

> -#ifdef FILL_FPXREGSET
> -  if (core_regset_p
> -      && (regset = gdbarch_regset_from_core_section (gdbarch, ".reg-xfp",
> -						     sizeof (fpxregs))) != NULL
> -      && regset->collect_regset != NULL)
> -    regset->collect_regset (regset, regcache, -1,
> -			    &fpxregs, sizeof (fpxregs));
> -  else
> -    fill_fpxregset (regcache, &fpxregs, -1);
> -
> -  note_data = (char *) elfcore_write_prxfpreg (obfd,
> -					       note_data,
> -					       note_size,
> -					       &fpxregs, sizeof (fpxregs));
> -#endif

But *this* definitely can go away, as the i386 target does
use gdbarch_regset_from_core_section with collect_regset.

> +  /* The loop below uses the new struct core_regset_section, which stores
> +     the supported section names and sizes for the core file. Note that
> +     note PRSTATUS needs to be treated specially. But the other notes are
> +     structurally the same, so they can benefit from the new struct.  */
> +
> +  if (core_regset_p && sect_list != NULL)

sect_list cannot really be NULL as it has a default.

> +    while ((++sect_list)->sect_name != NULL)

This implicitly assumes that ".reg" must be the very first element.
I'd rather see an explicit check of the type

   /* ".reg" was already handled above.  */
   if (strcmp (sect_list->sect_name, ".reg") == 0)
     continue;

(And similarly for ".reg2" if we keep the special case above.)

> +	if ((regset = gdbarch_regset_from_core_section (gdbarch,
> +						     sect_list->sect_name,
> +						     (*sect_list).size))

I'd rather use sect_list->size (here and elsewhere).


> +#include <sys/procfs.h>
> +#include "gregset.h"
>  #include "i386-tdep.h"
>  #include "i386-linux-tdep.h"
>  #include "glibc-tdep.h"
>  #include "solib-svr4.h"
>  #include "symtab.h"
> +#include "regset.h"

These need Makefile.in dependency list changes.

> +#include <sys/procfs.h>
> +#include "gregset.h"
>  #include "version.h"
> +#include "regset.h"

Likewise.

> Index: src/gdb/arch-utils.h

> +#include "regset.h"
>  struct gdbarch;
>  struct frame_info;
>  struct minimal_symbol;
>  struct type;
>  struct gdbarch_info;
>  
> +extern struct core_regset_section default_regset_sections[];

I'd prefer *not* to include a new header file here; a forward
declaration of the struct should be enough:
   struct core_regset_section;

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2008-03-17 19:07 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-26 22:14 Carlos Eduardo Seo
2007-10-29 19:24 ` Ulrich Weigand
2007-10-30 21:02   ` Carlos Eduardo Seo
2007-10-30 21:18     ` Ulrich Weigand
2007-10-30 21:30       ` Carlos Eduardo Seo
2007-10-30 21:31         ` Ulrich Weigand
2007-10-31 21:14           ` Carlos Eduardo Seo
2007-10-31 21:43             ` Ulrich Weigand
2008-02-08 21:42               ` Carlos Eduardo Seo
2008-02-18 18:42                 ` Ulrich Weigand
2008-02-27 17:07                   ` Carlos Eduardo Seo
2008-03-05 18:27                     ` Ulrich Weigand
2008-03-10 14:22                   ` Carlos Eduardo Seo
2008-03-17 19:07                     ` Ulrich Weigand [this message]
2008-03-20 15:31                       ` Carlos Eduardo Seo
2008-03-25 20:13                         ` Ulrich Weigand
2008-03-25 21:31                           ` Andreas Schwab
2008-03-25 21:54                             ` Ulrich Weigand
2008-03-25 22:46                               ` Carlos Eduardo Seo
2008-03-26 11:28                                 ` Ulrich Weigand
2008-03-27  1:52                       ` Carlos Eduardo Seo
2008-03-27  9:00                         ` Andreas Schwab
2008-03-27 19:54                         ` Ulrich Weigand
2008-03-28 20:41                           ` Carlos Eduardo Seo
2008-03-31 19:19                             ` Ulrich Weigand
2008-05-09 19:27                               ` Carlos Eduardo Seo
2008-05-09 20:30                                 ` Ulrich Weigand
2008-05-10  1:33                                   ` Carlos Eduardo Seo
2008-05-14  4:22                                     ` Ulrich Weigand
2008-05-20 18:41                                       ` Carlos Eduardo Seo
2008-05-21 18:46                                         ` Ulrich Weigand
2008-05-22 14:34                                           ` Carlos Eduardo Seo
2008-05-22 18:45                                             ` Ulrich Weigand
2008-05-26 16:26                                               ` Carlos Eduardo Seo
     [not found] <OF67129E0D.852FADB2-ON4125738B.0050E74D-4125738B.005102FF@de.ibm.com>
2007-11-25  4:51 ` Carlos Eduardo Seo
2007-11-26 16:09   ` Ulrich Weigand
2007-11-26 16:12     ` Carlos Eduardo Seo

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=200803171906.m2HJ6YCB030691@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=cseo@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /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