S390: Restructure s390_push_dummy_call
[deliverable/binutils-gdb.git] / gdb / gcore.c
index 1ebff2a42036890196b4d21419530307d65239e7..44b9d0c7609cadc6d5e4084708d9e4807078bd4d 100644 (file)
@@ -114,12 +114,19 @@ write_gcore_file_1 (bfd *obfd)
 void
 write_gcore_file (bfd *obfd)
 {
-  volatile struct gdb_exception except;
+  struct gdb_exception except = exception_none;
 
   target_prepare_to_generate_core ();
 
-  TRY_CATCH (except, RETURN_MASK_ALL)
-    write_gcore_file_1 (obfd);
+  TRY
+    {
+      write_gcore_file_1 (obfd);
+    }
+  CATCH (e, RETURN_MASK_ALL)
+    {
+      except = e;
+    }
+  END_CATCH
 
   target_done_generating_core ();
 
@@ -387,9 +394,9 @@ make_output_phdrs (bfd *obfd, asection *osec, void *ignored)
   int p_type = 0;
 
   /* FIXME: these constants may only be applicable for ELF.  */
-  if (strncmp (bfd_section_name (obfd, osec), "load", 4) == 0)
+  if (startswith (bfd_section_name (obfd, osec), "load"))
     p_type = PT_LOAD;
-  else if (strncmp (bfd_section_name (obfd, osec), "note", 4) == 0)
+  else if (startswith (bfd_section_name (obfd, osec), "note"))
     p_type = PT_NOTE;
   else
     p_type = PT_NULL;
@@ -562,7 +569,7 @@ gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
     return;
 
   /* Only interested in "load" sections.  */
-  if (strncmp ("load", bfd_section_name (obfd, osec), 4) != 0)
+  if (!startswith (bfd_section_name (obfd, osec), "load"))
     return;
 
   size = min (total_size, MAX_COPY_BYTES);
This page took 0.024712 seconds and 4 git commands to generate.