This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Code cleanup: Make function typedef for find memory region
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 30 Aug 2010 07:14:54 -0700
- Subject: Re: [patch] Code cleanup: Make function typedef for find memory region
- References: <20100830085953.GA25961@host1.dyn.jankratochvil.net>
> Currently
> int (*func) (CORE_ADDR, unsigned long, int, int, int, void *),
>
> is used on many places to find memory regions. Changing the prototype
> requires even changes on places which would not have to be changed otherwise.
I think we should generalize this idea and use function types whenever
possible. Using a function type, for instance, makes it easier for
someone to find the description of that function. I had that problem
recently, and it took me a long time to find what I was looking for.
I also believe that we should explicitly name the parameters in the
function type declaration. I think this is important, because I think
that this practice would have helped prevent an unfortunate regression
(filename/fullname confusion in MI command). We should name the parameters
so that we know which parameter is what. And that also helps IMO writing
the function description.
--
Joel