aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-spu.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-01-09 09:11:00 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-01-09 09:11:00 +0000
commit567995e103055787c86c42096397015a55e02fd4 (patch)
treea0de58b90d278e233552c471b8111ccd2203a108 /gdb/solib-spu.c
parenta2beed37dbcc39524abf8a86b2133ea49f766205 (diff)
downloadgdb-567995e103055787c86c42096397015a55e02fd4.zip
gdb-567995e103055787c86c42096397015a55e02fd4.tar.gz
gdb-567995e103055787c86c42096397015a55e02fd4.tar.bz2
gdb/
Fix displacement of separate debug info files. * objfiles.c (objfile_relocate): Rename to ... (objfile_relocate1): ... here and make it static. Extend the comment. (objfile_relocate): New function. * solib-spu.c (spu_relocate_main_executable): Explicitly check if SYMFILE_OBJFILE is NULL. Remove variables objfile and old_chain. Remove following of SEPARATE_DEBUG_OBJFILE. new_offsets is now allocated using alloca. * symfile.c (copy_section_addr_info): Remove. (build_section_addr_info_from_objfile): Make it global. New variables addr_bit and mask, use them. * symfile.h (build_section_addr_info_from_objfile): New prototype. (copy_section_addr_info): Remove.
Diffstat (limited to 'gdb/solib-spu.c')
-rw-r--r--gdb/solib-spu.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c
index e752544..94a77fb 100644
--- a/gdb/solib-spu.c
+++ b/gdb/solib-spu.c
@@ -50,25 +50,19 @@
static void
spu_relocate_main_executable (int spufs_fd)
{
- struct objfile *objfile;
- struct cleanup *old_chain;
struct section_offsets *new_offsets;
int i;
- for (objfile = symfile_objfile;
- objfile;
- objfile = objfile->separate_debug_objfile)
- {
- new_offsets = xcalloc (objfile->num_sections,
- sizeof (struct section_offsets));
- old_chain = make_cleanup (xfree, new_offsets);
+ if (symfile_objfile == NULL)
+ return;
- for (i = 0; i < objfile->num_sections; i++)
- new_offsets->offsets[i] = SPUADDR (spufs_fd, 0);
+ new_offsets = alloca (symfile_objfile->num_sections
+ * sizeof (struct section_offsets));
- objfile_relocate (objfile, new_offsets);
- do_cleanups (old_chain);
- }
+ for (i = 0; i < symfile_objfile->num_sections; i++)
+ new_offsets->offsets[i] = SPUADDR (spufs_fd, 0);
+
+ objfile_relocate (symfile_objfile, new_offsets);
}
/* When running a stand-alone SPE executable, we may need to skip one more