static CORE_ADDR
locate_base PARAMS ((void));
-static void
-solib_map_sections PARAMS ((struct so_list *));
+static int
+solib_map_sections PARAMS ((char *));
#ifdef SVR4_SHARED_LIBS
SYNOPSIS
- static void solib_map_sections (struct so_list *so)
+ static int solib_map_sections (struct so_list *so)
DESCRIPTION
expansion stuff?).
*/
-static void
-solib_map_sections (so)
- struct so_list *so;
+static int
+solib_map_sections (arg)
+ char *arg;
{
+ struct so_list *so = (struct so_list *) arg; /* catch_errors bogon */
char *filename;
char *scratch_pathname;
int scratch_chan;
/* Free the file names, close the file now. */
do_cleanups (old_chain);
+
+ return (1);
}
#ifndef SVR4_SHARED_LIBS
target_read_string ((CORE_ADDR) LM_NAME (new), &buffer,
MAX_PATH_SIZE - 1, &errcode);
if (errcode != 0)
- error ("find_solib: Can't read pathname for load map: %s\n",
- safe_strerror (errcode));
+ {
+ warning ("find_solib: Can't read pathname for load map: %s\n",
+ safe_strerror (errcode));
+ return (so_list_next);
+ }
strncpy (new -> so_name, buffer, MAX_PATH_SIZE - 1);
new -> so_name[MAX_PATH_SIZE - 1] = '\0';
free (buffer);
- solib_map_sections (new);
+ catch_errors (solib_map_sections, (char *) new,
+ "Error while mapping shared library sections:\n",
+ RETURN_MASK_ALL);
}
}
return (so_list_next);
if (so -> textsection)
text_addr = so -> textsection -> addr;
- else
+ else if (so -> abfd != NULL)
{
asection *lowest_sect;
This address is stored on the stack. However, I've been unable
to find any magic formula to find it for Solaris (appears to
- be trivial on Linux). Therefore, we have to try an alternate
+ be trivial on GNU/Linux). Therefore, we have to try an alternate
mechanism to find the dynamic linker's base address. */
tmp_bfd = bfd_openr (buf, gnutarget);
if (tmp_bfd == NULL)
/* For whatever reason we couldn't set a breakpoint in the dynamic
linker. Warn and drop into the old code. */
bkpt_at_symbol:
- warning ("Unable to find dynamic linker breakpoint function.");
- warning ("GDB will be unable to debug shared library initializers");
- warning ("and track explicitly loaded dynamic code.");
+ warning ("Unable to find dynamic linker breakpoint function.\nGDB will be unable to debug shared library initializers\nand track explicitly loaded dynamic code.");
}
#endif
Also, what if child has exit()ed? Must exit loop somehow.
*/
-void
+void
solib_create_inferior_hook()
{
- static int dyn_relocated;
-
/* If we are using the BKPT_AT_SYMBOL code, then we don't need the base
yet. In fact, in the case of a SunOS4 executable being run on
Solaris, we can't get it yet. find_solib will get it when it needs
return;
}
- if (!dyn_relocated && exec_bfd->start_address != stop_pc)
- {
- /* We have to relocate the debug information. */
- CORE_ADDR displacement = stop_pc - exec_bfd->start_address;
- struct section_offsets *new_offsets;
- int i;
-
- new_offsets = alloca (symfile_objfile->num_sections
- * sizeof (*new_offsets));
-
- for (i = 0; i < symfile_objfile->num_sections; ++i)
- ANOFFSET (new_offsets, i) =
- ANOFFSET (symfile_objfile->section_offsets, i);
-
- ANOFFSET (new_offsets, SECT_OFF_TEXT) += displacement;
- ANOFFSET (new_offsets, SECT_OFF_DATA) += displacement;
- ANOFFSET (new_offsets, SECT_OFF_BSS) += displacement;
- ANOFFSET (new_offsets, SECT_OFF_RODATA) += displacement;
-
- objfile_relocate (symfile_objfile, new_offsets);
- breakpoint_re_set ();
-
- /* Make sure this relocation is done only once. */
- dyn_relocated = 1;
- }
-
-#ifndef SVR4_SHARED_LIBS
- /* Only SunOS needs the loop below, other systems should be using the
+#if !defined(SVR4_SHARED_LIBS) || defined(_SCO_DS)
+ /* SCO and SunOS need the loop below, other systems should be using the
special shared library breakpoints and the shared library breakpoint
service routine.
}
while (stop_signal != TARGET_SIGNAL_TRAP);
stop_soon_quietly = 0;
-
+
+#if !defined(_SCO_DS)
/* We are now either at the "mapping complete" breakpoint (or somewhere
else, a condition we aren't prepared to deal with anyway), so adjust
the PC as necessary after a breakpoint, disable the breakpoint, and
if (auto_solib_add)
solib_add ((char *) 0, 0, (struct target_ops *) 0);
+#endif /* ! _SCO_DS */
#endif
}