From: Antoine Tremblay <antoine.tremblay@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Antoine Tremblay <antoine.tremblay@ericsson.com>
Subject: [PATCH 5/5] Support software breakpoints for ARM linux in GDBServer.
Date: Fri, 18 Sep 2015 12:03:00 -0000 [thread overview]
Message-ID: <1442577749-6650-6-git-send-email-antoine.tremblay@ericsson.com> (raw)
In-Reply-To: <1442577749-6650-1-git-send-email-antoine.tremblay@ericsson.com>
This patch implements the breakpoint_from_length operation introduced
in a previous patch.
The proper breakpoint can then be returned to be inserted in memory.
It also enables Z0 packets on ARM.
No regressions, tested on ubuntu 14.04 ARMv7 and x86.
With gdbserver-{native,extended} / { -marm -mthumb }
gdb/ChangeLog:
* NEWS: Add news for software breakpoints.
gdb/gdbserver/ChangeLog:
* linux-arm-low.c (arm_breakpoint_from_length): New function.
(arm_supports_z_point_type): Add software breakpoint support.
(struct linux_target_ops): Add breakpoint_from_length operation.
---
gdb/NEWS | 2 ++
gdb/gdbserver/linux-arm-low.c | 31 +++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+)
diff --git a/gdb/NEWS b/gdb/NEWS
index f563b8c..85f234e 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,8 @@
*** Changes since GDB 7.10
+* Support for software breakpoints on ARM linux was added in GDBServer.
+
* Support for tracepoints on aarch64-linux was added in GDBserver.
* The 'record instruction-history' command now indicates speculative execution
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index 15ecb70..9685db5 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -354,6 +354,28 @@ arm_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
}
}
+/* Get the breakpoint from the remote length
+ 2 is thumb-16
+ 3 is thumb2-32
+ 4 is arm
+*/
+static const unsigned char *
+arm_breakpoint_from_length (int *len)
+{
+ switch (*len) {
+ case 2:
+ return (unsigned char *) &thumb_breakpoint;
+ case 3:
+ *len = 4;
+ return (unsigned char *) &thumb2_breakpoint;
+ case 4:
+ return (unsigned char *) &arm_breakpoint;
+ default:
+ return NULL;
+ }
+ return NULL;
+}
+
/* We only place breakpoints in empty marker functions, and thread locking
is outside of the function. So rather than importing software single-step,
we can just run until exit. */
@@ -595,6 +617,7 @@ arm_supports_z_point_type (char z_type)
{
switch (z_type)
{
+ case Z_PACKET_SW_BP:
case Z_PACKET_HW_BP:
case Z_PACKET_WRITE_WP:
case Z_PACKET_READ_WP:
@@ -1006,6 +1029,14 @@ struct linux_target_ops the_low_target = {
arm_new_thread,
arm_new_fork,
arm_prepare_to_resume,
+ NULL, /* process_qsupported */
+ NULL, /* supports_tracepoints */
+ NULL, /* get_thread_area */
+ NULL, /* install_fast_tracepoint_jump_pad */
+ NULL, /* emit_ops */
+ NULL, /* get_min_fast_tracepoint_insn_len */
+ NULL, /* supports_range_stepping */
+ arm_breakpoint_from_length,
};
void
--
1.9.1
next prev parent reply other threads:[~2015-09-18 12:03 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-18 12:02 [PATCH 0/5] Software breakpoints support for ARM linux Antoine Tremblay
2015-09-18 12:02 ` [PATCH 2/5] Make breakpoint and breakpoint_len local variables in GDBServer Antoine Tremblay
2015-09-28 9:55 ` Yao Qi
2015-09-28 10:05 ` Eli Zaretskii
2015-09-28 21:01 ` Antoine Tremblay
2015-09-28 20:59 ` Antoine Tremblay
2015-09-18 12:03 ` Antoine Tremblay [this message]
2015-09-18 12:03 ` [PATCH 1/5] Support multiple breakpoint types per target " Antoine Tremblay
2015-09-23 10:51 ` Yao Qi
2015-09-23 12:37 ` Antoine Tremblay
2015-09-23 14:46 ` Yao Qi
2015-09-23 14:56 ` Antoine Tremblay
2015-09-18 12:03 ` [PATCH 4/5] Handle breakpoint kinds for software breakpoints " Antoine Tremblay
2015-09-28 10:33 ` Yao Qi
2015-09-29 11:55 ` Antoine Tremblay
2015-09-18 12:03 ` [PATCH 3/5] Add support for ARM breakpoint types " Antoine Tremblay
2015-09-28 10:29 ` Yao Qi
2015-09-28 21:26 ` Antoine Tremblay
2015-09-29 8:32 ` Yao Qi
2015-09-29 11:38 ` Antoine Tremblay
2015-09-29 11:43 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1442577749-6650-6-git-send-email-antoine.tremblay@ericsson.com \
--to=antoine.tremblay@ericsson.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox