This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 5/7] Add support for software single step on ARM aarch32-linux in GDBServer.
- From: Antoine Tremblay <antoine dot tremblay at ericsson dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Mon, 14 Sep 2015 08:41:21 -0400
- Subject: Re: [PATCH 5/7] Add support for software single step on ARM aarch32-linux in GDBServer.
- Authentication-results: sourceware.org; auth=none
- References: <1441973603-15247-1-git-send-email-antoine dot tremblay at ericsson dot com> <1441973603-15247-6-git-send-email-antoine dot tremblay at ericsson dot com> <8637yh5kpz dot fsf at gmail dot com>
On 09/14/2015 07:00 AM, Yao Qi wrote:
Antoine Tremblay <antoine.tremblay@ericsson.com> writes:
- GDBServer needs to know the correct endianness to write that breakpoint
properly.
Why does GDBserver need to care about endianess? Isn't GDBserver of the
same endianess as the inferior?
Usually it will be , however see commit :
dcd4a3a4e7fc3912194d1346d2dfc6252f70b456
Which I will partially quote here :
"tdep->arm_breakpoint, tdep->thumb_breakpoint, tdep->thumb2_breakpoint
should be set le_ variants in case of arm BE8 code. Those instruciton
sequences are writen to target with simple write_memory, without
regarding gdbarch_byte_order_for_code. But in BE8 case even data
memory is in big endian form, instructions are still in little endian
form."
So in BE8 code the instructions are not of the same endianness as the
data memory...
Also even if unlikely you could have a BE program being debugged in a LE
GDBServer assuming the proper BE libs are also present on the system.
Thus, GDB makes no assumptions about the endianness being the same as
it's own and I don't think GDBServer should either.