]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/corefile.c
2010-08-18 Pedro Alves <pedro@codesourcery.com>
[thirdparty/binutils-gdb.git] / bfd / corefile.c
index 7802a3a3fa297360036543abcd96f50a91589e86..605be8d33da1569edab9c2abc9b0bfa9cc7b58dc 100644 (file)
@@ -82,6 +82,31 @@ bfd_core_file_failing_signal (bfd *abfd)
   return BFD_SEND (abfd, _core_file_failing_signal, (abfd));
 }
 
+/*
+FUNCTION
+       bfd_core_file_pid
+
+SYNOPSIS
+       int bfd_core_file_pid (bfd *abfd);
+
+DESCRIPTION
+
+       Returns the PID of the process the core dump the BFD
+       @var{abfd} is attached to was generated from.
+*/
+
+int
+bfd_core_file_pid (bfd *abfd)
+{
+  if (abfd->format != bfd_core)
+    {
+      bfd_set_error (bfd_error_invalid_operation);
+      return 0;
+    }
+  return BFD_SEND (abfd, _core_file_pid, (abfd));
+}
+
+
 /*
 FUNCTION
        core_file_matches_executable_p