1 /* Core dump and executable file functions below target vector, for GDB.
3 Copyright (C) 1986-2019 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 #include "frame.h" /* required by inferior.h */
31 #include "process-stratum-target.h"
33 #include "gdbthread.h"
38 #include "readline/readline.h"
40 #include "filenames.h"
41 #include "progspace.h"
44 #include "completer.h"
45 #include "gdbsupport/filestuff.h"
51 static core_fns *sniff_core_bfd (gdbarch *core_gdbarch,
54 /* The core file target. */
56 static const target_info core_target_info = {
58 N_("Local core dump file"),
59 N_("Use a core file as a target.\n\
60 Specify the filename of the core file.")
63 class core_target final : public process_stratum_target
67 ~core_target () override;
69 const target_info &info () const override
70 { return core_target_info; }
72 void close () override;
73 void detach (inferior *, int) override;
74 void fetch_registers (struct regcache *, int) override;
76 enum target_xfer_status xfer_partial (enum target_object object,
79 const gdb_byte *writebuf,
80 ULONGEST offset, ULONGEST len,
81 ULONGEST *xfered_len) override;
82 void files_info () override;
84 bool thread_alive (ptid_t ptid) override;
85 const struct target_desc *read_description () override;
87 std::string pid_to_str (ptid_t) override;
89 const char *thread_name (struct thread_info *) override;
91 bool has_all_memory () override { return false; }
92 bool has_memory () override;
93 bool has_stack () override;
94 bool has_registers () override;
95 bool has_execution (ptid_t) override { return false; }
97 bool info_proc (const char *, enum info_proc_what) override;
101 /* Getter, see variable definition. */
102 struct gdbarch *core_gdbarch ()
104 return m_core_gdbarch;
107 /* See definition. */
108 void get_core_register_section (struct regcache *regcache,
109 const struct regset *regset,
111 int section_min_size,
113 const char *human_name,
116 private: /* per-core data */
118 /* The core's section table. Note that these target sections are
119 *not* mapped in the current address spaces' set of target
120 sections --- those should come only from pure executable or
121 shared library bfds. The core bfd sections are an implementation
122 detail of the core target, just like ptrace is for unix child
124 target_section_table m_core_section_table {};
126 /* The core_fns for a core file handler that is prepared to read the
127 core file currently open on core_bfd. */
128 core_fns *m_core_vec = NULL;
130 /* FIXME: kettenis/20031023: Eventually this field should
132 struct gdbarch *m_core_gdbarch = NULL;
135 core_target::core_target ()
137 m_core_gdbarch = gdbarch_from_bfd (core_bfd);
139 /* Find a suitable core file handler to munch on core_bfd */
140 m_core_vec = sniff_core_bfd (m_core_gdbarch, core_bfd);
142 /* Find the data section */
143 if (build_section_table (core_bfd,
144 &m_core_section_table.sections,
145 &m_core_section_table.sections_end))
146 error (_("\"%s\": Can't find sections: %s"),
147 bfd_get_filename (core_bfd), bfd_errmsg (bfd_get_error ()));
150 core_target::~core_target ()
152 xfree (m_core_section_table.sections);
155 /* List of all available core_fns. On gdb startup, each core file
156 register reader calls deprecated_add_core_fns() to register
157 information on each core format it is prepared to read. */
159 static struct core_fns *core_file_fns = NULL;
161 static int gdb_check_format (bfd *);
163 static void add_to_thread_list (bfd *, asection *, void *);
165 /* An arbitrary identifier for the core inferior. */
166 #define CORELOW_PID 1
168 /* Link a new core_fns into the global core_file_fns list. Called on
169 gdb startup by the _initialize routine in each core file register
170 reader, to register information about each format the reader is
171 prepared to handle. */
174 deprecated_add_core_fns (struct core_fns *cf)
176 cf->next = core_file_fns;
180 /* The default function that core file handlers can use to examine a
181 core file BFD and decide whether or not to accept the job of
182 reading the core file. */
185 default_core_sniffer (struct core_fns *our_fns, bfd *abfd)
189 result = (bfd_get_flavour (abfd) == our_fns -> core_flavour);
193 /* Walk through the list of core functions to find a set that can
194 handle the core file open on ABFD. Returns pointer to set that is
197 static struct core_fns *
198 sniff_core_bfd (struct gdbarch *core_gdbarch, bfd *abfd)
201 struct core_fns *yummy = NULL;
204 /* Don't sniff if we have support for register sets in
206 if (core_gdbarch && gdbarch_iterate_over_regset_sections_p (core_gdbarch))
209 for (cf = core_file_fns; cf != NULL; cf = cf->next)
211 if (cf->core_sniffer (cf, abfd))
219 warning (_("\"%s\": ambiguous core format, %d handlers match"),
220 bfd_get_filename (abfd), matches);
222 else if (matches == 0)
223 error (_("\"%s\": no core file handler recognizes format"),
224 bfd_get_filename (abfd));
229 /* The default is to reject every core file format we see. Either
230 BFD has to recognize it, or we have to provide a function in the
231 core file handler that recognizes it. */
234 default_check_format (bfd *abfd)
239 /* Attempt to recognize core file formats that BFD rejects. */
242 gdb_check_format (bfd *abfd)
246 for (cf = core_file_fns; cf != NULL; cf = cf->next)
248 if (cf->check_format (abfd))
256 /* Close the core target. */
259 core_target::close ()
263 inferior_ptid = null_ptid; /* Avoid confusion from thread
265 exit_inferior_silent (current_inferior ());
267 /* Clear out solib state while the bfd is still open. See
268 comments in clear_solib in solib.c. */
271 current_program_space->cbfd.reset (nullptr);
274 /* Core targets are heap-allocated (see core_target_open), so here
275 we delete ourselves. */
279 /* Look for sections whose names start with `.reg/' so that we can
280 extract the list of threads in a core file. */
283 add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
288 asection *reg_sect = (asection *) reg_sect_arg;
289 bool fake_pid_p = false;
290 struct inferior *inf;
292 if (!startswith (bfd_section_name (abfd, asect), ".reg/"))
295 core_tid = atoi (bfd_section_name (abfd, asect) + 5);
297 pid = bfd_core_file_pid (core_bfd);
306 inf = current_inferior ();
309 inferior_appeared (inf, pid);
310 inf->fake_pid_p = fake_pid_p;
313 ptid = ptid_t (pid, lwpid, 0);
317 /* Warning, Will Robinson, looking at BFD private data! */
320 && asect->filepos == reg_sect->filepos) /* Did we find .reg? */
321 inferior_ptid = ptid; /* Yes, make it current. */
324 /* Issue a message saying we have no core to debug, if FROM_TTY. */
327 maybe_say_no_core_file_now (int from_tty)
330 printf_filtered (_("No core file now.\n"));
333 /* Backward compatability with old way of specifying core files. */
336 core_file_command (const char *filename, int from_tty)
338 dont_repeat (); /* Either way, seems bogus. */
340 if (filename == NULL)
342 if (core_bfd != NULL)
344 target_detach (current_inferior (), from_tty);
345 gdb_assert (core_bfd == NULL);
348 maybe_say_no_core_file_now (from_tty);
351 core_target_open (filename, from_tty);
357 core_target_open (const char *arg, int from_tty)
364 target_preopen (from_tty);
368 error (_("No core file specified. (Use `detach' "
369 "to stop debugging a core file.)"));
371 error (_("No core file specified."));
374 gdb::unique_xmalloc_ptr<char> filename (tilde_expand (arg));
375 if (!IS_ABSOLUTE_PATH (filename.get ()))
376 filename.reset (concat (current_directory, "/",
377 filename.get (), (char *) NULL));
379 flags = O_BINARY | O_LARGEFILE;
384 scratch_chan = gdb_open_cloexec (filename.get (), flags, 0);
385 if (scratch_chan < 0)
386 perror_with_name (filename.get ());
388 gdb_bfd_ref_ptr temp_bfd (gdb_bfd_fopen (filename.get (), gnutarget,
389 write_files ? FOPEN_RUB : FOPEN_RB,
391 if (temp_bfd == NULL)
392 perror_with_name (filename.get ());
394 if (!bfd_check_format (temp_bfd.get (), bfd_core)
395 && !gdb_check_format (temp_bfd.get ()))
397 /* Do it after the err msg */
398 /* FIXME: should be checking for errors from bfd_close (for one
399 thing, on error it does not free all the storage associated
401 error (_("\"%s\" is not a core dump: %s"),
402 filename.get (), bfd_errmsg (bfd_get_error ()));
405 current_program_space->cbfd = std::move (temp_bfd);
407 core_target *target = new core_target ();
409 /* Own the target until it is successfully pushed. */
410 target_ops_up target_holder (target);
414 /* If we have no exec file, try to set the architecture from the
415 core file. We don't do this unconditionally since an exec file
416 typically contains more information that helps us determine the
417 architecture than a core file. */
419 set_gdbarch_from_file (core_bfd);
421 push_target (std::move (target_holder));
423 inferior_ptid = null_ptid;
425 /* Need to flush the register cache (and the frame cache) from a
426 previous debug session. If inferior_ptid ends up the same as the
427 last debug session --- e.g., b foo; run; gcore core1; step; gcore
428 core2; core core1; core core2 --- then there's potential for
429 get_current_regcache to return the cached regcache of the
430 previous session, and the frame cache being stale. */
431 registers_changed ();
433 /* Build up thread list from BFD sections, and possibly set the
434 current thread to the .reg/NN section matching the .reg
436 bfd_map_over_sections (core_bfd, add_to_thread_list,
437 bfd_get_section_by_name (core_bfd, ".reg"));
439 if (inferior_ptid == null_ptid)
441 /* Either we found no .reg/NN section, and hence we have a
442 non-threaded core (single-threaded, from gdb's perspective),
443 or for some reason add_to_thread_list couldn't determine
444 which was the "main" thread. The latter case shouldn't
445 usually happen, but we're dealing with input here, which can
446 always be broken in different ways. */
447 thread_info *thread = first_thread_of_inferior (current_inferior ());
451 inferior_appeared (current_inferior (), CORELOW_PID);
452 inferior_ptid = ptid_t (CORELOW_PID);
453 add_thread_silent (inferior_ptid);
456 switch_to_thread (thread);
459 post_create_inferior (target, from_tty);
461 /* Now go through the target stack looking for threads since there
462 may be a thread_stratum target loaded on top of target core by
463 now. The layer above should claim threads found in the BFD
467 target_update_thread_list ();
470 catch (const gdb_exception_error &except)
472 exception_print (gdb_stderr, except);
475 p = bfd_core_file_failing_command (core_bfd);
477 printf_filtered (_("Core was generated by `%s'.\n"), p);
479 /* Clearing any previous state of convenience variables. */
480 clear_exit_convenience_vars ();
482 siggy = bfd_core_file_failing_signal (core_bfd);
485 gdbarch *core_gdbarch = target->core_gdbarch ();
487 /* If we don't have a CORE_GDBARCH to work with, assume a native
488 core (map gdb_signal from host signals). If we do have
489 CORE_GDBARCH to work with, but no gdb_signal_from_target
490 implementation for that gdbarch, as a fallback measure,
491 assume the host signal mapping. It'll be correct for native
492 cores, but most likely incorrect for cross-cores. */
493 enum gdb_signal sig = (core_gdbarch != NULL
494 && gdbarch_gdb_signal_from_target_p (core_gdbarch)
495 ? gdbarch_gdb_signal_from_target (core_gdbarch,
497 : gdb_signal_from_host (siggy));
499 printf_filtered (_("Program terminated with signal %s, %s.\n"),
500 gdb_signal_to_name (sig), gdb_signal_to_string (sig));
502 /* Set the value of the internal variable $_exitsignal,
503 which holds the signal uncaught by the inferior. */
504 set_internalvar_integer (lookup_internalvar ("_exitsignal"),
508 /* Fetch all registers from core file. */
509 target_fetch_registers (get_current_regcache (), -1);
511 /* Now, set up the frame cache, and print the top of stack. */
512 reinit_frame_cache ();
513 print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
515 /* Current thread should be NUM 1 but the user does not know that.
516 If a program is single threaded gdb in general does not mention
517 anything about threads. That is why the test is >= 2. */
518 if (thread_count () >= 2)
522 thread_command (NULL, from_tty);
524 catch (const gdb_exception_error &except)
526 exception_print (gdb_stderr, except);
532 core_target::detach (inferior *inf, int from_tty)
534 /* Note that 'this' is dangling after this call. unpush_target
535 closes the target, and our close implementation deletes
537 unpush_target (this);
539 /* Clear the register cache and the frame cache. */
540 registers_changed ();
541 reinit_frame_cache ();
542 maybe_say_no_core_file_now (from_tty);
545 /* Try to retrieve registers from a section in core_bfd, and supply
546 them to m_core_vec->core_read_registers, as the register set
549 If ptid's lwp member is zero, do the single-threaded
550 thing: look for a section named NAME. If ptid's lwp
551 member is non-zero, do the multi-threaded thing: look for a section
552 named "NAME/LWP", where LWP is the shortest ASCII decimal
553 representation of ptid's lwp member.
555 HUMAN_NAME is a human-readable name for the kind of registers the
556 NAME section contains, for use in error messages.
558 If REQUIRED is true, print an error if the core file doesn't have a
559 section by the appropriate name. Otherwise, just do nothing. */
562 core_target::get_core_register_section (struct regcache *regcache,
563 const struct regset *regset,
565 int section_min_size,
567 const char *human_name,
570 struct bfd_section *section;
573 bool variable_size_section = (regset != NULL
574 && regset->flags & REGSET_VARIABLE_SIZE);
576 thread_section_name section_name (name, regcache->ptid ());
578 section = bfd_get_section_by_name (core_bfd, section_name.c_str ());
582 warning (_("Couldn't find %s registers in core file."),
587 size = bfd_section_size (core_bfd, section);
588 if (size < section_min_size)
590 warning (_("Section `%s' in core file too small."),
591 section_name.c_str ());
594 if (size != section_min_size && !variable_size_section)
596 warning (_("Unexpected size of section `%s' in core file."),
597 section_name.c_str ());
600 contents = (char *) alloca (size);
601 if (! bfd_get_section_contents (core_bfd, section, contents,
604 warning (_("Couldn't read %s registers from `%s' section in core file."),
605 human_name, section_name.c_str ());
611 regset->supply_regset (regset, regcache, -1, contents, size);
615 gdb_assert (m_core_vec != nullptr);
616 m_core_vec->core_read_registers (regcache, contents, size, which,
618 bfd_section_vma (core_bfd, section)));
621 /* Data passed to gdbarch_iterate_over_regset_sections's callback. */
622 struct get_core_registers_cb_data
625 struct regcache *regcache;
628 /* Callback for get_core_registers that handles a single core file
629 register note section. */
632 get_core_registers_cb (const char *sect_name, int supply_size, int collect_size,
633 const struct regset *regset,
634 const char *human_name, void *cb_data)
636 auto *data = (get_core_registers_cb_data *) cb_data;
637 bool required = false;
638 bool variable_size_section = (regset != NULL
639 && regset->flags & REGSET_VARIABLE_SIZE);
641 if (!variable_size_section)
642 gdb_assert (supply_size == collect_size);
644 if (strcmp (sect_name, ".reg") == 0)
647 if (human_name == NULL)
648 human_name = "general-purpose";
650 else if (strcmp (sect_name, ".reg2") == 0)
652 if (human_name == NULL)
653 human_name = "floating-point";
656 /* The 'which' parameter is only used when no regset is provided.
657 Thus we just set it to -1. */
658 data->target->get_core_register_section (data->regcache, regset, sect_name,
659 supply_size, -1, human_name,
663 /* Get the registers out of a core file. This is the machine-
664 independent part. Fetch_core_registers is the machine-dependent
665 part, typically implemented in the xm-file for each
668 /* We just get all the registers, so we don't use regno. */
671 core_target::fetch_registers (struct regcache *regcache, int regno)
674 struct gdbarch *gdbarch;
676 if (!(m_core_gdbarch != nullptr
677 && gdbarch_iterate_over_regset_sections_p (m_core_gdbarch))
678 && (m_core_vec == NULL || m_core_vec->core_read_registers == NULL))
680 fprintf_filtered (gdb_stderr,
681 "Can't fetch registers from this type of core file\n");
685 gdbarch = regcache->arch ();
686 if (gdbarch_iterate_over_regset_sections_p (gdbarch))
688 get_core_registers_cb_data data = { this, regcache };
689 gdbarch_iterate_over_regset_sections (gdbarch,
690 get_core_registers_cb,
691 (void *) &data, NULL);
695 get_core_register_section (regcache, NULL,
696 ".reg", 0, 0, "general-purpose", 1);
697 get_core_register_section (regcache, NULL,
698 ".reg2", 0, 2, "floating-point", 0);
701 /* Mark all registers not found in the core as unavailable. */
702 for (i = 0; i < gdbarch_num_regs (regcache->arch ()); i++)
703 if (regcache->get_register_status (i) == REG_UNKNOWN)
704 regcache->raw_supply (i, NULL);
708 core_target::files_info ()
710 print_section_info (&m_core_section_table, core_bfd);
723 add_to_spuid_list (bfd *abfd, asection *asect, void *list_p)
725 struct spuid_list *list = (struct spuid_list *) list_p;
726 enum bfd_endian byte_order
727 = bfd_big_endian (abfd) ? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
730 sscanf (bfd_section_name (abfd, asect), "SPU/%d/regs%n", &fd, &pos);
734 if (list->pos >= list->offset && list->pos + 4 <= list->offset + list->len)
736 store_unsigned_integer (list->buf + list->pos - list->offset,
743 enum target_xfer_status
744 core_target::xfer_partial (enum target_object object, const char *annex,
745 gdb_byte *readbuf, const gdb_byte *writebuf,
746 ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
750 case TARGET_OBJECT_MEMORY:
751 return (section_table_xfer_memory_partial
753 offset, len, xfered_len,
754 m_core_section_table.sections,
755 m_core_section_table.sections_end,
758 case TARGET_OBJECT_AUXV:
761 /* When the aux vector is stored in core file, BFD
762 represents this with a fake section called ".auxv". */
764 struct bfd_section *section;
767 section = bfd_get_section_by_name (core_bfd, ".auxv");
769 return TARGET_XFER_E_IO;
771 size = bfd_section_size (core_bfd, section);
773 return TARGET_XFER_EOF;
779 return TARGET_XFER_EOF;
780 if (!bfd_get_section_contents (core_bfd, section, readbuf,
781 (file_ptr) offset, size))
783 warning (_("Couldn't read NT_AUXV note in core file."));
784 return TARGET_XFER_E_IO;
787 *xfered_len = (ULONGEST) size;
788 return TARGET_XFER_OK;
790 return TARGET_XFER_E_IO;
792 case TARGET_OBJECT_WCOOKIE:
795 /* When the StackGhost cookie is stored in core file, BFD
796 represents this with a fake section called
799 struct bfd_section *section;
802 section = bfd_get_section_by_name (core_bfd, ".wcookie");
804 return TARGET_XFER_E_IO;
806 size = bfd_section_size (core_bfd, section);
808 return TARGET_XFER_EOF;
814 return TARGET_XFER_EOF;
815 if (!bfd_get_section_contents (core_bfd, section, readbuf,
816 (file_ptr) offset, size))
818 warning (_("Couldn't read StackGhost cookie in core file."));
819 return TARGET_XFER_E_IO;
822 *xfered_len = (ULONGEST) size;
823 return TARGET_XFER_OK;
826 return TARGET_XFER_E_IO;
828 case TARGET_OBJECT_LIBRARIES:
829 if (m_core_gdbarch != nullptr
830 && gdbarch_core_xfer_shared_libraries_p (m_core_gdbarch))
833 return TARGET_XFER_E_IO;
836 *xfered_len = gdbarch_core_xfer_shared_libraries (m_core_gdbarch,
840 if (*xfered_len == 0)
841 return TARGET_XFER_EOF;
843 return TARGET_XFER_OK;
848 case TARGET_OBJECT_LIBRARIES_AIX:
849 if (m_core_gdbarch != nullptr
850 && gdbarch_core_xfer_shared_libraries_aix_p (m_core_gdbarch))
853 return TARGET_XFER_E_IO;
857 = gdbarch_core_xfer_shared_libraries_aix (m_core_gdbarch,
861 if (*xfered_len == 0)
862 return TARGET_XFER_EOF;
864 return TARGET_XFER_OK;
869 case TARGET_OBJECT_SPU:
870 if (readbuf && annex)
872 /* When the SPU contexts are stored in a core file, BFD
873 represents this with a fake section called
876 struct bfd_section *section;
878 char sectionstr[100];
880 xsnprintf (sectionstr, sizeof sectionstr, "SPU/%s", annex);
882 section = bfd_get_section_by_name (core_bfd, sectionstr);
884 return TARGET_XFER_E_IO;
886 size = bfd_section_size (core_bfd, section);
888 return TARGET_XFER_EOF;
894 return TARGET_XFER_EOF;
895 if (!bfd_get_section_contents (core_bfd, section, readbuf,
896 (file_ptr) offset, size))
898 warning (_("Couldn't read SPU section in core file."));
899 return TARGET_XFER_E_IO;
902 *xfered_len = (ULONGEST) size;
903 return TARGET_XFER_OK;
907 /* NULL annex requests list of all present spuids. */
908 struct spuid_list list;
911 list.offset = offset;
915 bfd_map_over_sections (core_bfd, add_to_spuid_list, &list);
917 if (list.written == 0)
918 return TARGET_XFER_EOF;
921 *xfered_len = (ULONGEST) list.written;
922 return TARGET_XFER_OK;
925 return TARGET_XFER_E_IO;
927 case TARGET_OBJECT_SIGNAL_INFO:
930 if (m_core_gdbarch != nullptr
931 && gdbarch_core_xfer_siginfo_p (m_core_gdbarch))
933 LONGEST l = gdbarch_core_xfer_siginfo (m_core_gdbarch, readbuf,
940 return TARGET_XFER_EOF;
942 return TARGET_XFER_OK;
946 return TARGET_XFER_E_IO;
949 return this->beneath ()->xfer_partial (object, annex, readbuf,
950 writebuf, offset, len,
957 /* Okay, let's be honest: threads gleaned from a core file aren't
958 exactly lively, are they? On the other hand, if we don't claim
959 that each & every one is alive, then we don't get any of them
960 to appear in an "info thread" command, which is quite a useful
964 core_target::thread_alive (ptid_t ptid)
969 /* Ask the current architecture what it knows about this core file.
970 That will be used, in turn, to pick a better architecture. This
971 wrapper could be avoided if targets got a chance to specialize
974 const struct target_desc *
975 core_target::read_description ()
977 if (m_core_gdbarch && gdbarch_core_read_description_p (m_core_gdbarch))
979 const struct target_desc *result;
981 result = gdbarch_core_read_description (m_core_gdbarch, this, core_bfd);
986 return this->beneath ()->read_description ();
990 core_target::pid_to_str (ptid_t ptid)
992 struct inferior *inf;
995 /* The preferred way is to have a gdbarch/OS specific
997 if (m_core_gdbarch != nullptr
998 && gdbarch_core_pid_to_str_p (m_core_gdbarch))
999 return gdbarch_core_pid_to_str (m_core_gdbarch, ptid);
1001 /* Otherwise, if we don't have one, we'll just fallback to
1002 "process", with normal_pid_to_str. */
1004 /* Try the LWPID field first. */
1007 return normal_pid_to_str (ptid_t (pid));
1009 /* Otherwise, this isn't a "threaded" core -- use the PID field, but
1010 only if it isn't a fake PID. */
1011 inf = find_inferior_ptid (ptid);
1012 if (inf != NULL && !inf->fake_pid_p)
1013 return normal_pid_to_str (ptid);
1015 /* No luck. We simply don't have a valid PID to print. */
1016 return "<main task>";
1020 core_target::thread_name (struct thread_info *thr)
1022 if (m_core_gdbarch != nullptr
1023 && gdbarch_core_thread_name_p (m_core_gdbarch))
1024 return gdbarch_core_thread_name (m_core_gdbarch, thr);
1029 core_target::has_memory ()
1031 return (core_bfd != NULL);
1035 core_target::has_stack ()
1037 return (core_bfd != NULL);
1041 core_target::has_registers ()
1043 return (core_bfd != NULL);
1046 /* Implement the to_info_proc method. */
1049 core_target::info_proc (const char *args, enum info_proc_what request)
1051 struct gdbarch *gdbarch = get_current_arch ();
1053 /* Since this is the core file target, call the 'core_info_proc'
1054 method on gdbarch, not 'info_proc'. */
1055 if (gdbarch_core_info_proc_p (gdbarch))
1056 gdbarch_core_info_proc (gdbarch, args, request);
1062 _initialize_corelow (void)
1064 add_target (core_target_info, core_target_open, filename_completer);