CORE_ADDR path_addr;
struct mach_o_header_external hdr;
unsigned long hdr_val;
- gdb::unique_xmalloc_ptr<char> file_path;
- int errcode;
/* Read image info from inferior. */
if (target_read_memory (iinfo, buf, image_info_size))
if (hdr_val == BFD_MACH_O_MH_EXECUTE)
continue;
- target_read_string (path_addr, &file_path,
- SO_NAME_MAX_PATH_SIZE - 1, &errcode);
- if (errcode)
+ gdb::unique_xmalloc_ptr<char> file_path
+ = target_read_string (path_addr, SO_NAME_MAX_PATH_SIZE - 1);
+ if (file_path == nullptr)
break;
/* Create and fill the new so_list element. */
return NULL;
/* Create a bfd for the interpreter. */
- gdb_bfd_ref_ptr dyld_bfd (gdb_bfd_open (interp_name, gnutarget, -1));
+ gdb_bfd_ref_ptr dyld_bfd (gdb_bfd_open (interp_name, gnutarget));
if (dyld_bfd != NULL)
{
gdb_bfd_ref_ptr sub
/* The current filename for fat-binary BFDs is a name generated
by BFD, usually a string containing the name of the architecture.
Reset its value to the actual filename. */
- bfd_set_filename (res.get (), xstrdup (pathname));
+ bfd_set_filename (res.get (), pathname);
return res;
}