Add `set print array-indexes' tests for C/C++ arrays
[binutils-gdb.git] / gdb / tracepoint.c
index df5013e45ae899b86de5b3bb8414eca7cfe8db16..33f5c7f59fe15d9c1baaf9223f3a14ac02b8b58f 100644 (file)
@@ -1,6 +1,6 @@
 /* Tracing functionality for remote targets in custom GDB protocol
 
-   Copyright (C) 1997-2021 Free Software Foundation, Inc.
+   Copyright (C) 1997-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -58,6 +58,7 @@
 #include <algorithm>
 #include "cli/cli-style.h"
 #include "expop.h"
+#include "gdbsupport/buildargv.h"
 
 #include <unistd.h>
 
@@ -2195,8 +2196,8 @@ tfind_1 (enum trace_find_type type, int num,
        }
       else
        {
-         printf_unfiltered (_("Found trace frame %d, tracepoint %d\n"),
-                            traceframe_number, tracepoint_number);
+         printf_filtered (_("Found trace frame %d, tracepoint %d\n"),
+                          traceframe_number, tracepoint_number);
        }
     }
   else
@@ -2204,9 +2205,9 @@ tfind_1 (enum trace_find_type type, int num,
       if (uiout->is_mi_like_p ())
        uiout->field_string ("found", "0");
       else if (type == tfind_number && num == -1)
-       printf_unfiltered (_("No longer looking at any trace frame\n"));
+       printf_filtered (_("No longer looking at any trace frame\n"));
       else /* This case may never occur, check.  */
-       printf_unfiltered (_("No trace frame found\n"));
+       printf_filtered (_("No trace frame found\n"));
     }
 
   /* If we're in nonstop mode and getting out of looking at trace
@@ -2641,7 +2642,7 @@ info_scope_command (const char *args_in, int from_tty)
                  printf_filtered ("optimized out.\n");
                  continue;
                case LOC_COMPUTED:
-                 gdb_assert_not_reached (_("LOC_COMPUTED variable missing a method"));
+                 gdb_assert_not_reached ("LOC_COMPUTED variable missing a method");
                }
            }
          if (SYMBOL_TYPE (sym))
@@ -2809,7 +2810,7 @@ all_tracepoint_actions (struct breakpoint *t)
   if (!default_collect.empty ())
     {
       gdb::unique_xmalloc_ptr<char> default_collect_line
-       (xstrprintf ("collect %s", default_collect.c_str ()));
+       = xstrprintf ("collect %s", default_collect.c_str ());
 
       validate_actionline (default_collect_line.get (), t);
       actions.reset (new struct command_line (simple_control,
@@ -3820,7 +3821,7 @@ sdata_make_value (struct gdbarch *gdbarch, struct internalvar *var,
       type = init_vector_type (builtin_type (gdbarch)->builtin_true_char,
                               buf->size ());
       v = allocate_value (type);
-      memcpy (value_contents_raw (v), buf->data (), buf->size ());
+      memcpy (value_contents_raw (v).data (), buf->data (), buf->size ());
       return v;
     }
   else