watchpoint-unaligned.exp: Use skip_hw_watchpoint_tests
[deliverable/binutils-gdb.git] / gdb / corelow.c
index f7202f75e334ba8de315c503b4d37950234f35ed..97a957c8fcf6defa0afa0339f259816184958813 100644 (file)
 
 /* The core file target.  */
 
+static const target_info core_target_info = {
+  "core",
+  N_("Local core dump file"),
+  N_("Use a core file as a target.  Specify the filename of the core file.")
+};
+
 class core_target final : public target_ops
 {
 public:
   core_target ()
   { to_stratum = process_stratum; }
 
-  const char *shortname () override
-  { return "core"; }
-
-  const char *longname () override
-  { return _("Local core dump file"); }
-
-  const char *doc () override
-  {
-    return _("\
-Use a core file as a target.  Specify the filename of the core file.");
-  }
+  const target_info &info () const override
+  { return core_target_info; }
 
-  void open (const char *, int) override;
   void close () override;
   void detach (inferior *, int) override;
   void fetch_registers (struct regcache *, int) override;
@@ -83,16 +79,16 @@ Use a core file as a target.  Specify the filename of the core file.");
                                        ULONGEST *xfered_len) override;
   void files_info () override;
 
-  int thread_alive (ptid_t ptid) override;
+  bool thread_alive (ptid_t ptid) override;
   const struct target_desc *read_description () override;
 
   const char *pid_to_str (ptid_t) override;
 
   const char *thread_name (struct thread_info *) override;
 
-  int has_memory () override;
-  int has_stack () override;
-  int has_registers () override;
+  bool has_memory () override;
+  bool has_stack () override;
+  bool has_registers () override;
   bool info_proc (const char *, enum info_proc_what) override;
 };
 
@@ -313,10 +309,10 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
     inferior_ptid = ptid;                      /* Yes, make it current.  */
 }
 
-/* This routine opens and sets up the core file bfd.  */
+/* See gdbcore.h.  */
 
 void
-core_target::open (const char *arg, int from_tty)
+core_target_open (const char *arg, int from_tty)
 {
   const char *p;
   int siggy;
@@ -922,10 +918,10 @@ core_target::xfer_partial (enum target_object object, const char *annex,
    to appear in an "info thread" command, which is quite a useful
    behaviour.
  */
-int
+bool
 core_target::thread_alive (ptid_t ptid)
 {
-  return 1;
+  return true;
 }
 
 /* Ask the current architecture what it knows about this core file.
@@ -989,19 +985,19 @@ core_target::thread_name (struct thread_info *thr)
   return NULL;
 }
 
-int
+bool
 core_target::has_memory ()
 {
   return (core_bfd != NULL);
 }
 
-int
+bool
 core_target::has_stack ()
 {
   return (core_bfd != NULL);
 }
 
-int
+bool
 core_target::has_registers ()
 {
   return (core_bfd != NULL);
@@ -1031,5 +1027,5 @@ _initialize_corelow (void)
                    the_core_target->longname ());
   the_core_target = &core_ops;
 
-  add_target_with_completer (&core_ops, filename_completer);
+  add_target (core_target_info, core_target_open, filename_completer);
 }
This page took 0.025018 seconds and 4 git commands to generate.