00001 /* Core file generic interface routines for BFD. 00002 Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2003 00003 Free Software Foundation, Inc. 00004 Written by Cygnus Support. 00005 00006 This file is part of BFD, the Binary File Descriptor library. 00007 00008 This program is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with this program; if not, write to the Free Software 00020 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 00021 00022 /* 00023 SECTION 00024 Core files 00025 00026 DESCRIPTION 00027 These are functions pertaining to core files. 00028 */ 00029 00030 #include "bfd.h" 00031 #include "sysdep.h" 00032 #include "libbfd.h" 00033 00034 /* 00035 FUNCTION 00036 bfd_core_file_failing_command 00037 00038 SYNOPSIS 00039 const char *bfd_core_file_failing_command (bfd *abfd); 00040 00041 DESCRIPTION 00042 Return a read-only string explaining which program was running 00043 when it failed and produced the core file @var{abfd}. 00044 00045 */ 00046 00047 const char * 00048 bfd_core_file_failing_command (bfd *abfd) 00049 { 00050 if (abfd->format != bfd_core) 00051 { 00052 bfd_set_error (bfd_error_invalid_operation); 00053 return NULL; 00054 } 00055 return BFD_SEND (abfd, _core_file_failing_command, (abfd)); 00056 } 00057 00058 /* 00059 FUNCTION 00060 bfd_core_file_failing_signal 00061 00062 SYNOPSIS 00063 int bfd_core_file_failing_signal (bfd *abfd); 00064 00065 DESCRIPTION 00066 Returns the signal number which caused the core dump which 00067 generated the file the BFD @var{abfd} is attached to. 00068 */ 00069 00070 int 00071 bfd_core_file_failing_signal (bfd *abfd) 00072 { 00073 if (abfd->format != bfd_core) 00074 { 00075 bfd_set_error (bfd_error_invalid_operation); 00076 return 0; 00077 } 00078 return BFD_SEND (abfd, _core_file_failing_signal, (abfd)); 00079 } 00080 00081 /* 00082 FUNCTION 00083 core_file_matches_executable_p 00084 00085 SYNOPSIS 00086 bfd_boolean core_file_matches_executable_p 00087 (bfd *core_bfd, bfd *exec_bfd); 00088 00089 DESCRIPTION 00090 Return <<TRUE>> if the core file attached to @var{core_bfd} 00091 was generated by a run of the executable file attached to 00092 @var{exec_bfd}, <<FALSE>> otherwise. 00093 */ 00094 00095 bfd_boolean 00096 core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd) 00097 { 00098 if (core_bfd->format != bfd_core || exec_bfd->format != bfd_object) 00099 { 00100 bfd_set_error (bfd_error_wrong_format); 00101 return FALSE; 00102 } 00103 00104 return BFD_SEND (core_bfd, _core_file_matches_executable_p, 00105 (core_bfd, exec_bfd)); 00106 }
1.5.6