aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-svr4.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-08-26 17:30:35 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-08-26 17:30:35 +0000
commitf1838a98418d9912df59591058ca560f2de5cf14 (patch)
tree6f1a59a1733ab613b344f6d54b7100f6ea468179 /gdb/solib-svr4.c
parent1cf3db46a678ced9d729572de9232fab9c00350d (diff)
downloadgdb-f1838a98418d9912df59591058ca560f2de5cf14.zip
gdb-f1838a98418d9912df59591058ca560f2de5cf14.tar.gz
gdb-f1838a98418d9912df59591058ca560f2de5cf14.tar.bz2
ChangeLog:
* remote.h (remote_filename_p, remote_bfd_open): Add prototypes. * remote.c (remote_bfd_iovec_open, remote_bfd_iovec_close, remote_bfd_iovec_pread, remote_bfd_iovec_stat, remote_filename_p, remote_bfd_open): New functions. (remote_hostio_send_command): Fail safely if remote connection is not set up. * solist.h (solib_open): Remove prototype. (solib_bfd_open): Add prototype. * solib.c: Include "remote.h". (solib_open): Remove, replace by ... (solib_bfd_open): ... this new function. Handle remote BFDs. (solib_map_sections): Replace solib_open by solib_bfd_open. * solib-frv.c: Include "exceptions.h". (enable_break2): Replace solib_open by solib_bfd_open. * solib-svr4.c: Include "exceptions.h". (enable_break): Replace solib_open by solib_bfd_open. * symfile.c: Include "remote.h". (build_id_verify): Handle remote BFDs. (separate_debug_file_exists): Use BFD to access file. Handle remote BFDs. (symfile_bfd_open): Handle remote BFDs. (reread_symbols): Handle remote BFDs. * NEWS: Mention "remote:" argument prefix to "set sysroot". doc/ChangeLog: * gdb.texinfo (Commands to Specify Files): Document "remote:" argument prefix to "set sysroot".
Diffstat (limited to 'gdb/solib-svr4.c')
-rw-r--r--gdb/solib-svr4.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 654c906..4aff383 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -42,6 +42,7 @@
#include "elf-bfd.h"
#include "exec.h"
#include "auxv.h"
+#include "exceptions.h"
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
@@ -1038,8 +1039,7 @@ enable_break (void)
struct so_list *so;
bfd *tmp_bfd = NULL;
struct target_ops *tmp_bfd_target;
- int tmp_fd = -1;
- char *tmp_pathname = NULL;
+ volatile struct gdb_exception ex;
/* Read the contents of the .interp section into a local buffer;
the contents specify the dynamic linker this program uses. */
@@ -1058,21 +1058,13 @@ enable_break (void)
be trivial on GNU/Linux). Therefore, we have to try an alternate
mechanism to find the dynamic linker's base address. */
- tmp_fd = solib_open (buf, &tmp_pathname);
- if (tmp_fd >= 0)
- tmp_bfd = bfd_fopen (tmp_pathname, gnutarget, FOPEN_RB, tmp_fd);
-
+ TRY_CATCH (ex, RETURN_MASK_ALL)
+ {
+ tmp_bfd = solib_bfd_open (buf);
+ }
if (tmp_bfd == NULL)
goto bkpt_at_symbol;
- /* Make sure the dynamic linker's really a useful object. */
- if (!bfd_check_format (tmp_bfd, bfd_object))
- {
- warning (_("Unable to grok dynamic linker %s as an object file"), buf);
- bfd_close (tmp_bfd);
- goto bkpt_at_symbol;
- }
-
/* Now convert the TMP_BFD into a target. That way target, as
well as BFD operations can be used. Note that closing the
target will also close the underlying bfd. */
@@ -1166,7 +1158,6 @@ enable_break (void)
/* For whatever reason we couldn't set a breakpoint in the dynamic
linker. Warn and drop into the old code. */
bkpt_at_symbol:
- xfree (tmp_pathname);
warning (_("Unable to find dynamic linker breakpoint function.\n"
"GDB will be unable to debug shared library initializers\n"
"and track explicitly loaded dynamic code."));