+ inferior_thread ()->control.in_infcall = 0;
+ }
+}
+
+static const struct objfile_data *ocl_program_data_key;
+
+/* Appends OpenCL programs to the list of `struct so_list' objects. */
+static void
+append_ocl_sos (struct so_list **link_ptr)
+{
+ CORE_ADDR *ocl_program_addr_base;
+ struct objfile *objfile;
+
+ ALL_OBJFILES (objfile)
+ {
+ ocl_program_addr_base
+ = (CORE_ADDR *) objfile_data (objfile, ocl_program_data_key);
+ if (ocl_program_addr_base != NULL)
+ {
+ enum bfd_endian byte_order = bfd_big_endian (objfile->obfd)?
+ BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
+ TRY
+ {
+ CORE_ADDR data =
+ read_memory_unsigned_integer (*ocl_program_addr_base,
+ sizeof (CORE_ADDR),
+ byte_order);
+ if (data != 0x0)
+ {
+ struct so_list *newobj;
+
+ /* Allocate so_list structure. */
+ newobj = XCNEW (struct so_list);
+
+ /* Encode FD and object ID in path name. */
+ xsnprintf (newobj->so_name, sizeof newobj->so_name, "@%s <%d>",
+ hex_string (data),
+ SPUADDR_SPU (*ocl_program_addr_base));
+ strcpy (newobj->so_original_name, newobj->so_name);
+
+ *link_ptr = newobj;
+ link_ptr = &newobj->next;
+ }
+ }
+ CATCH (ex, RETURN_MASK_ALL)
+ {
+ /* Ignore memory errors. */
+ switch (ex.error)
+ {
+ case MEMORY_ERROR:
+ break;
+ default:
+ throw_exception (ex);
+ break;
+ }
+ }
+ END_CATCH
+ }