This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: New ARI warning Sat Apr 24 01:55:22 UTC 2010
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Joel Brobecker <brobecker at adacore dot com>
- Date: Fri, 14 May 2010 18:28:28 +0100
- Subject: Re: New ARI warning Sat Apr 24 01:55:22 UTC 2010
- References: <20100424015523.GA5071@sourceware.org> <20100427164049.GF2951@adacore.com>
On Tuesday 27 April 2010 17:40:49, Joel Brobecker wrote:
> Examples of all upper-case functions: LM_ADDR_FROM_LINK_MAP,
> HAS_LM_DYNAMIC_FROM_LINK_MAP, LM_DYNAMIC_FROM_LINK_MAP, LM_ADDR_CHECK,
> etc.
>
> It's really easy to change their name, but maybe there is a reason other
> than historical for them being all uppercase (maybe they were macros).
> Something to look at during a rainy day...
Some where macros originally, and I guess others followed suit. E.g.,
in gdb 4.6, solib.c:
#ifndef SVR4_SHARED_LIBS
#define DEBUG_BASE "_DYNAMIC"
#define LM_ADDR(so) ((so) -> lm.lm_addr)
#define LM_NEXT(so) ((so) -> lm.lm_next)
#define LM_NAME(so) ((so) -> lm.lm_name)
static struct link_dynamic dynamic_copy;
static struct link_dynamic_2 ld_2_copy;
static struct ld_debug debug_copy;
static CORE_ADDR debug_addr;
static CORE_ADDR flag_addr;
#else /* SVR4_SHARED_LIBS */
#define DEBUG_BASE "_r_debug"
#define LM_ADDR(so) ((so) -> lm.l_addr)
#define LM_NEXT(so) ((so) -> lm.l_next)
#define LM_NAME(so) ((so) -> lm.l_name)
static struct r_debug debug_copy;
I guess they remained uppercase when solib-svr4.c was
later created, and solib.c gained the solib_ops
abstraction.
I'd be totally okay with lowercasing them.
--
Pedro Alves