From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15708 invoked by alias); 5 Feb 2009 19:08:53 -0000 Received: (qmail 15697 invoked by uid 22791); 5 Feb 2009 19:08:52 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BARRACUDA_BRBL,BAYES_00,SARE_SUB_GETRID,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-ew0-f17.google.com (HELO mail-ew0-f17.google.com) (209.85.219.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Feb 2009 19:08:46 +0000 Received: by ewy10 with SMTP id 10so603185ewy.0 for ; Thu, 05 Feb 2009 11:08:43 -0800 (PST) Received: by 10.67.115.16 with SMTP id s16mr4946899ugm.47.1233860821478; Thu, 05 Feb 2009 11:07:01 -0800 (PST) Received: from pedro-laptop-dell (bl7-247-209.dsl.telepac.pt [85.240.247.209]) by mx.google.com with ESMTPS id s7sm8932644uge.41.2009.02.05.11.07.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 05 Feb 2009 11:07:00 -0800 (PST) Received: by pedro-laptop-dell (Postfix, from userid 1000) id 69922EAEDE; Thu, 5 Feb 2009 19:07:09 +0000 (WET) To: gdb-patches@sourceware.org Subject: Get rid of target_tid_to_str Message-Id: <20090205190709.69922EAEDE@pedro-laptop-dell> Date: Thu, 05 Feb 2009 19:08:00 -0000 From: Pedro Alves X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-02/txt/msg00134.txt.bz2 Nothing defines this. Since we use ptids, it's not really useful, and if it matter, we're already inconsistent in a lot of places. Checked in. 2009-02-05 Pedro Alves * target.h (target_tid_to_str): Delete. * thread.c (print_thread_info, thread_apply_all_command) (thread_apply_command, thread_command, do_captured_thread_select): Use target_pid_to_str instead of target_tid_to_str. * linux-fork.c (delete_fork_command): Likewise. --- gdb/linux-fork.c | 2 +- gdb/target.h | 4 ---- gdb/thread.c | 12 ++++++------ 3 files changed, 7 insertions(+), 11 deletions(-) Index: src/gdb/target.h =================================================================== --- src.orig/gdb/target.h 2009-02-05 18:41:57.000000000 +0000 +++ src/gdb/target.h 2009-02-05 18:44:35.000000000 +0000 @@ -1016,11 +1016,7 @@ int target_supports_non_stop (void); #undef target_pid_to_str #define target_pid_to_str(PID) current_target.to_pid_to_str (PID) -#ifndef target_tid_to_str -#define target_tid_to_str(PID) \ - target_pid_to_str (PID) extern char *normal_pid_to_str (ptid_t ptid); -#endif /* Return a short string describing extra information about PID, e.g. "sleeping", "runnable", "running on LWP 3". Null return value Index: src/gdb/thread.c =================================================================== --- src.orig/gdb/thread.c 2009-02-05 18:41:57.000000000 +0000 +++ src/gdb/thread.c 2009-02-05 18:42:31.000000000 +0000 @@ -746,7 +746,7 @@ print_thread_info (struct ui_out *uiout, ui_out_field_int (uiout, "id", tp->num); ui_out_text (uiout, " "); - ui_out_field_string (uiout, "target-id", target_tid_to_str (tp->ptid)); + ui_out_field_string (uiout, "target-id", target_pid_to_str (tp->ptid)); extra_info = target_extra_thread_info (tp); if (extra_info) @@ -996,7 +996,7 @@ thread_apply_all_command (char *cmd, int switch_to_thread (tp->ptid); printf_filtered (_("\nThread %d (%s):\n"), - tp->num, target_tid_to_str (inferior_ptid)); + tp->num, target_pid_to_str (inferior_ptid)); execute_command (cmd, from_tty); strcpy (cmd, saved_cmd); /* Restore exact command used previously */ } @@ -1066,7 +1066,7 @@ thread_apply_command (char *tidlist, int switch_to_thread (tp->ptid); printf_filtered (_("\nThread %d (%s):\n"), tp->num, - target_tid_to_str (inferior_ptid)); + target_pid_to_str (inferior_ptid)); execute_command (cmd, from_tty); /* Restore exact command used previously. */ @@ -1091,11 +1091,11 @@ thread_command (char *tidstr, int from_t if (is_exited (inferior_ptid)) printf_filtered (_("[Current thread is %d (%s) (exited)]\n"), pid_to_thread_id (inferior_ptid), - target_tid_to_str (inferior_ptid)); + target_pid_to_str (inferior_ptid)); else printf_filtered (_("[Current thread is %d (%s)]\n"), pid_to_thread_id (inferior_ptid), - target_tid_to_str (inferior_ptid)); + target_pid_to_str (inferior_ptid)); } else error (_("No stack.")); @@ -1139,7 +1139,7 @@ do_captured_thread_select (struct ui_out ui_out_text (uiout, "[Switching to thread "); ui_out_field_int (uiout, "new-thread-id", pid_to_thread_id (inferior_ptid)); ui_out_text (uiout, " ("); - ui_out_text (uiout, target_tid_to_str (inferior_ptid)); + ui_out_text (uiout, target_pid_to_str (inferior_ptid)); ui_out_text (uiout, ")]"); /* Note that we can't reach this with an exited thread, due to the Index: src/gdb/linux-fork.c =================================================================== --- src.orig/gdb/linux-fork.c 2009-02-05 18:42:43.000000000 +0000 +++ src/gdb/linux-fork.c 2009-02-05 18:42:58.000000000 +0000 @@ -439,7 +439,7 @@ delete_fork_command (char *args, int fro error (_("Please switch to another fork/checkpoint before deleting the current one")); if (ptrace (PTRACE_KILL, PIDGET (ptid), 0, 0)) - error (_("Unable to kill pid %s"), target_tid_to_str (ptid)); + error (_("Unable to kill pid %s"), target_pid_to_str (ptid)); if (from_tty) printf_filtered (_("Killed %s\n"), target_pid_to_str (ptid));