aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPierre Muller <muller@sourceware.org>2011-04-19 11:38:40 +0000
committerPierre Muller <muller@sourceware.org>2011-04-19 11:38:40 +0000
commitb23518f0c81019c66875c68f7a4cf1225134091d (patch)
tree9396f39c027ab2dfc833d7ad1dd4b2d4a787b8b3 /gdb
parent00bbc0bdc6f5437c55d1a13907b6f22ecef6671f (diff)
downloadfsf-binutils-gdb-b23518f0c81019c66875c68f7a4cf1225134091d.zip
fsf-binutils-gdb-b23518f0c81019c66875c68f7a4cf1225134091d.tar.gz
fsf-binutils-gdb-b23518f0c81019c66875c68f7a4cf1225134091d.tar.bz2
ARI fixes: Use only lowercase function name for static functions.
* nto-tdep.c (LM_ADDR): Rename to... (lm_addr): New function name. (nto_relocate_section_addresses): Adapt to change above. * solib-sunos.c (LM_ADDR): Rename to... (lm_addr): New function name. (LM_NEXT): Rename to... (lm_next): New function name. (sunos_current_sos, sunos_relocate_section_addresses): Adapt to function name changes above. * solib-svr4.c (LM_ADDR_FROM_LINK_MAP): Rename to... (lm_addr_from_link_map): New function name. (HAS_LM_DYNAMIC_FROM_LINK_MAP): Rename to... (has_lm_dynamic_from_link_map): New function name. (LM_DYNAMIC_FROM_LINK_MAP): Rename to... (lm_dynamic_from_link_map): New function name. (LM_ADDR_CHECK): Rename to... (lm_addr_check): New function name. (LM_NEXT): Rename to... (lm_next): New function name. (LM_PREV): Rename to... (lm_prev): New function name. (LM_NAME): Rename to... (lm_name): New function name. (IGNORE_FIRST_LINK_MAP_ENTRY): Rename to... (ignore_first_link_map_entry): New function name. (svr4_keep_data_in_core): Adapt to function name changes above. (svr4_current_sos): Likewise. (enable_break): Likewise. (svr4_relocate_section_addresses): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog33
-rw-r--r--gdb/nto-tdep.c8
-rw-r--r--gdb/solib-sunos.c14
-rw-r--r--gdb/solib-svr4.c40
4 files changed, 64 insertions, 31 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2000627..cab3c84 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,38 @@
2011-04-19 Pierre Muller <muller@ics.u-strasbg.fr>
+ ARI fixes: Use only lowercase function name for static functions.
+ * nto-tdep.c (LM_ADDR): Rename to...
+ (lm_addr): New function name.
+ (nto_relocate_section_addresses): Adapt to change above.
+ * solib-sunos.c (LM_ADDR): Rename to...
+ (lm_addr): New function name.
+ (LM_NEXT): Rename to...
+ (lm_next): New function name.
+ (sunos_current_sos, sunos_relocate_section_addresses): Adapt to
+ function name changes above.
+ * solib-svr4.c (LM_ADDR_FROM_LINK_MAP): Rename to...
+ (lm_addr_from_link_map): New function name.
+ (HAS_LM_DYNAMIC_FROM_LINK_MAP): Rename to...
+ (has_lm_dynamic_from_link_map): New function name.
+ (LM_DYNAMIC_FROM_LINK_MAP): Rename to...
+ (lm_dynamic_from_link_map): New function name.
+ (LM_ADDR_CHECK): Rename to...
+ (lm_addr_check): New function name.
+ (LM_NEXT): Rename to...
+ (lm_next): New function name.
+ (LM_PREV): Rename to...
+ (lm_prev): New function name.
+ (LM_NAME): Rename to...
+ (lm_name): New function name.
+ (IGNORE_FIRST_LINK_MAP_ENTRY): Rename to...
+ (ignore_first_link_map_entry): New function name.
+ (svr4_keep_data_in_core): Adapt to function name changes above.
+ (svr4_current_sos): Likewise.
+ (enable_break): Likewise.
+ (svr4_relocate_section_addresses): Likewise.
+
+2011-04-19 Pierre Muller <muller@ics.u-strasbg.fr>
+
ARI cleanup.
* xtensa-tdep.c (xtensa_register_type): Use xstrprintf instead of
sprintf. Simplify code and avoid loosing memory.
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index 1db123d..6dd7892 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -233,7 +233,7 @@ nto_parse_redirection (char *pargv[], const char **pin, const char **pout,
return argv;
}
-/* The struct lm_info, LM_ADDR, and nto_truncate_ptr are copied from
+/* The struct lm_info, lm_addr, and nto_truncate_ptr are copied from
solib-svr4.c to support nto_relocate_section_addresses
which is different from the svr4 version. */
@@ -259,7 +259,7 @@ struct lm_info
static CORE_ADDR
-LM_ADDR (struct so_list *so)
+lm_addr (struct so_list *so)
{
if (so->lm_info->l_addr == (CORE_ADDR)-1)
{
@@ -310,8 +310,8 @@ nto_relocate_section_addresses (struct so_list *so, struct target_section *sec)
Elf_Internal_Phdr *phdr = find_load_phdr (sec->bfd);
unsigned vaddr = phdr ? phdr->p_vaddr : 0;
- sec->addr = nto_truncate_ptr (sec->addr + LM_ADDR (so) - vaddr);
- sec->endaddr = nto_truncate_ptr (sec->endaddr + LM_ADDR (so) - vaddr);
+ sec->addr = nto_truncate_ptr (sec->addr + lm_addr (so) - vaddr);
+ sec->endaddr = nto_truncate_ptr (sec->endaddr + lm_addr (so) - vaddr);
}
/* This is cheating a bit because our linker code is in libc.so. If we
diff --git a/gdb/solib-sunos.c b/gdb/solib-sunos.c
index dc7d31a..52f50a4 100644
--- a/gdb/solib-sunos.c
+++ b/gdb/solib-sunos.c
@@ -139,7 +139,7 @@ static CORE_ADDR flag_addr;
/* link map access functions */
static CORE_ADDR
-LM_ADDR (struct so_list *so)
+lm_addr (struct so_list *so)
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
int lm_addr_offset = offsetof (struct link_map, lm_addr);
@@ -150,7 +150,7 @@ LM_ADDR (struct so_list *so)
}
static CORE_ADDR
-LM_NEXT (struct so_list *so)
+lm_next (struct so_list *so)
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
int lm_next_offset = offsetof (struct link_map, lm_next);
@@ -162,7 +162,7 @@ LM_NEXT (struct so_list *so)
}
static CORE_ADDR
-LM_NAME (struct so_list *so)
+lm_name (struct so_list *so)
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
int lm_name_offset = offsetof (struct link_map, lm_name);
@@ -435,10 +435,10 @@ sunos_current_sos (void)
read_memory (lm, new->lm_info->lm, sizeof (struct link_map));
- lm = LM_NEXT (new);
+ lm = lm_next (new);
/* Extract this shared object's name. */
- target_read_string (LM_NAME (new), &buffer,
+ target_read_string (lm_name (new), &buffer,
SO_NAME_MAX_PATH_SIZE - 1, &errcode);
if (errcode != 0)
warning (_("Can't read pathname for load map: %s."),
@@ -825,8 +825,8 @@ static void
sunos_relocate_section_addresses (struct so_list *so,
struct target_section *sec)
{
- sec->addr += LM_ADDR (so);
- sec->endaddr += LM_ADDR (so);
+ sec->addr += lm_addr (so);
+ sec->endaddr += lm_addr (so);
}
static struct target_so_ops sunos_so_ops;
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index b632dd0..23d44a6 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -143,7 +143,7 @@ svr4_same (struct so_list *gdb, struct so_list *inferior)
/* link map access functions. */
static CORE_ADDR
-LM_ADDR_FROM_LINK_MAP (struct so_list *so)
+lm_addr_from_link_map (struct so_list *so)
{
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
@@ -153,7 +153,7 @@ LM_ADDR_FROM_LINK_MAP (struct so_list *so)
}
static int
-HAS_LM_DYNAMIC_FROM_LINK_MAP (void)
+has_lm_dynamic_from_link_map (void)
{
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
@@ -161,7 +161,7 @@ HAS_LM_DYNAMIC_FROM_LINK_MAP (void)
}
static CORE_ADDR
-LM_DYNAMIC_FROM_LINK_MAP (struct so_list *so)
+lm_dynamic_from_link_map (struct so_list *so)
{
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
@@ -171,19 +171,19 @@ LM_DYNAMIC_FROM_LINK_MAP (struct so_list *so)
}
static CORE_ADDR
-LM_ADDR_CHECK (struct so_list *so, bfd *abfd)
+lm_addr_check (struct so_list *so, bfd *abfd)
{
if (so->lm_info->l_addr == (CORE_ADDR)-1)
{
struct bfd_section *dyninfo_sect;
CORE_ADDR l_addr, l_dynaddr, dynaddr;
- l_addr = LM_ADDR_FROM_LINK_MAP (so);
+ l_addr = lm_addr_from_link_map (so);
- if (! abfd || ! HAS_LM_DYNAMIC_FROM_LINK_MAP ())
+ if (! abfd || ! has_lm_dynamic_from_link_map ())
goto set_addr;
- l_dynaddr = LM_DYNAMIC_FROM_LINK_MAP (so);
+ l_dynaddr = lm_dynamic_from_link_map (so);
dyninfo_sect = bfd_get_section_by_name (abfd, ".dynamic");
if (dyninfo_sect == NULL)
@@ -273,7 +273,7 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd)
}
static CORE_ADDR
-LM_NEXT (struct so_list *so)
+lm_next (struct so_list *so)
{
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
@@ -283,7 +283,7 @@ LM_NEXT (struct so_list *so)
}
static CORE_ADDR
-LM_PREV (struct so_list *so)
+lm_prev (struct so_list *so)
{
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
@@ -293,7 +293,7 @@ LM_PREV (struct so_list *so)
}
static CORE_ADDR
-LM_NAME (struct so_list *so)
+lm_name (struct so_list *so)
{
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
@@ -303,14 +303,14 @@ LM_NAME (struct so_list *so)
}
static int
-IGNORE_FIRST_LINK_MAP_ENTRY (struct so_list *so)
+ignore_first_link_map_entry (struct so_list *so)
{
/* Assume that everything is a library if the dynamic loader was loaded
late by a static executable. */
if (exec_bfd && bfd_get_section_by_name (exec_bfd, ".dynamic") == NULL)
return 0;
- return LM_PREV (so) == 0;
+ return lm_prev (so) == 0;
}
/* Per pspace SVR4 specific data. */
@@ -977,7 +977,7 @@ svr4_keep_data_in_core (CORE_ADDR vaddr, unsigned long size)
new->lm_info->lm = xzalloc (lmo->link_map_size);
make_cleanup (xfree, new->lm_info->lm);
read_memory (ldsomap, new->lm_info->lm, lmo->link_map_size);
- lm_name = LM_NAME (new);
+ lm_name = lm_name (new);
do_cleanups (old_chain);
return (lm_name >= vaddr && lm_name < vaddr + size);
@@ -1158,9 +1158,9 @@ svr4_current_sos (void)
read_memory (lm, new->lm_info->lm, lmo->link_map_size);
- next_lm = LM_NEXT (new);
+ next_lm = lm_next (new);
- if (LM_PREV (new) != prev_lm)
+ if (lm_prev (new) != prev_lm)
{
warning (_("Corrupted shared library list"));
free_so (new);
@@ -1172,7 +1172,7 @@ svr4_current_sos (void)
SVR4, it has no name. For others (Solaris 2.3 for example), it
does have a name, so we can no longer use a missing name to
decide when to ignore it. */
- else if (IGNORE_FIRST_LINK_MAP_ENTRY (new) && ldsomap == 0)
+ else if (ignore_first_link_map_entry (new) && ldsomap == 0)
{
info->main_lm_addr = new->lm_info->lm_addr;
free_so (new);
@@ -1183,7 +1183,7 @@ svr4_current_sos (void)
char *buffer;
/* Extract this shared object's name. */
- target_read_string (LM_NAME (new), &buffer,
+ target_read_string (lm_name (new), &buffer,
SO_NAME_MAX_PATH_SIZE - 1, &errcode);
if (errcode != 0)
warning (_("Can't read pathname for load map: %s."),
@@ -1484,7 +1484,7 @@ enable_break (struct svr4_info *info, int from_tty)
{
load_addr_found = 1;
loader_found_in_list = 1;
- load_addr = LM_ADDR_CHECK (so, tmp_bfd);
+ load_addr = lm_addr_check (so, tmp_bfd);
break;
}
so = so->next;
@@ -2270,9 +2270,9 @@ static void
svr4_relocate_section_addresses (struct so_list *so,
struct target_section *sec)
{
- sec->addr = svr4_truncate_ptr (sec->addr + LM_ADDR_CHECK (so,
+ sec->addr = svr4_truncate_ptr (sec->addr + lm_addr_check (so,
sec->bfd));
- sec->endaddr = svr4_truncate_ptr (sec->endaddr + LM_ADDR_CHECK (so,
+ sec->endaddr = svr4_truncate_ptr (sec->endaddr + lm_addr_check (so,
sec->bfd));
}