This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v7.1] Support software single step on ARM in GDBServer.
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Antoine Tremblay <antoine dot tremblay at ericsson dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 11 Dec 2015 14:43:23 +0000
- Subject: Re: [PATCH v7.1] Support software single step on ARM in GDBServer.
- Authentication-results: sourceware.org; auth=none
- References: <1449583641-18156-7-git-send-email-antoine dot tremblay at ericsson dot com> <1449691701-11845-1-git-send-email-antoine dot tremblay at ericsson dot com>
Antoine Tremblay <antoine.tremblay@ericsson.com> writes:
> + /* Assume all atomic sequences start with a ldrex{,b,h,d} instruction. */
> + insn1 = self->ops->read_memory_unsigned_integer (loc, 2, byte_order_for_code);
> +
> + loc += 2;
> + if (thumb_insn_size (insn1) != 4)
> + return NULL;
> +
> + insn2 = self->ops->read_memory_unsigned_integer (loc, 2, byte_order_for_code);
> +
This line is too long, you may define a macro to shorten
"self->ops->read_memory_unsigned_integer".
> + loc += 2;
> + if (!((insn1 & 0xfff0) == 0xe850
> + || ((insn1 & 0xfff0) == 0xe8d0 && (insn2 & 0x00c0) == 0x0040)))
> + return NULL;
> +
> + /* Assume that no atomic sequence is longer than "atomic_sequence_length"
> + instructions. */
> + for (insn_count = 0; insn_count < atomic_sequence_length; ++insn_count)
> + {
> + insn1
> + = self->ops->read_memory_unsigned_integer (loc, 2,byte_order_for_code);
> + loc += 2;
> +
> + if (thumb_insn_size (insn1) != 4)
> + {
> + /* Assume that there is at most one conditional branch in the
> + atomic sequence. If a conditional branch is found, put a
> + breakpoint in its destination address. */
> + if ((insn1 & 0xf000) == 0xd000 && bits (insn1, 8, 11) != 0x0f)
> + {
> + if (last_breakpoint > 0)
> + return NULL; /* More than one conditional branch found,
> + fallback to the standard code. */
> +
> + breaks[1] = loc + 2 + (sbits (insn1, 0, 7) << 1);
> + last_breakpoint++;
> + }
> +
> + /* We do not support atomic sequences that use any *other*
> + instructions but conditional branches to change the PC.
> + Fall back to standard code to avoid losing control of
> + execution. */
> + else if (thumb_instruction_changes_pc (insn1))
> + return NULL;
> + }
> + else
> + {
> + insn2 = self->ops->read_memory_unsigned_integer
> + (loc, 2, byte_order_for_code);
Format looks wrong, multiple instances of this problem in the patch.
--
Yao (éå)