Make print_command_trace varargs
[deliverable/binutils-gdb.git] / gdb / ctf.c
index b09cebbf071c98fc5674ae5f7d53e396bed2c045..cae5d221cb1c3f4a8143df60ea12b0df75101ccd 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,
@@ -62,7 +58,7 @@ Specify the filename of the CTF directory.");
   void files_info () override;
   int trace_find (enum trace_find_type type, int num,
                          CORE_ADDR addr1, CORE_ADDR addr2, int *tpp) override;
-  int get_trace_state_variable_value (int tsv, LONGEST *val) override;
+  bool get_trace_state_variable_value (int tsv, LONGEST *val) override;
   traceframe_info_up traceframe_info () override;
 };
 
@@ -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;
@@ -1430,11 +1426,11 @@ ctf_target::xfer_partial (enum target_object object,
    trace variable is found, set the value of it to *VAL and return
    true, otherwise return false.  */
 
-int
+bool
 ctf_target::get_trace_state_variable_value (int tsvnum, LONGEST *val)
 {
   struct bt_iter_pos *pos;
-  int found = 0;
+  bool found = false;
 
   gdb_assert (ctf_iter != NULL);
   /* Save the current position.  */
@@ -1465,7 +1461,7 @@ ctf_target::get_trace_state_variable_value (int tsvnum, LONGEST *val)
              def = bt_ctf_get_field (event, scope, "val");
              *val = bt_ctf_get_uint64 (def);
 
-             found = 1;
+             found = true;
            }
        }
 
@@ -1724,6 +1720,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.025114 seconds and 4 git commands to generate.