Fix indentation in print_thread_info_1
[deliverable/binutils-gdb.git] / gdb / target-debug.h
index 534e42976ae0ae23a2ad743961f1de9ec7796bbf..aa2adcec3d21af3ec79a97a389d16c0832b356bb 100644 (file)
@@ -1,6 +1,6 @@
 /* GDB target debugging macros
 
-   Copyright (C) 2014-2018 Free Software Foundation, Inc.
+   Copyright (C) 2014-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -71,7 +71,7 @@
 #define target_debug_print_enum_btrace_error(X) \
   target_debug_do_print (plongest (X))
 #define target_debug_print_ptid_t(X)           \
-  target_debug_do_print (plongest (ptid_get_pid (X)))
+  target_debug_do_print (plongest (X.pid ()))
 #define target_debug_print_struct_gdbarch_p(X) \
   target_debug_do_print (gdbarch_bfd_arch_info (X)->printable_name)
 #define target_debug_print_const_gdb_byte_p(X) \
   target_debug_do_print (host_address_to_string (X))
 #define target_debug_print_thread_info_pp(X)           \
   target_debug_do_print (host_address_to_string (X))
+#define target_debug_print_std_string(X) \
+  target_debug_do_print ((X).c_str ())
+#define target_debug_print_gdb_byte_vector(X)  \
+  target_debug_do_print (host_address_to_string (X.data ()))
 
 static void
 target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status)
@@ -203,27 +207,22 @@ target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status)
 static void
 target_debug_print_options (int options)
 {
-  char *str = target_options_to_string (options);
+  std::string str = target_options_to_string (options);
 
-  fputs_unfiltered (str, gdb_stdlog);
-  xfree (str);
+  fputs_unfiltered (str.c_str (), gdb_stdlog);
 }
 
 static void
-target_debug_print_signals (unsigned char *sigs)
+target_debug_print_signals (gdb::array_view<const unsigned char> sigs)
 {
   fputs_unfiltered ("{", gdb_stdlog);
-  if (sigs != NULL)
-    {
-      int i;
-
-      for (i = 0; i < GDB_SIGNAL_LAST; i++)
-       if (sigs[i])
-         {
-           fprintf_unfiltered (gdb_stdlog, " %s",
-                               gdb_signal_to_name ((enum gdb_signal) i));
-         }
-    }
+
+  for (size_t i = 0; i < sigs.size (); i++)
+    if (sigs[i] != 0)
+      {
+       fprintf_unfiltered (gdb_stdlog, " %s",
+                           gdb_signal_to_name ((enum gdb_signal) i));
+      }
   fputs_unfiltered (" }", gdb_stdlog);
 }
 
This page took 0.02744 seconds and 4 git commands to generate.