[04/13] Get pid rather than lwpid

Message ID 1439913199-22882-5-git-send-email-yao.qi@linaro.org
State New, archived
Headers

Commit Message

Yao Qi Aug. 18, 2015, 3:53 p.m. UTC
  We print PID rather than LWPID in the debug output, so we need call
ptid_get_pid in debug_reg_change_callback.

gdb:

2015-08-18  Yao Qi  <yao.qi@linaro.org>

	* aarch64-linux-nat.c (debug_reg_change_callback): Call
	ptid_get_pid rather than ptid_get_lwp.
---
 gdb/aarch64-linux-nat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Pedro Alves Aug. 25, 2015, 10:47 a.m. UTC | #1
On 08/18/2015 04:53 PM, Yao Qi wrote:
> We print PID rather than LWPID in the debug output, so we need call
> ptid_get_pid in debug_reg_change_callback.

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.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index e41f750..d530019 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -165,7 +165,7 @@  debug_reg_change_callback (struct lwp_info *lwp, void *ptr)
 {
   struct aarch64_dr_update_callback_param *param_p
     = (struct aarch64_dr_update_callback_param *) ptr;
-  int pid = ptid_get_lwp (lwp->ptid);
+  int pid = ptid_get_pid (lwp->ptid);
   int idx = param_p->idx;
   int is_watchpoint = param_p->is_watchpoint;
   struct arch_lwp_info *info = lwp->arch_private;