Automatic date update in version.in
[deliverable/binutils-gdb.git] / gdb / thread.c
index d13298f5c6f5401478c704ecebe9b197ac118408..a210d328ed0e9ec148a7ec52aa8fcc7c8cac05cc 100644 (file)
@@ -23,7 +23,7 @@
 #include "symtab.h"
 #include "frame.h"
 #include "inferior.h"
-#include "common/environ.h"
+#include "gdbsupport/environ.h"
 #include "value.h"
 #include "target.h"
 #include "gdbthread.h"
@@ -45,7 +45,7 @@
 #include "thread-fsm.h"
 #include "tid-parse.h"
 #include <algorithm>
-#include "common/gdb_optional.h"
+#include "gdbsupport/gdb_optional.h"
 #include "inline-frame.h"
 #include "stack.h"
 
@@ -444,7 +444,7 @@ thread_step_over_chain_remove (struct thread_info *tp)
   step_over_chain_remove (&step_over_queue_head, tp);
 }
 
-/* Delete the thread referenced by THR.  If SILENT, don't notifyi
+/* Delete the thread referenced by THR.  If SILENT, don't notify
    the observer of this exit.
    
    THR must not be NULL or a failed assertion will be raised.  */
@@ -709,7 +709,7 @@ delete_exited_threads (void)
       delete_thread (tp);
 }
 
-/* Return true value if stack temporaies are enabled for the thread
+/* Return true value if stack temporaries are enabled for the thread
    TP.  */
 
 bool
@@ -1114,7 +1114,7 @@ print_thread_info_1 (struct ui_out *uiout, const char *requested_threads,
          }
 
        if (show_global_ids || uiout->is_mi_like_p ())
-         uiout->field_int ("id", tp->global_num);
+         uiout->field_signed ("id", tp->global_num);
 
        /* For the CLI, we stuff everything into the target-id field.
           This is a gross hack to make the output come out looking
@@ -1167,7 +1167,7 @@ print_thread_info_1 (struct ui_out *uiout, const char *requested_threads,
 
        core = target_core_of_thread (tp->ptid);
        if (uiout->is_mi_like_p () && core != -1)
-         uiout->field_int ("core", core);
+         uiout->field_signed ("core", core);
       }
 
     /* This end scope restores the current thread and the frame
@@ -1178,7 +1178,7 @@ print_thread_info_1 (struct ui_out *uiout, const char *requested_threads,
   if (pid == -1 && requested_threads == NULL)
     {
       if (uiout->is_mi_like_p () && inferior_ptid != null_ptid)
-       uiout->field_int ("current-thread-id", current_thread->global_num);
+       uiout->field_signed ("current-thread-id", current_thread->global_num);
 
       if (inferior_ptid != null_ptid && current_exited)
        uiout->message ("\n\
@@ -1204,7 +1204,7 @@ print_thread_info (struct ui_out *uiout, const char *requested_threads,
 struct info_threads_opts
 {
   /* For "-gid".  */
-  int show_global_ids = 0;
+  bool show_global_ids = false;
 };
 
 static const gdb::option::option_def info_threads_option_defs[] = {
@@ -1307,7 +1307,7 @@ switch_to_thread (thread_info *thr)
   reinit_frame_cache ();
 }
 
-/* See common/common-gdbthread.h.  */
+/* See gdbsupport/common-gdbthread.h.  */
 
 void
 switch_to_thread (ptid_t ptid)
@@ -1574,7 +1574,7 @@ static const gdb::option::option_def thr_qcs_flags_option_defs[] = {
    ASCENDING and FLAGS as context.  */
 
 static inline std::array<gdb::option::option_def_group, 2>
-make_thread_apply_all_options_def_group (int *ascending,
+make_thread_apply_all_options_def_group (bool *ascending,
                                         qcs_flags *flags)
 {
   return {{
@@ -1603,7 +1603,7 @@ make_thread_apply_options_def_group (qcs_flags *flags)
 static void
 thread_apply_all_command (const char *cmd, int from_tty)
 {
-  int ascending = false;
+  bool ascending = false;
   qcs_flags flags;
 
   auto group = make_thread_apply_all_options_def_group (&ascending,
@@ -1818,6 +1818,8 @@ thread_apply_command (const char *tidlist, int from_tty)
 static void
 taas_command (const char *cmd, int from_tty)
 {
+  if (cmd == NULL || *cmd == '\0')
+    error (_("Please specify a command to apply on all threads"));
   std::string expanded = std::string ("thread apply all -s ") + cmd;
   execute_command (expanded.c_str (), from_tty);
 }
@@ -1827,6 +1829,8 @@ taas_command (const char *cmd, int from_tty)
 static void
 tfaas_command (const char *cmd, int from_tty)
 {
+  if (cmd == NULL || *cmd == '\0')
+    error (_("Please specify a command to apply on all frames of all threads"));
   std::string expanded
     = std::string ("thread apply all -s -- frame apply all -s ") + cmd;
   execute_command (expanded.c_str (), from_tty);
@@ -1951,7 +1955,7 @@ thread_find_command (const char *arg, int from_tty)
 }
 
 /* Print notices when new threads are attached and detached.  */
-int print_thread_events = 1;
+bool print_thread_events = true;
 static void
 show_print_thread_events (struct ui_file *file, int from_tty,
                          struct cmd_list_element *c, const char *value)
@@ -1990,8 +1994,8 @@ print_selected_thread_frame (struct ui_out *uiout,
     {
       if (uiout->is_mi_like_p ())
        {
-         uiout->field_int ("new-thread-id",
-                           inferior_thread ()->global_num);
+         uiout->field_signed ("new-thread-id",
+                              inferior_thread ()->global_num);
        }
       else
        {
@@ -2150,7 +2154,7 @@ Options:\n\
 
   const auto thread_apply_opts = make_thread_apply_options_def_group (nullptr);
 
-  static std::string thread_apply_help = gdb::option::build_help (N_("\
+  static std::string thread_apply_help = gdb::option::build_help (_("\
 Apply a command to a list of threads.\n\
 Usage: thread apply ID... [OPTION]... COMMAND\n\
 ID is a space-separated list of IDs of threads to apply COMMAND on.\n"
@@ -2166,7 +2170,7 @@ THREAD_APPLY_OPTION_HELP),
   const auto thread_apply_all_opts
     = make_thread_apply_all_options_def_group (nullptr, nullptr);
 
-  static std::string thread_apply_all_help = gdb::option::build_help (N_("\
+  static std::string thread_apply_all_help = gdb::option::build_help (_("\
 Apply a command to all threads.\n\
 \n\
 Usage: thread apply all [OPTION]... COMMAND\n"
This page took 0.027546 seconds and 4 git commands to generate.