Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@chello.nl>
To: jimb@redhat.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFA: allocate regsets on gdbarch obstack
Date: Thu, 20 May 2004 12:32:00 -0000	[thread overview]
Message-ID: <200405201231.i4KCVx0P070862@elgar.kettenis.dyndns.org> (raw)
In-Reply-To: <vt2zn83y4fs.fsf@zenia.home>

   From: Jim Blandy <jimb@redhat.com>
   Date: 20 May 2004 01:53:59 -0500

   Index: gdb/regset.h
   ===================================================================
   RCS file: /cvs/src/src/gdb/regset.h,v
   retrieving revision 1.2
   diff -c -p -r1.2 regset.h
   *** gdb/regset.h	20 May 2004 00:53:06 -0000	1.2
   --- gdb/regset.h	20 May 2004 05:19:23 -0000
   *************** struct regset
   *** 51,60 ****
	function is COLLECT_REGSET.  If the regset has no collect function,
	pass NULL for COLLECT_REGSET.

   !    The object returned is allocated using xmalloc.  */
   ! extern struct regset *regset_xmalloc (void *descr,
   !                                       supply_regset_ftype *supply_regset,
   !                                       collect_regset_ftype *collect_regset);


     #endif /* regset.h */
   --- 51,62 ----
	function is COLLECT_REGSET.  If the regset has no collect function,
	pass NULL for COLLECT_REGSET.

   !    The object returned is allocated on ARCH's obstack.  */
   ! extern struct regset *(regset_obstack_alloc
   !                        (struct gdbarch *arch,
   !                         void *descr,
   !                         supply_regset_ftype *supply_regset,
   !                         collect_regset_ftype *collect_regset));



I'm not entirely happy with the name regset_obstack_alloc.  We have
frame_obstack_zalloc and gdbarch_obstack_zalloc, but that's because we
have a frame obstack and a gdbarch obstack.  There is no
regset_obstack, so I think regset_obstack_alloc is confusing.  How
about just regset_alloc?  The caller shouldn't really care about the
way the srorage is provided; the `struct gdbarch' argument already
ties it to a specific architecture.

Now that it gets tied to the architecture anyway, I wonder whether we
should get rid of the descr argument entirely.  I might want to tweak
that before you add register sets to any new targets...

Anyway, consider a patch with s/regset_obstack_alloc/regset_obstack/g
and gets rid of the funny parenthesis pre-approved.

Mark

P.S. Sorry to be so pedantic about function name, but I feel the lack
of consistency in naming function is causing too much confusion.


  reply	other threads:[~2004-05-20 12:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-20  6:58 Jim Blandy
2004-05-20 12:32 ` Mark Kettenis [this message]
2004-05-21 22:15   ` Jim Blandy
2004-05-22 12:35     ` Mark Kettenis
2004-05-21 22:16   ` Jim Blandy

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=200405201231.i4KCVx0P070862@elgar.kettenis.dyndns.org \
    --to=kettenis@chello.nl \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@redhat.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