* archures.c: Rename `struct bfd_arch_info_struct' to `struct
[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
985fca12
SC
21/*doc*
22@section Core files
23Buff output this facinating topic
24*/
25
26#include "sysdep.h"
27#include "bfd.h"
28#include "libbfd.h"
29
30/** Some core file info commands */
31
41f50af0 32/*proto* bfd_core_file_failing_command
985fca12
SC
33Returns a read-only string explaining what program was running when
34it failed and produced the core file being read
35
36*; PROTO(CONST char *, bfd_core_file_failing_command, (bfd *));
37*/
38
39CONST char *
40DEFUN(bfd_core_file_failing_command,(abfd),
41 bfd *abfd)
42{
43 if (abfd->format != bfd_core) {
44 bfd_error = invalid_operation;
45 return NULL;
46 }
47 return BFD_SEND (abfd, _core_file_failing_command, (abfd));
48}
49
50/*proto* bfd_core_file_failing_signal
51Returns the signal number which caused the core dump which generated
188d6d22 52the file the BFD is attached to.
985fca12
SC
53
54*; PROTO(int, bfd_core_file_failing_signal, (bfd *));
55*/
56int
57bfd_core_file_failing_signal (abfd)
58 bfd *abfd;
59{
60 if (abfd->format != bfd_core) {
61 bfd_error = invalid_operation;
62 return 0;
63 }
64 return BFD_SEND (abfd, _core_file_failing_signal, (abfd));
65}
66
67
68/*proto* core_file_matches_executable_p
188d6d22
RP
69Returns @code{true} if the core file attached to @var{core_bfd} was
70generated by a run of the executable file attached to @var{exec_bfd},
985fca12
SC
71or else @code{false}.
72*; PROTO(boolean, core_file_matches_executable_p,
73 (bfd *core_bfd, bfd *exec_bfd));
74*/
75boolean
76core_file_matches_executable_p (core_bfd, exec_bfd)
77 bfd *core_bfd, *exec_bfd;
78{
79 if ((core_bfd->format != bfd_core) || (exec_bfd->format != bfd_object)) {
80 bfd_error = wrong_format;
81 return false;
82 }
83
84 return BFD_SEND (core_bfd, _core_file_matches_executable_p, (core_bfd, exec_bfd));
85}
This page took 0.037175 seconds and 4 git commands to generate.