/* Cell SPU GNU/Linux support -- shared library handling.
- Copyright (C) 2009-2018 Free Software Foundation, Inc.
+ Copyright (C) 2009-2019 Free Software Foundation, Inc.
Contributed by Ulrich Weigand <uweigand@de.ibm.com>.
#include "solist.h"
#include "inferior.h"
#include "objfiles.h"
-#include "observer.h"
+#include "observable.h"
#include "breakpoint.h"
#include "gdbthread.h"
#include "gdb_bfd.h"
append_ocl_sos (struct so_list **link_ptr)
{
CORE_ADDR *ocl_program_addr_base;
- struct objfile *objfile;
- ALL_OBJFILES (objfile)
+ for (objfile *objfile : current_program_space->objfiles ())
{
ocl_program_addr_base
= (CORE_ADDR *) objfile_data (objfile, ocl_program_data_key);
{
enum bfd_endian byte_order = bfd_big_endian (objfile->obfd)?
BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
- TRY
+ try
{
CORE_ADDR data =
read_memory_unsigned_integer (*ocl_program_addr_base,
link_ptr = &newobj->next;
}
}
- CATCH (ex, RETURN_MASK_ALL)
+ catch (const gdb_exception &ex)
{
/* Ignore memory errors. */
switch (ex.error)
case MEMORY_ERROR:
break;
default:
- throw_exception (ex);
+ throw;
break;
}
}
- END_CATCH
}
}
}
;
/* Determine list of SPU ids. */
- size = target_read (¤t_target, TARGET_OBJECT_SPU, NULL,
+ size = target_read (current_top_target (), TARGET_OBJECT_SPU, NULL,
buf, 0, sizeof buf);
/* Do not add stand-alone SPE executable context as shared library,
already created the SPE context, but not installed the object-id
yet. Skip such entries; we'll be back for them later. */
xsnprintf (annex, sizeof annex, "%d/object-id", fd);
- len = target_read (¤t_target, TARGET_OBJECT_SPU, annex,
+ len = target_read (current_top_target (), TARGET_OBJECT_SPU, annex,
(gdb_byte *) id, 0, sizeof id);
if (len <= 0 || len >= sizeof id)
continue;
if (svr4_so_ops.lookup_lib_global_symbol != NULL)
return svr4_so_ops.lookup_lib_global_symbol (objfile, name, domain);
- return (struct block_symbol) {NULL, NULL};
+ return {};
}
/* Enable shared library breakpoint. */
CORE_ADDR addr = BMSYMBOL_VALUE_ADDRESS (spe_event_sym);
addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (), addr,
- ¤t_target);
+ current_top_target ());
create_solib_event_breakpoint (target_gdbarch (), addr);
return 1;
}
void
_initialize_spu_solib (void)
{
- observer_attach_solib_loaded (spu_solib_loaded);
+ gdb::observers::solib_loaded.attach (spu_solib_loaded);
ocl_program_data_key = register_objfile_data ();
}