1 /* Core dump and executable file functions below target vector, for GDB.
3 Copyright (C) 1986-2018 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 #include "arch-utils.h"
24 #ifdef HAVE_SYS_FILE_H
25 #include <sys/file.h> /* needed for F_OK and friends */
27 #include "frame.h" /* required by inferior.h */
35 #include "gdbthread.h"
40 #include "readline/readline.h"
42 #include "filenames.h"
43 #include "progspace.h"
46 #include "completer.h"
47 #include "filestuff.h"
53 /* The core file target. */
55 static const target_info core_target_info
= {
57 N_("Local core dump file"),
58 N_("Use a core file as a target. Specify the filename of the core file.")
61 class core_target final
: public target_ops
65 { to_stratum
= process_stratum
; }
67 const target_info
&info () const override
68 { return core_target_info
; }
70 void close () override
;
71 void detach (inferior
*, int) override
;
72 void fetch_registers (struct regcache
*, int) override
;
74 enum target_xfer_status
xfer_partial (enum target_object object
,
77 const gdb_byte
*writebuf
,
78 ULONGEST offset
, ULONGEST len
,
79 ULONGEST
*xfered_len
) override
;
80 void files_info () override
;
82 bool thread_alive (ptid_t ptid
) override
;
83 const struct target_desc
*read_description () override
;
85 const char *pid_to_str (ptid_t
) override
;
87 const char *thread_name (struct thread_info
*) override
;
89 bool has_memory () override
;
90 bool has_stack () override
;
91 bool has_registers () override
;
92 bool info_proc (const char *, enum info_proc_what
) override
;
96 struct target_ops
*the_core_target
;
98 /* List of all available core_fns. On gdb startup, each core file
99 register reader calls deprecated_add_core_fns() to register
100 information on each core format it is prepared to read. */
102 static struct core_fns
*core_file_fns
= NULL
;
104 /* The core_fns for a core file handler that is prepared to read the
105 core file currently open on core_bfd. */
107 static struct core_fns
*core_vec
= NULL
;
109 /* FIXME: kettenis/20031023: Eventually this variable should
112 static struct gdbarch
*core_gdbarch
= NULL
;
114 /* Per-core data. Currently, only the section table. Note that these
115 target sections are *not* mapped in the current address spaces' set
116 of target sections --- those should come only from pure executable
117 or shared library bfds. The core bfd sections are an
118 implementation detail of the core target, just like ptrace is for
119 unix child targets. */
120 static struct target_section_table
*core_data
;
122 static struct core_fns
*sniff_core_bfd (bfd
*);
124 static int gdb_check_format (bfd
*);
126 static void core_close_cleanup (void *ignore
);
128 static void add_to_thread_list (bfd
*, asection
*, void *);
130 static core_target core_ops
;
132 /* An arbitrary identifier for the core inferior. */
133 #define CORELOW_PID 1
135 /* Link a new core_fns into the global core_file_fns list. Called on
136 gdb startup by the _initialize routine in each core file register
137 reader, to register information about each format the reader is
138 prepared to handle. */
141 deprecated_add_core_fns (struct core_fns
*cf
)
143 cf
->next
= core_file_fns
;
147 /* The default function that core file handlers can use to examine a
148 core file BFD and decide whether or not to accept the job of
149 reading the core file. */
152 default_core_sniffer (struct core_fns
*our_fns
, bfd
*abfd
)
156 result
= (bfd_get_flavour (abfd
) == our_fns
-> core_flavour
);
160 /* Walk through the list of core functions to find a set that can
161 handle the core file open on ABFD. Returns pointer to set that is
164 static struct core_fns
*
165 sniff_core_bfd (bfd
*abfd
)
168 struct core_fns
*yummy
= NULL
;
171 /* Don't sniff if we have support for register sets in
173 if (core_gdbarch
&& gdbarch_iterate_over_regset_sections_p (core_gdbarch
))
176 for (cf
= core_file_fns
; cf
!= NULL
; cf
= cf
->next
)
178 if (cf
->core_sniffer (cf
, abfd
))
186 warning (_("\"%s\": ambiguous core format, %d handlers match"),
187 bfd_get_filename (abfd
), matches
);
189 else if (matches
== 0)
190 error (_("\"%s\": no core file handler recognizes format"),
191 bfd_get_filename (abfd
));
196 /* The default is to reject every core file format we see. Either
197 BFD has to recognize it, or we have to provide a function in the
198 core file handler that recognizes it. */
201 default_check_format (bfd
*abfd
)
206 /* Attempt to recognize core file formats that BFD rejects. */
209 gdb_check_format (bfd
*abfd
)
213 for (cf
= core_file_fns
; cf
!= NULL
; cf
= cf
->next
)
215 if (cf
->check_format (abfd
))
223 /* Discard all vestiges of any previous core file and mark data and
224 stack spaces as empty. */
231 int pid
= ptid_get_pid (inferior_ptid
);
232 inferior_ptid
= null_ptid
; /* Avoid confusion from thread
235 exit_inferior_silent (pid
);
237 /* Clear out solib state while the bfd is still open. See
238 comments in clear_solib in solib.c. */
243 xfree (core_data
->sections
);
248 gdb_bfd_unref (core_bfd
);
256 core_close_cleanup (void *ignore
)
262 core_target::close ()
267 /* Look for sections whose names start with `.reg/' so that we can
268 extract the list of threads in a core file. */
271 add_to_thread_list (bfd
*abfd
, asection
*asect
, void *reg_sect_arg
)
276 asection
*reg_sect
= (asection
*) reg_sect_arg
;
278 struct inferior
*inf
;
280 if (!startswith (bfd_section_name (abfd
, asect
), ".reg/"))
283 core_tid
= atoi (bfd_section_name (abfd
, asect
) + 5);
285 pid
= bfd_core_file_pid (core_bfd
);
294 inf
= current_inferior ();
297 inferior_appeared (inf
, pid
);
298 inf
->fake_pid_p
= fake_pid_p
;
301 ptid
= ptid_build (pid
, lwpid
, 0);
305 /* Warning, Will Robinson, looking at BFD private data! */
308 && asect
->filepos
== reg_sect
->filepos
) /* Did we find .reg? */
309 inferior_ptid
= ptid
; /* Yes, make it current. */
315 core_target_open (const char *arg
, int from_tty
)
319 struct cleanup
*old_chain
;
323 target_preopen (from_tty
);
327 error (_("No core file specified. (Use `detach' "
328 "to stop debugging a core file.)"));
330 error (_("No core file specified."));
333 gdb::unique_xmalloc_ptr
<char> filename (tilde_expand (arg
));
334 if (!IS_ABSOLUTE_PATH (filename
.get ()))
335 filename
.reset (concat (current_directory
, "/",
336 filename
.get (), (char *) NULL
));
338 flags
= O_BINARY
| O_LARGEFILE
;
343 scratch_chan
= gdb_open_cloexec (filename
.get (), flags
, 0);
344 if (scratch_chan
< 0)
345 perror_with_name (filename
.get ());
347 gdb_bfd_ref_ptr
temp_bfd (gdb_bfd_fopen (filename
.get (), gnutarget
,
348 write_files
? FOPEN_RUB
: FOPEN_RB
,
350 if (temp_bfd
== NULL
)
351 perror_with_name (filename
.get ());
353 if (!bfd_check_format (temp_bfd
.get (), bfd_core
)
354 && !gdb_check_format (temp_bfd
.get ()))
356 /* Do it after the err msg */
357 /* FIXME: should be checking for errors from bfd_close (for one
358 thing, on error it does not free all the storage associated
360 error (_("\"%s\" is not a core dump: %s"),
361 filename
.get (), bfd_errmsg (bfd_get_error ()));
364 /* Looks semi-reasonable. Toss the old core file and work on the
367 unpush_target (&core_ops
);
368 core_bfd
= temp_bfd
.release ();
369 old_chain
= make_cleanup (core_close_cleanup
, 0 /*ignore*/);
371 core_gdbarch
= gdbarch_from_bfd (core_bfd
);
373 /* Find a suitable core file handler to munch on core_bfd */
374 core_vec
= sniff_core_bfd (core_bfd
);
378 core_data
= XCNEW (struct target_section_table
);
380 /* Find the data section */
381 if (build_section_table (core_bfd
,
382 &core_data
->sections
,
383 &core_data
->sections_end
))
384 error (_("\"%s\": Can't find sections: %s"),
385 bfd_get_filename (core_bfd
), bfd_errmsg (bfd_get_error ()));
387 /* If we have no exec file, try to set the architecture from the
388 core file. We don't do this unconditionally since an exec file
389 typically contains more information that helps us determine the
390 architecture than a core file. */
392 set_gdbarch_from_file (core_bfd
);
394 push_target (&core_ops
);
395 discard_cleanups (old_chain
);
397 /* Do this before acknowledging the inferior, so if
398 post_create_inferior throws (can happen easilly if you're loading
399 a core file with the wrong exec), we aren't left with threads
400 from the previous inferior. */
403 inferior_ptid
= null_ptid
;
405 /* Need to flush the register cache (and the frame cache) from a
406 previous debug session. If inferior_ptid ends up the same as the
407 last debug session --- e.g., b foo; run; gcore core1; step; gcore
408 core2; core core1; core core2 --- then there's potential for
409 get_current_regcache to return the cached regcache of the
410 previous session, and the frame cache being stale. */
411 registers_changed ();
413 /* Build up thread list from BFD sections, and possibly set the
414 current thread to the .reg/NN section matching the .reg
416 bfd_map_over_sections (core_bfd
, add_to_thread_list
,
417 bfd_get_section_by_name (core_bfd
, ".reg"));
419 if (ptid_equal (inferior_ptid
, null_ptid
))
421 /* Either we found no .reg/NN section, and hence we have a
422 non-threaded core (single-threaded, from gdb's perspective),
423 or for some reason add_to_thread_list couldn't determine
424 which was the "main" thread. The latter case shouldn't
425 usually happen, but we're dealing with input here, which can
426 always be broken in different ways. */
427 struct thread_info
*thread
= first_thread_of_process (-1);
431 inferior_appeared (current_inferior (), CORELOW_PID
);
432 inferior_ptid
= pid_to_ptid (CORELOW_PID
);
433 add_thread_silent (inferior_ptid
);
436 switch_to_thread (thread
->ptid
);
439 post_create_inferior (&core_ops
, from_tty
);
441 /* Now go through the target stack looking for threads since there
442 may be a thread_stratum target loaded on top of target core by
443 now. The layer above should claim threads found in the BFD
447 target_update_thread_list ();
450 CATCH (except
, RETURN_MASK_ERROR
)
452 exception_print (gdb_stderr
, except
);
456 p
= bfd_core_file_failing_command (core_bfd
);
458 printf_filtered (_("Core was generated by `%s'.\n"), p
);
460 /* Clearing any previous state of convenience variables. */
461 clear_exit_convenience_vars ();
463 siggy
= bfd_core_file_failing_signal (core_bfd
);
466 /* If we don't have a CORE_GDBARCH to work with, assume a native
467 core (map gdb_signal from host signals). If we do have
468 CORE_GDBARCH to work with, but no gdb_signal_from_target
469 implementation for that gdbarch, as a fallback measure,
470 assume the host signal mapping. It'll be correct for native
471 cores, but most likely incorrect for cross-cores. */
472 enum gdb_signal sig
= (core_gdbarch
!= NULL
473 && gdbarch_gdb_signal_from_target_p (core_gdbarch
)
474 ? gdbarch_gdb_signal_from_target (core_gdbarch
,
476 : gdb_signal_from_host (siggy
));
478 printf_filtered (_("Program terminated with signal %s, %s.\n"),
479 gdb_signal_to_name (sig
), gdb_signal_to_string (sig
));
481 /* Set the value of the internal variable $_exitsignal,
482 which holds the signal uncaught by the inferior. */
483 set_internalvar_integer (lookup_internalvar ("_exitsignal"),
487 /* Fetch all registers from core file. */
488 target_fetch_registers (get_current_regcache (), -1);
490 /* Now, set up the frame cache, and print the top of stack. */
491 reinit_frame_cache ();
492 print_stack_frame (get_selected_frame (NULL
), 1, SRC_AND_LOC
, 1);
494 /* Current thread should be NUM 1 but the user does not know that.
495 If a program is single threaded gdb in general does not mention
496 anything about threads. That is why the test is >= 2. */
497 if (thread_count () >= 2)
501 thread_command (NULL
, from_tty
);
503 CATCH (except
, RETURN_MASK_ERROR
)
505 exception_print (gdb_stderr
, except
);
512 core_target::detach (inferior
*inf
, int from_tty
)
514 unpush_target (this);
515 reinit_frame_cache ();
517 printf_filtered (_("No core file now.\n"));
520 /* Try to retrieve registers from a section in core_bfd, and supply
521 them to core_vec->core_read_registers, as the register set numbered
524 If ptid's lwp member is zero, do the single-threaded
525 thing: look for a section named NAME. If ptid's lwp
526 member is non-zero, do the multi-threaded thing: look for a section
527 named "NAME/LWP", where LWP is the shortest ASCII decimal
528 representation of ptid's lwp member.
530 HUMAN_NAME is a human-readable name for the kind of registers the
531 NAME section contains, for use in error messages.
533 If REQUIRED is non-zero, print an error if the core file doesn't
534 have a section by the appropriate name. Otherwise, just do
538 get_core_register_section (struct regcache
*regcache
,
539 const struct regset
*regset
,
543 const char *human_name
,
546 struct bfd_section
*section
;
549 bool variable_size_section
= (regset
!= NULL
550 && regset
->flags
& REGSET_VARIABLE_SIZE
);
552 thread_section_name
section_name (name
, regcache
->ptid ());
554 section
= bfd_get_section_by_name (core_bfd
, section_name
.c_str ());
558 warning (_("Couldn't find %s registers in core file."),
563 size
= bfd_section_size (core_bfd
, section
);
566 warning (_("Section `%s' in core file too small."),
567 section_name
.c_str ());
570 if (size
!= min_size
&& !variable_size_section
)
572 warning (_("Unexpected size of section `%s' in core file."),
573 section_name
.c_str ());
576 contents
= (char *) alloca (size
);
577 if (! bfd_get_section_contents (core_bfd
, section
, contents
,
580 warning (_("Couldn't read %s registers from `%s' section in core file."),
581 human_name
, section_name
.c_str ());
587 regset
->supply_regset (regset
, regcache
, -1, contents
, size
);
591 gdb_assert (core_vec
);
592 core_vec
->core_read_registers (regcache
, contents
, size
, which
,
594 bfd_section_vma (core_bfd
, section
)));
597 /* Callback for get_core_registers that handles a single core file
598 register note section. */
601 get_core_registers_cb (const char *sect_name
, int size
,
602 const struct regset
*regset
,
603 const char *human_name
, void *cb_data
)
605 struct regcache
*regcache
= (struct regcache
*) cb_data
;
608 if (strcmp (sect_name
, ".reg") == 0)
611 if (human_name
== NULL
)
612 human_name
= "general-purpose";
614 else if (strcmp (sect_name
, ".reg2") == 0)
616 if (human_name
== NULL
)
617 human_name
= "floating-point";
620 /* The 'which' parameter is only used when no regset is provided.
621 Thus we just set it to -1. */
622 get_core_register_section (regcache
, regset
, sect_name
,
623 size
, -1, human_name
, required
);
626 /* Get the registers out of a core file. This is the machine-
627 independent part. Fetch_core_registers is the machine-dependent
628 part, typically implemented in the xm-file for each
631 /* We just get all the registers, so we don't use regno. */
634 core_target::fetch_registers (struct regcache
*regcache
, int regno
)
637 struct gdbarch
*gdbarch
;
639 if (!(core_gdbarch
&& gdbarch_iterate_over_regset_sections_p (core_gdbarch
))
640 && (core_vec
== NULL
|| core_vec
->core_read_registers
== NULL
))
642 fprintf_filtered (gdb_stderr
,
643 "Can't fetch registers from this type of core file\n");
647 gdbarch
= regcache
->arch ();
648 if (gdbarch_iterate_over_regset_sections_p (gdbarch
))
649 gdbarch_iterate_over_regset_sections (gdbarch
,
650 get_core_registers_cb
,
651 (void *) regcache
, NULL
);
654 get_core_register_section (regcache
, NULL
,
655 ".reg", 0, 0, "general-purpose", 1);
656 get_core_register_section (regcache
, NULL
,
657 ".reg2", 0, 2, "floating-point", 0);
660 /* Mark all registers not found in the core as unavailable. */
661 for (i
= 0; i
< gdbarch_num_regs (regcache
->arch ()); i
++)
662 if (regcache_register_status (regcache
, i
) == REG_UNKNOWN
)
663 regcache_raw_supply (regcache
, i
, NULL
);
667 core_target::files_info ()
669 print_section_info (core_data
, core_bfd
);
682 add_to_spuid_list (bfd
*abfd
, asection
*asect
, void *list_p
)
684 struct spuid_list
*list
= (struct spuid_list
*) list_p
;
685 enum bfd_endian byte_order
686 = bfd_big_endian (abfd
) ? BFD_ENDIAN_BIG
: BFD_ENDIAN_LITTLE
;
689 sscanf (bfd_section_name (abfd
, asect
), "SPU/%d/regs%n", &fd
, &pos
);
693 if (list
->pos
>= list
->offset
&& list
->pos
+ 4 <= list
->offset
+ list
->len
)
695 store_unsigned_integer (list
->buf
+ list
->pos
- list
->offset
,
702 enum target_xfer_status
703 core_target::xfer_partial (enum target_object object
, const char *annex
,
704 gdb_byte
*readbuf
, const gdb_byte
*writebuf
,
705 ULONGEST offset
, ULONGEST len
, ULONGEST
*xfered_len
)
709 case TARGET_OBJECT_MEMORY
:
710 return section_table_xfer_memory_partial (readbuf
, writebuf
,
711 offset
, len
, xfered_len
,
713 core_data
->sections_end
,
716 case TARGET_OBJECT_AUXV
:
719 /* When the aux vector is stored in core file, BFD
720 represents this with a fake section called ".auxv". */
722 struct bfd_section
*section
;
725 section
= bfd_get_section_by_name (core_bfd
, ".auxv");
727 return TARGET_XFER_E_IO
;
729 size
= bfd_section_size (core_bfd
, section
);
731 return TARGET_XFER_EOF
;
737 return TARGET_XFER_EOF
;
738 if (!bfd_get_section_contents (core_bfd
, section
, readbuf
,
739 (file_ptr
) offset
, size
))
741 warning (_("Couldn't read NT_AUXV note in core file."));
742 return TARGET_XFER_E_IO
;
745 *xfered_len
= (ULONGEST
) size
;
746 return TARGET_XFER_OK
;
748 return TARGET_XFER_E_IO
;
750 case TARGET_OBJECT_WCOOKIE
:
753 /* When the StackGhost cookie is stored in core file, BFD
754 represents this with a fake section called
757 struct bfd_section
*section
;
760 section
= bfd_get_section_by_name (core_bfd
, ".wcookie");
762 return TARGET_XFER_E_IO
;
764 size
= bfd_section_size (core_bfd
, section
);
766 return TARGET_XFER_EOF
;
772 return TARGET_XFER_EOF
;
773 if (!bfd_get_section_contents (core_bfd
, section
, readbuf
,
774 (file_ptr
) offset
, size
))
776 warning (_("Couldn't read StackGhost cookie in core file."));
777 return TARGET_XFER_E_IO
;
780 *xfered_len
= (ULONGEST
) size
;
781 return TARGET_XFER_OK
;
784 return TARGET_XFER_E_IO
;
786 case TARGET_OBJECT_LIBRARIES
:
788 && gdbarch_core_xfer_shared_libraries_p (core_gdbarch
))
791 return TARGET_XFER_E_IO
;
794 *xfered_len
= gdbarch_core_xfer_shared_libraries (core_gdbarch
,
798 if (*xfered_len
== 0)
799 return TARGET_XFER_EOF
;
801 return TARGET_XFER_OK
;
806 case TARGET_OBJECT_LIBRARIES_AIX
:
808 && gdbarch_core_xfer_shared_libraries_aix_p (core_gdbarch
))
811 return TARGET_XFER_E_IO
;
815 = gdbarch_core_xfer_shared_libraries_aix (core_gdbarch
,
819 if (*xfered_len
== 0)
820 return TARGET_XFER_EOF
;
822 return TARGET_XFER_OK
;
827 case TARGET_OBJECT_SPU
:
828 if (readbuf
&& annex
)
830 /* When the SPU contexts are stored in a core file, BFD
831 represents this with a fake section called
834 struct bfd_section
*section
;
836 char sectionstr
[100];
838 xsnprintf (sectionstr
, sizeof sectionstr
, "SPU/%s", annex
);
840 section
= bfd_get_section_by_name (core_bfd
, sectionstr
);
842 return TARGET_XFER_E_IO
;
844 size
= bfd_section_size (core_bfd
, section
);
846 return TARGET_XFER_EOF
;
852 return TARGET_XFER_EOF
;
853 if (!bfd_get_section_contents (core_bfd
, section
, readbuf
,
854 (file_ptr
) offset
, size
))
856 warning (_("Couldn't read SPU section in core file."));
857 return TARGET_XFER_E_IO
;
860 *xfered_len
= (ULONGEST
) size
;
861 return TARGET_XFER_OK
;
865 /* NULL annex requests list of all present spuids. */
866 struct spuid_list list
;
869 list
.offset
= offset
;
873 bfd_map_over_sections (core_bfd
, add_to_spuid_list
, &list
);
875 if (list
.written
== 0)
876 return TARGET_XFER_EOF
;
879 *xfered_len
= (ULONGEST
) list
.written
;
880 return TARGET_XFER_OK
;
883 return TARGET_XFER_E_IO
;
885 case TARGET_OBJECT_SIGNAL_INFO
:
889 && gdbarch_core_xfer_siginfo_p (core_gdbarch
))
891 LONGEST l
= gdbarch_core_xfer_siginfo (core_gdbarch
, readbuf
,
898 return TARGET_XFER_EOF
;
900 return TARGET_XFER_OK
;
904 return TARGET_XFER_E_IO
;
907 return this->beneath
->xfer_partial (object
, annex
, readbuf
,
908 writebuf
, offset
, len
,
915 /* Okay, let's be honest: threads gleaned from a core file aren't
916 exactly lively, are they? On the other hand, if we don't claim
917 that each & every one is alive, then we don't get any of them
918 to appear in an "info thread" command, which is quite a useful
922 core_target::thread_alive (ptid_t ptid
)
927 /* Ask the current architecture what it knows about this core file.
928 That will be used, in turn, to pick a better architecture. This
929 wrapper could be avoided if targets got a chance to specialize
932 const struct target_desc
*
933 core_target::read_description ()
935 if (core_gdbarch
&& gdbarch_core_read_description_p (core_gdbarch
))
937 const struct target_desc
*result
;
939 result
= gdbarch_core_read_description (core_gdbarch
, this, core_bfd
);
944 return this->beneath
->read_description ();
948 core_target::pid_to_str (ptid_t ptid
)
951 struct inferior
*inf
;
954 /* The preferred way is to have a gdbarch/OS specific
957 && gdbarch_core_pid_to_str_p (core_gdbarch
))
958 return gdbarch_core_pid_to_str (core_gdbarch
, ptid
);
960 /* Otherwise, if we don't have one, we'll just fallback to
961 "process", with normal_pid_to_str. */
963 /* Try the LWPID field first. */
964 pid
= ptid_get_lwp (ptid
);
966 return normal_pid_to_str (pid_to_ptid (pid
));
968 /* Otherwise, this isn't a "threaded" core -- use the PID field, but
969 only if it isn't a fake PID. */
970 inf
= find_inferior_ptid (ptid
);
971 if (inf
!= NULL
&& !inf
->fake_pid_p
)
972 return normal_pid_to_str (ptid
);
974 /* No luck. We simply don't have a valid PID to print. */
975 xsnprintf (buf
, sizeof buf
, "<main task>");
980 core_target::thread_name (struct thread_info
*thr
)
983 && gdbarch_core_thread_name_p (core_gdbarch
))
984 return gdbarch_core_thread_name (core_gdbarch
, thr
);
989 core_target::has_memory ()
991 return (core_bfd
!= NULL
);
995 core_target::has_stack ()
997 return (core_bfd
!= NULL
);
1001 core_target::has_registers ()
1003 return (core_bfd
!= NULL
);
1006 /* Implement the to_info_proc method. */
1009 core_target::info_proc (const char *args
, enum info_proc_what request
)
1011 struct gdbarch
*gdbarch
= get_current_arch ();
1013 /* Since this is the core file target, call the 'core_info_proc'
1014 method on gdbarch, not 'info_proc'. */
1015 if (gdbarch_core_info_proc_p (gdbarch
))
1016 gdbarch_core_info_proc (gdbarch
, args
, request
);
1022 _initialize_corelow (void)
1024 if (the_core_target
!= NULL
)
1025 internal_error (__FILE__
, __LINE__
,
1026 _("core target already exists (\"%s\")."),
1027 the_core_target
->longname ());
1028 the_core_target
= &core_ops
;
1030 add_target (core_target_info
, core_target_open
, filename_completer
);