aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2002-01-23 06:24:20 +0000
committerKevin Buettner <kevinb@redhat.com>2002-01-23 06:24:20 +0000
commit13fc0c2f38ad82e07263ae624593a22deffaf157 (patch)
treead8629f46ea0e4748c44c5ba3747b90c51f53c7c /gdb
parent7bd872fe055d9a878f3e8a40abf1ff619419da8f (diff)
downloadgdb-13fc0c2f38ad82e07263ae624593a22deffaf157.zip
gdb-13fc0c2f38ad82e07263ae624593a22deffaf157.tar.gz
gdb-13fc0c2f38ad82e07263ae624593a22deffaf157.tar.bz2
Fix xcalloc() calls so order of arguments is not reversed.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/solib-aix5.c8
-rw-r--r--gdb/solib-sunos.c4
-rw-r--r--gdb/solib-svr4.c4
4 files changed, 16 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d43b5fa..fbb7139 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2002-01-22 Kevin Buettner <kevinb@redhat.com>
+
+ * solib-aix5.c (build_so_list_from_mapfile)
+ (aix5_relocate_main_executable): Fix xcalloc() calls so order of
+ arguments is not reversed.
+ * solib-sunos.c (sunos_relocate_main_executable): Likewise.
+ * solib-svr4.c (svr4_relocate_main_executable): Likewise.
+
2002-01-22 Elena Zannoni <ezannoni@redhat.com>
* sh-tdep.c (sh_pseudo_register_read): New function. Renamed and
diff --git a/gdb/solib-aix5.c b/gdb/solib-aix5.c
index 54cb16f..1a8c9df 100644
--- a/gdb/solib-aix5.c
+++ b/gdb/solib-aix5.c
@@ -262,9 +262,9 @@ build_so_list_from_mapfile (int pid, long match_mask, long match_val)
if (sop == NULL)
{
- sop = xcalloc (sizeof (struct so_list), 1);
+ sop = xcalloc (1, sizeof (struct so_list));
make_cleanup (xfree, sop);
- sop->lm_info = xcalloc (sizeof (struct lm_info), 1);
+ sop->lm_info = xcalloc (1, sizeof (struct lm_info));
make_cleanup (xfree, sop->lm_info);
sop->lm_info->mapname = xstrdup (mapname);
make_cleanup (xfree, sop->lm_info->mapname);
@@ -714,8 +714,8 @@ aix5_relocate_main_executable (void)
/* Allocate the data structure which'll contain the new offsets to
relocate by. Initialize it so it contains the current offsets. */
- new_offsets = xcalloc (sizeof (struct section_offsets),
- symfile_objfile->num_sections);
+ new_offsets = xcalloc (symfile_objfile->num_sections,
+ sizeof (struct section_offsets));
make_cleanup (xfree, new_offsets);
for (i = 0; i < symfile_objfile->num_sections; i++)
new_offsets->offsets[i] = ANOFFSET (symfile_objfile->section_offsets, i);
diff --git a/gdb/solib-sunos.c b/gdb/solib-sunos.c
index 304657c..0f81d05 100644
--- a/gdb/solib-sunos.c
+++ b/gdb/solib-sunos.c
@@ -728,8 +728,8 @@ sunos_relocate_main_executable (void)
displacement = pc - bfd_get_start_address (exec_bfd);
changed = 0;
- new_offsets = xcalloc (sizeof (struct section_offsets),
- symfile_objfile->num_sections);
+ new_offsets = xcalloc (symfile_objfile->num_sections,
+ sizeof (struct section_offsets));
old_chain = make_cleanup (xfree, new_offsets);
for (i = 0; i < symfile_objfile->num_sections; i++)
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 987e776..f46326f 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1110,8 +1110,8 @@ svr4_relocate_main_executable (void)
displacement = pc - bfd_get_start_address (exec_bfd);
changed = 0;
- new_offsets = xcalloc (sizeof (struct section_offsets),
- symfile_objfile->num_sections);
+ new_offsets = xcalloc (symfile_objfile->num_sections,
+ sizeof (struct section_offsets));
old_chain = make_cleanup (xfree, new_offsets);
for (i = 0; i < symfile_objfile->num_sections; i++)