Initial revision
[deliverable/binutils-gdb.git] / bfd / core.c
CommitLineData
985fca12
SC
1/*doc*
2@section Core files
3Buff output this facinating topic
4*/
5
6#include "sysdep.h"
7#include "bfd.h"
8#include "libbfd.h"
9
10/** Some core file info commands */
11
12/*proto*i bfd_core_file_failing_command
13Returns a read-only string explaining what program was running when
14it failed and produced the core file being read
15
16*; PROTO(CONST char *, bfd_core_file_failing_command, (bfd *));
17*/
18
19CONST char *
20DEFUN(bfd_core_file_failing_command,(abfd),
21 bfd *abfd)
22{
23 if (abfd->format != bfd_core) {
24 bfd_error = invalid_operation;
25 return NULL;
26 }
27 return BFD_SEND (abfd, _core_file_failing_command, (abfd));
28}
29
30/*proto* bfd_core_file_failing_signal
31Returns the signal number which caused the core dump which generated
32the file the bfd is attatched to.
33
34*; PROTO(int, bfd_core_file_failing_signal, (bfd *));
35*/
36int
37bfd_core_file_failing_signal (abfd)
38 bfd *abfd;
39{
40 if (abfd->format != bfd_core) {
41 bfd_error = invalid_operation;
42 return 0;
43 }
44 return BFD_SEND (abfd, _core_file_failing_signal, (abfd));
45}
46
47
48/*proto* core_file_matches_executable_p
49Returns @code{true} if the core file attatched to @var{core_bfd} was
50generated by a run of the executable file attatched to @var{exec_bfd},
51or else @code{false}.
52*; PROTO(boolean, core_file_matches_executable_p,
53 (bfd *core_bfd, bfd *exec_bfd));
54*/
55boolean
56core_file_matches_executable_p (core_bfd, exec_bfd)
57 bfd *core_bfd, *exec_bfd;
58{
59 if ((core_bfd->format != bfd_core) || (exec_bfd->format != bfd_object)) {
60 bfd_error = wrong_format;
61 return false;
62 }
63
64 return BFD_SEND (core_bfd, _core_file_matches_executable_p, (core_bfd, exec_bfd));
65}
This page took 0.028766 seconds and 4 git commands to generate.