Fix assertion failure in linux-thread-db
[deliverable/binutils-gdb.git] / gdb / solib-spu.c
index 3c8cd1a4617b274cc396325ad5713bd91f7b6bfd..a629ec9818c78f36c71863a160ced3f8661deb7f 100644 (file)
@@ -110,8 +110,7 @@ append_ocl_sos (struct so_list **link_ptr)
         {
          enum bfd_endian byte_order = bfd_big_endian (objfile->obfd)?
                                         BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
-         volatile struct gdb_exception ex;
-         TRY_CATCH (ex, RETURN_MASK_ALL)
+         TRY
            {
              CORE_ADDR data =
                read_memory_unsigned_integer (*ocl_program_addr_base,
@@ -134,7 +133,7 @@ append_ocl_sos (struct so_list **link_ptr)
                  link_ptr = &newobj->next;
                }
            }
-         if (ex.reason < 0)
+         CATCH (ex, RETURN_MASK_ALL)
            {
              /* Ignore memory errors.  */
              switch (ex.error)
@@ -146,6 +145,7 @@ append_ocl_sos (struct so_list **link_ptr)
                  break;
                }
            }
+         END_CATCH
        }
     }
 }
@@ -313,6 +313,7 @@ spu_bfd_iovec_stat (bfd *abfd, void *stream, struct stat *sb)
      table to find the extent of the last section but that seems
      pointless when the size is needed only for checks of other
      parsed values in dbxread.c.  */
+  memset (sb, 0, sizeof (struct stat));
   sb->st_size = INT_MAX;
   return 0;
 }
@@ -321,8 +322,8 @@ static bfd *
 spu_bfd_fopen (char *name, CORE_ADDR addr)
 {
   bfd *nbfd;
+  CORE_ADDR *open_closure = XNEW (CORE_ADDR);
 
-  CORE_ADDR *open_closure = xmalloc (sizeof (CORE_ADDR));
   *open_closure = addr;
 
   nbfd = gdb_bfd_openr_iovec (name, "elf32-spu",
@@ -388,7 +389,7 @@ spu_bfd_open (char *pathname)
 }
 
 /* Lookup global symbol in a SPE executable.  */
-static struct symbol *
+static struct block_symbol
 spu_lookup_lib_symbol (struct objfile *objfile,
                       const char *name,
                       const domain_enum domain)
@@ -398,7 +399,7 @@ spu_lookup_lib_symbol (struct objfile *objfile,
 
   if (svr4_so_ops.lookup_lib_global_symbol != NULL)
     return svr4_so_ops.lookup_lib_global_symbol (objfile, name, domain);
-  return NULL;
+  return (struct block_symbol) {NULL, NULL};
 }
 
 /* Enable shared library breakpoint.  */
This page took 0.027071 seconds and 4 git commands to generate.