Call ptid_get_pid instead of get_thread_id in aarch64_linux_get_debug_reg_capacity

Message ID 1437138293-19993-1-git-send-email-yao.qi@linaro.org
State New, archived
Headers

Commit Message

Yao Qi July 17, 2015, 1:04 p.m. UTC
  aarch64_linux_get_debug_reg_capacity is called by
aarch64_linux_child_post_startup_inferior, and argument ptid is created in
inf-ptrace.c:inf_ptrace_create_inferior,

  /* On some targets, there must be some explicit actions taken after
     the inferior has been started up.  */
  target_post_startup_inferior (pid_to_ptid (pid));

so in aarch64_linux_get_debug_reg_capacity, we can get pid by ptid_get_pid,
and don't need to use get_thread_id.

Regression tested on aarch64-linux.  I'll pushed it in.

gdb:

2015-07-17  Yao Qi  <yao.qi@linaro.org>

	* aarch64-linux-nat.c (aarch64_linux_get_debug_reg_capacity): Call
	ptid_get_pid instead of get_thread_id.
---
 gdb/aarch64-linux-nat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 6c95e05..a2247c3 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -644,7 +644,7 @@  aarch64_linux_get_debug_reg_capacity (ptid_t ptid)
   struct iovec iov;
   struct user_hwdebug_state dreg_state;
 
-  tid = get_thread_id (ptid);
+  tid = ptid_get_pid (ptid);
   iov.iov_base = &dreg_state;
   iov.iov_len = sizeof (dreg_state);