From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29978 invoked by alias); 14 Sep 2015 12:41:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 29965 invoked by uid 89); 14 Sep 2015 12:41:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg21.ericsson.net Received: from usevmg21.ericsson.net (HELO usevmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 14 Sep 2015 12:41:24 +0000 Received: from EUSAAHC005.ericsson.se (Unknown_Domain [147.117.188.87]) by usevmg21.ericsson.net (Symantec Mail Security) with SMTP id 5C.57.26730.1A556F55; Mon, 14 Sep 2015 07:05:37 +0200 (CEST) Received: from [142.133.110.95] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.89) with Microsoft SMTP Server id 14.3.248.2; 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. To: Yao Qi References: <1441973603-15247-1-git-send-email-antoine.tremblay@ericsson.com> <1441973603-15247-6-git-send-email-antoine.tremblay@ericsson.com> <8637yh5kpz.fsf@gmail.com> CC: From: Antoine Tremblay Message-ID: <55F6C071.1040104@ericsson.com> Date: Mon, 14 Sep 2015 12:41:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <8637yh5kpz.fsf@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00284.txt.bz2 On 09/14/2015 07:00 AM, Yao Qi wrote: > Antoine Tremblay 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.