{
char *buf = NULL;
- /* If we have an exec_bfd, get the interpreter from the load commands. */
- if (exec_bfd)
+ /* If we have an current exec_bfd, get the interpreter from the load
+ commands. */
+ if (current_program_space->exec_bfd ())
{
bfd_mach_o_load_command *cmd;
- if (bfd_mach_o_lookup_command (exec_bfd,
+ if (bfd_mach_o_lookup_command (current_program_space->exec_bfd (),
BFD_MACH_O_LC_LOAD_DYLINKER, &cmd) == 1)
return cmd->command.dylinker.name_str;
}
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. */
CORE_ADDR vmaddr;
/* Find the base address of the executable. */
- vmaddr = bfd_mach_o_get_base_address (exec_bfd);
+ vmaddr = bfd_mach_o_get_base_address (current_program_space->exec_bfd ());
/* Relocate. */
if (vmaddr != load_addr)
{
/* Dyld hasn't yet relocated itself, so the notifier address may
be incorrect (as it has to be relocated). */
- CORE_ADDR start = bfd_get_start_address (exec_bfd);
+ CORE_ADDR start
+ = bfd_get_start_address (current_program_space->exec_bfd ());
if (start == 0)
notifier = 0;
else