This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: fix "too much information" bug w/ "info vector" on PowerPC
- From: Paul Gilliam <pgilliam at us dot ibm dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: Daniel Jacobowitz <drow at false dot org>, Jim Blandy <jimb at redhat dot com>
- Date: Fri, 2 Sep 2005 07:25:39 -0700
- Subject: Re: fix "too much information" bug w/ "info vector" on PowerPC
- References: <200508301459.57189.pgilliam@us.ibm.com> <m364tkwfq7.fsf@alligator.red-bean.com> <20050902005525.GA30315@nevyn.them.org>
- Reply-to: pgilliam at us dot ibm dot com
On Thursday 01 September 2005 17:55, Daniel Jacobowitz wrote:
> On Thu, Sep 01, 2005 at 04:06:08PM -0700, Jim Blandy wrote:
> > Paul Gilliam <pgilliam@us.ibm.com> writes:
> >
> > > Talking about spaces, tabs, and formatting, I noticed that some of the function prototypes in ppc-tdep.h are over 80 columns and
> > > real ugly.
> > >
> > > Here, for your consideration, are two patches to change that: one uses a short-lived macro (ppc-tdep.patch) and the other uses a
> > > typedef (newest.patch).
> >
> > If I were to use a typedef, I'd put it in gdbarch.h and call it
> > gdb_retval_convention_t; there's nothing special about ppc-tdep.h's
> > needs.
> >
> > The following is also legal C, Emacs-friendly, and gdb_indent.sh-friendly:
> >
> > enum return_value_convention (ppc_sysv_abi_return_value
> > (struct gdbarch *gdbarch,
> > struct type *valtype,
> > struct regcache *regcache,
> > gdb_byte *readbuf,
> > const gdb_byte *writebuf));
> >
> > I used this once before, but Mark Kettenis declared it "weird" or
> > something and asked me to take it out. :) Be that as it may, I think
> > it's better than the macro or the local typedef.
>
> It is weird :-P
>
> What's so wrong with
>
> enum return_value_convention ppc_sysv_abi_return_value
> (struct gdbarch *, struct type *, struct regcache *,
> gdb_byte *, const gdb_byte *);
>
I noticed this style in other files:
enum return_value_convention
ppc_sysv_abi_return_value (
struct gdbarch *,struct type *, struct regcache *,
gdb_byte *, const gdb_byte *);
Which has the advantage of being able to search for the name with /^name/,
for those who don't have 'ctabs' or 'etabs' :-) And for those compulsive commenters:
enum return_value_convention
ppc_sysv_abi_return_value (
struct gdbarch *, /* Silly comment about this argument */
struct type *, /* Silly comment about this argument */
struct regcache *, /* Silly comment about this argument */
gdb_byte *, /* Silly comment about this argument */
const gdb_byte *); /* Silly comment about this argument */
which realy works best on a definition, rather than a declartation.
If someone wanted too, they could spend years trying to make the source consistant, not to
mention how disruptive it would be to on-going development/support.