Split size in regset section iterators
[deliverable/binutils-gdb.git] / gdb / ctf.c
index 90d6f6c025f6e3bc94afb204aa6ee58b067f9d5f..a156b1faf27d9016690826af1e0feda9a8b18e8d 100644 (file)
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
 
 /* The CTF target.  */
 
+static const target_info ctf_target_info = {
+  "ctf",
+  N_("CTF file"),
+  N_("(Use a CTF directory as a target.\n\
+Specify the filename of the CTF directory.")
+};
+
 class ctf_target final : public tracefile_target
 {
 public:
-  const char *shortname () override
-  { return "ctf"; }
-
-  const char *longname () override
-  { return _("CTF file"); }
-
-  const char *doc () override
-  {
-    return _("\
-Use a CTF directory as a target.\n\
-Specify the filename of the CTF directory.");
-  }
+  const target_info &info () const override
+  { return ctf_target_info; }
 
-  void open (const char *, int) override;
   void close () override;
   void fetch_registers (struct regcache *, int) override;
   enum target_xfer_status xfer_partial (enum target_object object,
@@ -1108,8 +1104,8 @@ ctf_read_tp (struct uploaded_tp **uploaded_tps)
    definitions from the first packet.  Set the start position at the
    second packet which contains events on trace blocks.  */
 
-void
-ctf_target::open (const char *dirname, int from_tty)
+static void
+ctf_target_open (const char *dirname, int from_tty)
 {
   struct bt_ctf_event *event;
   uint32_t event_id;
@@ -1164,7 +1160,7 @@ ctf_target::open (const char *dirname, int from_tty)
   push_target (&ctf_ops);
 
   inferior_appeared (current_inferior (), CTF_PID);
-  inferior_ptid = pid_to_ptid (CTF_PID);
+  inferior_ptid = ptid_t (CTF_PID);
   add_thread_silent (inferior_ptid);
 
   merge_uploaded_trace_state_variables (&uploaded_tsvs);
@@ -1179,15 +1175,12 @@ ctf_target::open (const char *dirname, int from_tty)
 void
 ctf_target::close ()
 {
-  int pid;
-
   ctf_destroy ();
   xfree (trace_dirname);
   trace_dirname = NULL;
 
-  pid = ptid_get_pid (inferior_ptid);
   inferior_ptid = null_ptid;   /* Avoid confusion from thread stuff.  */
-  exit_inferior_silent (pid);
+  exit_inferior_silent (current_inferior ());
 
   trace_reset_local_state ();
 }
@@ -1266,16 +1259,16 @@ ctf_target::fetch_registers (struct regcache *regcache, int regno)
          /* Make sure we stay within block bounds.  */
          if (offset + regsize >= trace_regblock_size)
            break;
-         if (regcache_register_status (regcache, regn) == REG_UNKNOWN)
+         if (regcache->get_register_status (regn) == REG_UNKNOWN)
            {
              if (regno == regn)
                {
-                 regcache_raw_supply (regcache, regno, regs + offset);
+                 regcache->raw_supply (regno, regs + offset);
                  break;
                }
              else if (regno == -1)
                {
-                 regcache_raw_supply (regcache, regn, regs + offset);
+                 regcache->raw_supply (regn, regs + offset);
                }
            }
          offset += regsize;
@@ -1724,6 +1717,6 @@ void
 _initialize_ctf (void)
 {
 #if HAVE_LIBBABELTRACE
-  add_target_with_completer (&ctf_ops, filename_completer);
+  add_target (ctf_target_info, ctf_target_open, filename_completer);
 #endif
 }
This page took 0.028759 seconds and 4 git commands to generate.