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. Specify the filename of the core file.")
62 class core_target final : public process_stratum_target
66 ~core_target () override;
68 const target_info &info () const override
69 { return core_target_info; }
71 void close () override;
72 void detach (inferior *, int) override;
73 void fetch_registers (struct regcache *, int) override;
75 enum target_xfer_status xfer_partial (enum target_object object,
78 const gdb_byte *writebuf,
79 ULONGEST offset, ULONGEST len,
80 ULONGEST *xfered_len) override;
81 void files_info () override;
83 bool thread_alive (ptid_t ptid) override;
84 const struct target_desc *read_description () override;
86 std::string pid_to_str (ptid_t) override;
88 const char *thread_name (struct thread_info *) override;
90 bool has_all_memory () override { return false; }
91 bool has_memory () override;
92 bool has_stack () override;
93 bool has_registers () override;
94 bool has_execution (ptid_t) override { return false; }
96 bool info_proc (const char *, enum info_proc_what) override;
100 /* Getter, see variable definition. */
101 struct gdbarch *core_gdbarch ()
103 return m_core_gdbarch;
106 /* See definition. */
107 void get_core_register_section (struct regcache *regcache,
108 const struct regset *regset,
110 int section_min_size,
112 const char *human_name,
115 private: /* per-core data */
117 /* The core's section table. Note that these target sections are
118 *not* mapped in the current address spaces' set of target
119 sections --- those should come only from pure executable or
120 shared library bfds. The core bfd sections are an implementation
121 detail of the core target, just like ptrace is for unix child
123 target_section_table m_core_section_table {};
125 /* The core_fns for a core file handler that is prepared to read the
126 core file currently open on core_bfd. */
127 core_fns *m_core_vec = NULL;
129 /* FIXME: kettenis/20031023: Eventually this field should
131 struct gdbarch *m_core_gdbarch = NULL;
134 core_target::core_target ()
136 m_core_gdbarch = gdbarch_from_bfd (core_bfd);
138 /* Find a suitable core file handler to munch on core_bfd */
139 m_core_vec = sniff_core_bfd (m_core_gdbarch, core_bfd);
141 /* Find the data section */
142 if (build_section_table (core_bfd,
143 &m_core_section_table.sections,
144 &m_core_section_table.sections_end))
145 error (_("\"%s\": Can't find sections: %s"),
146 bfd_get_filename (core_bfd), bfd_errmsg (bfd_get_error ()));
149 core_target::~core_target ()
151 xfree (m_core_section_table.sections);
154 /* List of all available core_fns. On gdb startup, each core file
155 register reader calls deprecated_add_core_fns() to register
156 information on each core format it is prepared to read. */
158 static struct core_fns *core_file_fns = NULL;
160 static int gdb_check_format (bfd *);
162 static void add_to_thread_list (bfd *, asection *, void *);
164 /* An arbitrary identifier for the core inferior. */
165 #define CORELOW_PID 1
167 /* Link a new core_fns into the global core_file_fns list. Called on
168 gdb startup by the _initialize routine in each core file register
169 reader, to register information about each format the reader is
170 prepared to handle. */
173 deprecated_add_core_fns (struct core_fns *cf)
175 cf->next = core_file_fns;
179 /* The default function that core file handlers can use to examine a
180 core file BFD and decide whether or not to accept the job of
181 reading the core file. */
184 default_core_sniffer (struct core_fns *our_fns, bfd *abfd)
188 result = (bfd_get_flavour (abfd) == our_fns -> core_flavour);
192 /* Walk through the list of core functions to find a set that can
193 handle the core file open on ABFD. Returns pointer to set that is
196 static struct core_fns *
197 sniff_core_bfd (struct gdbarch *core_gdbarch, bfd *abfd)
200 struct core_fns *yummy = NULL;
203 /* Don't sniff if we have support for register sets in
205 if (core_gdbarch && gdbarch_iterate_over_regset_sections_p (core_gdbarch))
208 for (cf = core_file_fns; cf != NULL; cf = cf->next)
210 if (cf->core_sniffer (cf, abfd))
218 warning (_("\"%s\": ambiguous core format, %d handlers match"),
219 bfd_get_filename (abfd), matches);
221 else if (matches == 0)
222 error (_("\"%s\": no core file handler recognizes format"),
223 bfd_get_filename (abfd));
228 /* The default is to reject every core file format we see. Either
229 BFD has to recognize it, or we have to provide a function in the
230 core file handler that recognizes it. */
233 default_check_format (bfd *abfd)
238 /* Attempt to recognize core file formats that BFD rejects. */
241 gdb_check_format (bfd *abfd)
245 for (cf = core_file_fns; cf != NULL; cf = cf->next)
247 if (cf->check_format (abfd))
255 /* Close the core target. */
258 core_target::close ()
262 inferior_ptid = null_ptid; /* Avoid confusion from thread
264 exit_inferior_silent (current_inferior ());
266 /* Clear out solib state while the bfd is still open. See
267 comments in clear_solib in solib.c. */
270 current_program_space->cbfd.reset (nullptr);
273 /* Core targets are heap-allocated (see core_target_open), so here
274 we delete ourselves. */
278 /* Look for sections whose names start with `.reg/' so that we can
279 extract the list of threads in a core file. */
282 add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
287 asection *reg_sect = (asection *) reg_sect_arg;
288 bool fake_pid_p = false;
289 struct inferior *inf;
291 if (!startswith (bfd_section_name (abfd, asect), ".reg/"))
294 core_tid = atoi (bfd_section_name (abfd, asect) + 5);
296 pid = bfd_core_file_pid (core_bfd);
305 inf = current_inferior ();
308 inferior_appeared (inf, pid);
309 inf->fake_pid_p = fake_pid_p;
312 ptid = ptid_t (pid, lwpid, 0);
316 /* Warning, Will Robinson, looking at BFD private data! */
319 && asect->filepos == reg_sect->filepos) /* Did we find .reg? */
320 inferior_ptid = ptid; /* Yes, make it current. */
323 /* Issue a message saying we have no core to debug, if FROM_TTY. */
326 maybe_say_no_core_file_now (int from_tty)
329 printf_filtered (_("No core file now.\n"));
332 /* Backward compatability with old way of specifying core files. */
335 core_file_command (const char *filename, int from_tty)
337 dont_repeat (); /* Either way, seems bogus. */
339 if (filename == NULL)
341 if (core_bfd != NULL)
343 target_detach (current_inferior (), from_tty);
344 gdb_assert (core_bfd == NULL);
347 maybe_say_no_core_file_now (from_tty);
350 core_target_open (filename, from_tty);
356 core_target_open (const char *arg, int from_tty)
363 target_preopen (from_tty);
367 error (_("No core file specified. (Use `detach' "
368 "to stop debugging a core file.)"));
370 error (_("No core file specified."));
373 gdb::unique_xmalloc_ptr<char> filename (tilde_expand (arg));
374 if (!IS_ABSOLUTE_PATH (filename.get ()))
375 filename.reset (concat (current_directory, "/",
376 filename.get (), (char *) NULL));
378 flags = O_BINARY | O_LARGEFILE;
383 scratch_chan = gdb_open_cloexec (filename.get (), flags, 0);
384 if (scratch_chan < 0)
385 perror_with_name (filename.get ());
387 gdb_bfd_ref_ptr temp_bfd (gdb_bfd_fopen (filename.get (), gnutarget,
388 write_files ? FOPEN_RUB : FOPEN_RB,
390 if (temp_bfd == NULL)
391 perror_with_name (filename.get ());
393 if (!bfd_check_format (temp_bfd.get (), bfd_core)
394 && !gdb_check_format (temp_bfd.get ()))
396 /* Do it after the err msg */
397 /* FIXME: should be checking for errors from bfd_close (for one
398 thing, on error it does not free all the storage associated
400 error (_("\"%s\" is not a core dump: %s"),
401 filename.get (), bfd_errmsg (bfd_get_error ()));
404 current_program_space->cbfd = std::move (temp_bfd);
406 core_target *target = new core_target ();
408 /* Own the target until it is successfully pushed. */
409 target_ops_up target_holder (target);
413 /* If we have no exec file, try to set the architecture from the
414 core file. We don't do this unconditionally since an exec file
415 typically contains more information that helps us determine the
416 architecture than a core file. */
418 set_gdbarch_from_file (core_bfd);
420 push_target (std::move (target_holder));
422 inferior_ptid = null_ptid;
424 /* Need to flush the register cache (and the frame cache) from a
425 previous debug session. If inferior_ptid ends up the same as the
426 last debug session --- e.g., b foo; run; gcore core1; step; gcore
427 core2; core core1; core core2 --- then there's potential for
428 get_current_regcache to return the cached regcache of the
429 previous session, and the frame cache being stale. */
430 registers_changed ();
432 /* Build up thread list from BFD sections, and possibly set the
433 current thread to the .reg/NN section matching the .reg
435 bfd_map_over_sections (core_bfd, add_to_thread_list,
436 bfd_get_section_by_name (core_bfd, ".reg"));
438 if (inferior_ptid == null_ptid)
440 /* Either we found no .reg/NN section, and hence we have a
441 non-threaded core (single-threaded, from gdb's perspective),
442 or for some reason add_to_thread_list couldn't determine
443 which was the "main" thread. The latter case shouldn't
444 usually happen, but we're dealing with input here, which can
445 always be broken in different ways. */
446 thread_info *thread = first_thread_of_inferior (current_inferior ());
450 inferior_appeared (current_inferior (), CORELOW_PID);
451 inferior_ptid = ptid_t (CORELOW_PID);
452 add_thread_silent (inferior_ptid);
455 switch_to_thread (thread);
458 post_create_inferior (target, from_tty);
460 /* Now go through the target stack looking for threads since there
461 may be a thread_stratum target loaded on top of target core by
462 now. The layer above should claim threads found in the BFD
466 target_update_thread_list ();
469 catch (const gdb_exception_error &except)
471 exception_print (gdb_stderr, except);
474 p = bfd_core_file_failing_command (core_bfd);
476 printf_filtered (_("Core was generated by `%s'.\n"), p);
478 /* Clearing any previous state of convenience variables. */
479 clear_exit_convenience_vars ();
481 siggy = bfd_core_file_failing_signal (core_bfd);
484 gdbarch *core_gdbarch = target->core_gdbarch ();
486 /* If we don't have a CORE_GDBARCH to work with, assume a native
487 core (map gdb_signal from host signals). If we do have
488 CORE_GDBARCH to work with, but no gdb_signal_from_target
489 implementation for that gdbarch, as a fallback measure,
490 assume the host signal mapping. It'll be correct for native
491 cores, but most likely incorrect for cross-cores. */
492 enum gdb_signal sig = (core_gdbarch != NULL
493 && gdbarch_gdb_signal_from_target_p (core_gdbarch)
494 ? gdbarch_gdb_signal_from_target (core_gdbarch,
496 : gdb_signal_from_host (siggy));
498 printf_filtered (_("Program terminated with signal %s, %s.\n"),
499 gdb_signal_to_name (sig), gdb_signal_to_string (sig));
501 /* Set the value of the internal variable $_exitsignal,
502 which holds the signal uncaught by the inferior. */
503 set_internalvar_integer (lookup_internalvar ("_exitsignal"),
507 /* Fetch all registers from core file. */
508 target_fetch_registers (get_current_regcache (), -1);
510 /* Now, set up the frame cache, and print the top of stack. */
511 reinit_frame_cache ();
512 print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
514 /* Current thread should be NUM 1 but the user does not know that.
515 If a program is single threaded gdb in general does not mention
516 anything about threads. That is why the test is >= 2. */
517 if (thread_count () >= 2)
521 thread_command (NULL, from_tty);
523 catch (const gdb_exception_error &except)
525 exception_print (gdb_stderr, except);
531 core_target::detach (inferior *inf, int from_tty)
533 /* Note that 'this' is dangling after this call. unpush_target
534 closes the target, and our close implementation deletes
536 unpush_target (this);
538 /* Clear the register cache and the frame cache. */
539 registers_changed ();
540 reinit_frame_cache ();
541 maybe_say_no_core_file_now (from_tty);
544 /* Try to retrieve registers from a section in core_bfd, and supply
545 them to m_core_vec->core_read_registers, as the register set
548 If ptid's lwp member is zero, do the single-threaded
549 thing: look for a section named NAME. If ptid's lwp
550 member is non-zero, do the multi-threaded thing: look for a section
551 named "NAME/LWP", where LWP is the shortest ASCII decimal
552 representation of ptid's lwp member.
554 HUMAN_NAME is a human-readable name for the kind of registers the
555 NAME section contains, for use in error messages.
557 If REQUIRED is true, print an error if the core file doesn't have a
558 section by the appropriate name. Otherwise, just do nothing. */
561 core_target::get_core_register_section (struct regcache *regcache,
562 const struct regset *regset,
564 int section_min_size,
566 const char *human_name,
569 struct bfd_section *section;
572 bool variable_size_section = (regset != NULL
573 && regset->flags & REGSET_VARIABLE_SIZE);
575 thread_section_name section_name (name, regcache->ptid ());
577 section = bfd_get_section_by_name (core_bfd, section_name.c_str ());
581 warning (_("Couldn't find %s registers in core file."),
586 size = bfd_section_size (core_bfd, section);
587 if (size < section_min_size)
589 warning (_("Section `%s' in core file too small."),
590 section_name.c_str ());
593 if (size != section_min_size && !variable_size_section)
595 warning (_("Unexpected size of section `%s' in core file."),
596 section_name.c_str ());
599 contents = (char *) alloca (size);
600 if (! bfd_get_section_contents (core_bfd, section, contents,
603 warning (_("Couldn't read %s registers from `%s' section in core file."),
604 human_name, section_name.c_str ());
610 regset->supply_regset (regset, regcache, -1, contents, size);
614 gdb_assert (m_core_vec != nullptr);
615 m_core_vec->core_read_registers (regcache, contents, size, which,
617 bfd_section_vma (core_bfd, section)));
620 /* Data passed to gdbarch_iterate_over_regset_sections's callback. */
621 struct get_core_registers_cb_data
624 struct regcache *regcache;
627 /* Callback for get_core_registers that handles a single core file
628 register note section. */
631 get_core_registers_cb (const char *sect_name, int supply_size, int collect_size,
632 const struct regset *regset,
633 const char *human_name, void *cb_data)
635 auto *data = (get_core_registers_cb_data *) cb_data;
636 bool required = false;
637 bool variable_size_section = (regset != NULL
638 && regset->flags & REGSET_VARIABLE_SIZE);
640 if (!variable_size_section)
641 gdb_assert (supply_size == collect_size);
643 if (strcmp (sect_name, ".reg") == 0)
646 if (human_name == NULL)
647 human_name = "general-purpose";
649 else if (strcmp (sect_name, ".reg2") == 0)
651 if (human_name == NULL)
652 human_name = "floating-point";
655 /* The 'which' parameter is only used when no regset is provided.
656 Thus we just set it to -1. */
657 data->target->get_core_register_section (data->regcache, regset, sect_name,
658 supply_size, -1, human_name,
662 /* Get the registers out of a core file. This is the machine-
663 independent part. Fetch_core_registers is the machine-dependent
664 part, typically implemented in the xm-file for each
667 /* We just get all the registers, so we don't use regno. */
670 core_target::fetch_registers (struct regcache *regcache, int regno)
673 struct gdbarch *gdbarch;
675 if (!(m_core_gdbarch != nullptr
676 && gdbarch_iterate_over_regset_sections_p (m_core_gdbarch))
677 && (m_core_vec == NULL || m_core_vec->core_read_registers == NULL))
679 fprintf_filtered (gdb_stderr,
680 "Can't fetch registers from this type of core file\n");
684 gdbarch = regcache->arch ();
685 if (gdbarch_iterate_over_regset_sections_p (gdbarch))
687 get_core_registers_cb_data data = { this, regcache };
688 gdbarch_iterate_over_regset_sections (gdbarch,
689 get_core_registers_cb,
690 (void *) &data, NULL);
694 get_core_register_section (regcache, NULL,
695 ".reg", 0, 0, "general-purpose", 1);
696 get_core_register_section (regcache, NULL,
697 ".reg2", 0, 2, "floating-point", 0);
700 /* Mark all registers not found in the core as unavailable. */
701 for (i = 0; i < gdbarch_num_regs (regcache->arch ()); i++)
702 if (regcache->get_register_status (i) == REG_UNKNOWN)
703 regcache->raw_supply (i, NULL);
707 core_target::files_info ()
709 print_section_info (&m_core_section_table, core_bfd);
722 add_to_spuid_list (bfd *abfd, asection *asect, void *list_p)
724 struct spuid_list *list = (struct spuid_list *) list_p;
725 enum bfd_endian byte_order
726 = bfd_big_endian (abfd) ? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
729 sscanf (bfd_section_name (abfd, asect), "SPU/%d/regs%n", &fd, &pos);
733 if (list->pos >= list->offset && list->pos + 4 <= list->offset + list->len)
735 store_unsigned_integer (list->buf + list->pos - list->offset,
742 enum target_xfer_status
743 core_target::xfer_partial (enum target_object object, const char *annex,
744 gdb_byte *readbuf, const gdb_byte *writebuf,
745 ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
749 case TARGET_OBJECT_MEMORY:
750 return (section_table_xfer_memory_partial
752 offset, len, xfered_len,
753 m_core_section_table.sections,
754 m_core_section_table.sections_end,
757 case TARGET_OBJECT_AUXV:
760 /* When the aux vector is stored in core file, BFD
761 represents this with a fake section called ".auxv". */
763 struct bfd_section *section;
766 section = bfd_get_section_by_name (core_bfd, ".auxv");
768 return TARGET_XFER_E_IO;
770 size = bfd_section_size (core_bfd, section);
772 return TARGET_XFER_EOF;
778 return TARGET_XFER_EOF;
779 if (!bfd_get_section_contents (core_bfd, section, readbuf,
780 (file_ptr) offset, size))
782 warning (_("Couldn't read NT_AUXV note in core file."));
783 return TARGET_XFER_E_IO;
786 *xfered_len = (ULONGEST) size;
787 return TARGET_XFER_OK;
789 return TARGET_XFER_E_IO;
791 case TARGET_OBJECT_WCOOKIE:
794 /* When the StackGhost cookie is stored in core file, BFD
795 represents this with a fake section called
798 struct bfd_section *section;
801 section = bfd_get_section_by_name (core_bfd, ".wcookie");
803 return TARGET_XFER_E_IO;
805 size = bfd_section_size (core_bfd, section);
807 return TARGET_XFER_EOF;
813 return TARGET_XFER_EOF;
814 if (!bfd_get_section_contents (core_bfd, section, readbuf,
815 (file_ptr) offset, size))
817 warning (_("Couldn't read StackGhost cookie in core file."));
818 return TARGET_XFER_E_IO;
821 *xfered_len = (ULONGEST) size;
822 return TARGET_XFER_OK;
825 return TARGET_XFER_E_IO;
827 case TARGET_OBJECT_LIBRARIES:
828 if (m_core_gdbarch != nullptr
829 && gdbarch_core_xfer_shared_libraries_p (m_core_gdbarch))
832 return TARGET_XFER_E_IO;
835 *xfered_len = gdbarch_core_xfer_shared_libraries (m_core_gdbarch,
839 if (*xfered_len == 0)
840 return TARGET_XFER_EOF;
842 return TARGET_XFER_OK;
847 case TARGET_OBJECT_LIBRARIES_AIX:
848 if (m_core_gdbarch != nullptr
849 && gdbarch_core_xfer_shared_libraries_aix_p (m_core_gdbarch))
852 return TARGET_XFER_E_IO;
856 = gdbarch_core_xfer_shared_libraries_aix (m_core_gdbarch,
860 if (*xfered_len == 0)
861 return TARGET_XFER_EOF;
863 return TARGET_XFER_OK;
868 case TARGET_OBJECT_SPU:
869 if (readbuf && annex)
871 /* When the SPU contexts are stored in a core file, BFD
872 represents this with a fake section called
875 struct bfd_section *section;
877 char sectionstr[100];
879 xsnprintf (sectionstr, sizeof sectionstr, "SPU/%s", annex);
881 section = bfd_get_section_by_name (core_bfd, sectionstr);
883 return TARGET_XFER_E_IO;
885 size = bfd_section_size (core_bfd, section);
887 return TARGET_XFER_EOF;
893 return TARGET_XFER_EOF;
894 if (!bfd_get_section_contents (core_bfd, section, readbuf,
895 (file_ptr) offset, size))
897 warning (_("Couldn't read SPU section in core file."));
898 return TARGET_XFER_E_IO;
901 *xfered_len = (ULONGEST) size;
902 return TARGET_XFER_OK;
906 /* NULL annex requests list of all present spuids. */
907 struct spuid_list list;
910 list.offset = offset;
914 bfd_map_over_sections (core_bfd, add_to_spuid_list, &list);
916 if (list.written == 0)
917 return TARGET_XFER_EOF;
920 *xfered_len = (ULONGEST) list.written;
921 return TARGET_XFER_OK;
924 return TARGET_XFER_E_IO;
926 case TARGET_OBJECT_SIGNAL_INFO:
929 if (m_core_gdbarch != nullptr
930 && gdbarch_core_xfer_siginfo_p (m_core_gdbarch))
932 LONGEST l = gdbarch_core_xfer_siginfo (m_core_gdbarch, readbuf,
939 return TARGET_XFER_EOF;
941 return TARGET_XFER_OK;
945 return TARGET_XFER_E_IO;
948 return this->beneath ()->xfer_partial (object, annex, readbuf,
949 writebuf, offset, len,
956 /* Okay, let's be honest: threads gleaned from a core file aren't
957 exactly lively, are they? On the other hand, if we don't claim
958 that each & every one is alive, then we don't get any of them
959 to appear in an "info thread" command, which is quite a useful
963 core_target::thread_alive (ptid_t ptid)
968 /* Ask the current architecture what it knows about this core file.
969 That will be used, in turn, to pick a better architecture. This
970 wrapper could be avoided if targets got a chance to specialize
973 const struct target_desc *
974 core_target::read_description ()
976 if (m_core_gdbarch && gdbarch_core_read_description_p (m_core_gdbarch))
978 const struct target_desc *result;
980 result = gdbarch_core_read_description (m_core_gdbarch, this, core_bfd);
985 return this->beneath ()->read_description ();
989 core_target::pid_to_str (ptid_t ptid)
991 struct inferior *inf;
994 /* The preferred way is to have a gdbarch/OS specific
996 if (m_core_gdbarch != nullptr
997 && gdbarch_core_pid_to_str_p (m_core_gdbarch))
998 return gdbarch_core_pid_to_str (m_core_gdbarch, ptid);
1000 /* Otherwise, if we don't have one, we'll just fallback to
1001 "process", with normal_pid_to_str. */
1003 /* Try the LWPID field first. */
1006 return normal_pid_to_str (ptid_t (pid));
1008 /* Otherwise, this isn't a "threaded" core -- use the PID field, but
1009 only if it isn't a fake PID. */
1010 inf = find_inferior_ptid (ptid);
1011 if (inf != NULL && !inf->fake_pid_p)
1012 return normal_pid_to_str (ptid);
1014 /* No luck. We simply don't have a valid PID to print. */
1015 return "<main task>";
1019 core_target::thread_name (struct thread_info *thr)
1021 if (m_core_gdbarch != nullptr
1022 && gdbarch_core_thread_name_p (m_core_gdbarch))
1023 return gdbarch_core_thread_name (m_core_gdbarch, thr);
1028 core_target::has_memory ()
1030 return (core_bfd != NULL);
1034 core_target::has_stack ()
1036 return (core_bfd != NULL);
1040 core_target::has_registers ()
1042 return (core_bfd != NULL);
1045 /* Implement the to_info_proc method. */
1048 core_target::info_proc (const char *args, enum info_proc_what request)
1050 struct gdbarch *gdbarch = get_current_arch ();
1052 /* Since this is the core file target, call the 'core_info_proc'
1053 method on gdbarch, not 'info_proc'. */
1054 if (gdbarch_core_info_proc_p (gdbarch))
1055 gdbarch_core_info_proc (gdbarch, args, request);
1061 _initialize_corelow (void)
1063 add_target (core_target_info, core_target_open, filename_completer);