linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64 ptrace.c
@ 2013-12-10  6:21 Aaron Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Aaron Liu @ 2013-12-10  6:21 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,

In these dayes, I use gdb to debug my program on ARM foundation model
and fast model with Linux 3.12.0-4.12 from ubuntu.
The gdb reports errors about setting hardware debug register when
stepping pthread_create().
After investigating gdb 7.6.1 source and Linux 3.12 source, I prepare
a patch for arch/arm64/kernel/ptrace.c.
Although the patch could solve gdb error, I am not sure it has no side effects.
May somebody help to give suggestions?
Thank you.

Ref. to https://bugs.launchpad.net/gdb-linaro/+bug/1205391

diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 6777a21..981f961 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -214,9 +214,16 @@ static int ptrace_hbp_fill_attr_ctrl(unsigned int
note_type,
 {
  int err, len, type, disabled = !ctrl.enabled;

+ /*
+  * Does not change type and len in disabled case because it will
+  * break the assertion that only 2 types (TYPE_DATA and TYPE_INST) in
+  * the event linked list in ./kernel/events/hw_breakpoint.c
+  */
  if (disabled) {
- len = 0;
- type = HW_BREAKPOINT_EMPTY;
+ /*
+  * len = 0;
+  * type = HW_BREAKPOINT_EMPTY;
+  */
  } else {
  err = arch_bp_generic_fields(ctrl, &len, &type);
  if (err)
@@ -234,10 +241,10 @@ static int ptrace_hbp_fill_attr_ctrl(unsigned
int note_type,
  default:
  return -EINVAL;
  }
+ attr->bp_len = len;
+ attr->bp_type = type;
  }

- attr->bp_len = len;
- attr->bp_type = type;
  attr->disabled = disabled;

  return 0;
--
Aaron Liu

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-12-12  4:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAAXgzBO1TF=_EdkUieuyf1fbUYx9FVWExqGSi3CcUip7eboMAw@mail.gmail.com>
2013-12-10 11:16 ` [PATCH] arm64 ptrace.c Will Deacon
2013-12-11  7:16   ` Aaron Liu
2013-12-11 17:09     ` Will Deacon
2013-12-12  4:47       ` Aaron Liu
2013-12-10  6:21 Aaron Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).