]>
Commit | Line | Data |
---|---|---|
985fca12 SC |
1 | /*doc* |
2 | @section Core files | |
3 | Buff 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 | |
13 | Returns a read-only string explaining what program was running when | |
14 | it failed and produced the core file being read | |
15 | ||
16 | *; PROTO(CONST char *, bfd_core_file_failing_command, (bfd *)); | |
17 | */ | |
18 | ||
19 | CONST char * | |
20 | DEFUN(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 | |
31 | Returns the signal number which caused the core dump which generated | |
32 | the file the bfd is attatched to. | |
33 | ||
34 | *; PROTO(int, bfd_core_file_failing_signal, (bfd *)); | |
35 | */ | |
36 | int | |
37 | bfd_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 | |
49 | Returns @code{true} if the core file attatched to @var{core_bfd} was | |
50 | generated by a run of the executable file attatched to @var{exec_bfd}, | |
51 | or else @code{false}. | |
52 | *; PROTO(boolean, core_file_matches_executable_p, | |
53 | (bfd *core_bfd, bfd *exec_bfd)); | |
54 | */ | |
55 | boolean | |
56 | core_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 | } |