From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Kettenis 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 Message-id: <200405201231.i4KCVx0P070862@elgar.kettenis.dyndns.org> References: X-SW-Source: 2004-05/msg00604.html From: Jim Blandy 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.