Fixed dependencies
[deliverable/binutils-gdb.git] / bfd / core.c
CommitLineData
3c8a3c56
JG
1/* Core file generic interface routines for BFD.
2 Copyright (C) 1990-1991 Free Software Foundation, Inc.
3 Written by Cygnus Support.
4
5This file is part of BFD, the Binary File Descriptor library.
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, write to the Free Software
19Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20
0cda46cf
SC
21/*
22SECTION
23 Core files
24
25DESCRIPTION
26 Buff output this facinating topic
985fca12
SC
27*/
28
985fca12 29#include "bfd.h"
bbc8d484 30#include "sysdep.h"
985fca12
SC
31#include "libbfd.h"
32
985fca12 33
0cda46cf
SC
34/*
35FUNCTION
36 bfd_core_file_failing_command
37
38DESCRIPTION
39 Returns a read-only string explaining what program was running
40 when it failed and produced the core file being read
985fca12 41
0cda46cf
SC
42SYNOPSIS
43 CONST char *bfd_core_file_failing_command(bfd *);
985fca12
SC
44*/
45
46CONST char *
47DEFUN(bfd_core_file_failing_command,(abfd),
48 bfd *abfd)
49{
50 if (abfd->format != bfd_core) {
51 bfd_error = invalid_operation;
52 return NULL;
53 }
54 return BFD_SEND (abfd, _core_file_failing_command, (abfd));
55}
56
0cda46cf
SC
57/*
58FUNCTION
59 bfd_core_file_failing_signal
985fca12 60
0cda46cf
SC
61DESCRIPTION
62 Returns the signal number which caused the core dump which
63 generated the file the BFD is attached to.
64
65SYNOPSIS
66 int bfd_core_file_failing_signal(bfd *);
985fca12 67*/
0cda46cf 68
985fca12
SC
69int
70bfd_core_file_failing_signal (abfd)
71 bfd *abfd;
72{
73 if (abfd->format != bfd_core) {
74 bfd_error = invalid_operation;
75 return 0;
76 }
77 return BFD_SEND (abfd, _core_file_failing_signal, (abfd));
78}
79
80
0cda46cf
SC
81/*
82FUNCTION
83 core_file_matches_executable_p
84
85DESCRIPTION
86 Returns <<true>> if the core file attached to @var{core_bfd}
87 was generated by a run of the executable file attached to
88 @var{exec_bfd}, or else <<false>>.
89
90SYNOPSIS
91 boolean core_file_matches_executable_p
92 (bfd *core_bfd, bfd *exec_bfd);
985fca12 93*/
0cda46cf 94
985fca12
SC
95boolean
96core_file_matches_executable_p (core_bfd, exec_bfd)
97 bfd *core_bfd, *exec_bfd;
98{
0cda46cf
SC
99 if ((core_bfd->format != bfd_core) || (exec_bfd->format != bfd_object)) {
100 bfd_error = wrong_format;
101 return false;
102 }
985fca12 103
0cda46cf
SC
104 return BFD_SEND (core_bfd, _core_file_matches_executable_p,
105 (core_bfd, exec_bfd));
985fca12 106}
This page took 0.035865 seconds and 4 git commands to generate.