From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93763 invoked by alias); 25 Aug 2015 13:12:05 -0000 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 Received: (qmail 93753 invoked by uid 89); 25 Aug 2015 13:12:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f53.google.com Received: from mail-pa0-f53.google.com (HELO mail-pa0-f53.google.com) (209.85.220.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 25 Aug 2015 13:12:03 +0000 Received: by pabzx8 with SMTP id zx8so33354090pab.1 for ; Tue, 25 Aug 2015 06:12:01 -0700 (PDT) X-Received: by 10.69.2.69 with SMTP id bm5mr55851883pbd.41.1440508321407; Tue, 25 Aug 2015 06:12:01 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id kd3sm21145054pad.15.2015.08.25.06.11.58 (version=TLS1_2 cipher=AES128-SHA256 bits=128/128); Tue, 25 Aug 2015 06:12:00 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH 04/13] Get pid rather than lwpid References: <1439913199-22882-1-git-send-email-yao.qi@linaro.org> <1439913199-22882-5-git-send-email-yao.qi@linaro.org> <55DC47C6.9090603@redhat.com> Date: Tue, 25 Aug 2015 13:12:00 -0000 In-Reply-To: <55DC47C6.9090603@redhat.com> (Pedro Alves's message of "Tue, 25 Aug 2015 11:47:34 +0100") Message-ID: <86bndv1pif.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00724.txt.bz2 Pedro Alves writes: > This doesn't really make sense to me. We're changing debug registers > of an LWP, so we should print the LWP's pid, not the thread group > leader's pid. Since the local variable is named 'pid' and the string literal in the debugging output is 'pid' too, I thought pid should be printed. This patch renames the variable and prints lwpid rather than pid. --=20 Yao (=E9=BD=90=E5=B0=A7) =46rom f0dc39d1a71f6c05c1f09fe8c83e01e3187beec9 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Tue, 25 Aug 2015 14:08:45 +0100 Subject: [PATCH] Print tid in debug output of debug_reg_change_callback In debug_reg_change_callback, we change debug registers of each LWP. It makes more sense to print LWP's pid rather than group leader's pid. gdb: 2015-08-25 Yao Qi * nat/aarch64-linux-hw-point.c (debug_reg_change_callback): Rename local variable pid to tid, and get lwpid of lwp. Update debug output. diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-po= int.c index e4a2f8e..c3fe7dd 100644 --- a/gdb/nat/aarch64-linux-hw-point.c +++ b/gdb/nat/aarch64-linux-hw-point.c @@ -248,7 +248,7 @@ debug_reg_change_callback (struct lwp_info *lwp, void *= ptr) { struct aarch64_dr_update_callback_param *param_p =3D (struct aarch64_dr_update_callback_param *) ptr; - int pid =3D ptid_get_pid (ptid_of_lwp (lwp)); + int tid =3D ptid_get_lwp (ptid_of_lwp (lwp)); int idx =3D param_p->idx; int is_watchpoint =3D param_p->is_watchpoint; struct arch_lwp_info *info =3D lwp_arch_private_info (lwp); @@ -264,8 +264,8 @@ debug_reg_change_callback (struct lwp_info *lwp, void *= ptr) if (show_debug_regs) { debug_printf ("debug_reg_change_callback: \n\tOn entry:\n"); - debug_printf ("\tpid%d, dr_changed_bp=3D0x%s, " - "dr_changed_wp=3D0x%s\n", pid, + debug_printf ("\ttid%d, dr_changed_bp=3D0x%s, " + "dr_changed_wp=3D0x%s\n", tid, phex (info->dr_changed_bp, 8), phex (info->dr_changed_wp, 8)); } @@ -290,8 +290,8 @@ debug_reg_change_callback (struct lwp_info *lwp, void *= ptr) =20 if (show_debug_regs) { - debug_printf ("\tOn exit:\n\tpid%d, dr_changed_bp=3D0x%s, " - "dr_changed_wp=3D0x%s\n", pid, + debug_printf ("\tOn exit:\n\ttid%d, dr_changed_bp=3D0x%s, " + "dr_changed_wp=3D0x%s\n", tid, phex (info->dr_changed_bp, 8), phex (info->dr_changed_wp, 8)); }