From: Peter Schauer Date: Wed, 2 Mar 1994 20:14:07 +0000 (+0000) Subject: * osfsolib.c (xfer_link_map_member): Update to use new X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c485c7a9ddc57c1c3b09c87f37f7c8ab02470230;p=binutils-gdb.git * osfsolib.c (xfer_link_map_member): Update to use new target_read_string interface. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2bcd0fb2a4d..e4fdc8f9a81 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +Wed Mar 2 11:31:08 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * osfsolib.c (xfer_link_map_member): Update to use new + target_read_string interface. + Wed Mar 2 09:17:55 1994 Jim Kingdon (kingdon@deneb.cygnus.com) * infrun.c (wait_for_inferior): In checking diff --git a/gdb/osfsolib.c b/gdb/osfsolib.c index 55d20cfd6e8..7f0d1a5ecee 100644 --- a/gdb/osfsolib.c +++ b/gdb/osfsolib.c @@ -344,11 +344,17 @@ xfer_link_map_member (so_list_ptr, lm) len = MAX_PATH_SIZE; strncpy (so_list_ptr->so_name, LM_NAME (so_list_ptr), MAX_PATH_SIZE); #else - if (!target_read_string((CORE_ADDR) LM_NAME (so_list_ptr), - so_list_ptr->so_name, MAX_PATH_SIZE - 1)) - error ("xfer_link_map_member: Can't read pathname for load map\n"); + int errcode; + char *buffer; + target_read_string ((CORE_ADDR) LM_NAME (so_list_ptr), &buffer, + MAX_PATH_SIZE - 1, &errcode); + if (errcode != 0) + error ("xfer_link_map_member: Can't read pathname for load map: %s\n", + safe_strerror (errcode)); + strncpy (so_list_ptr->so_name, buffer, MAX_PATH_SIZE - 1); + free (buffer); #endif - so_list_ptr->so_name[MAX_PATH_SIZE - 1] = 0; + so_list_ptr->so_name[MAX_PATH_SIZE - 1] = '\0'; solib_map_sections (so_list_ptr); }