From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16323 invoked by alias); 1 Jul 2008 19:12:08 -0000 Received: (qmail 16315 invoked by uid 22791); 1 Jul 2008 19:12:07 -0000 X-Spam-Check-By: sourceware.org Received: from bluesmobile.specifix.com (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 01 Jul 2008 19:11:50 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id A217E3C0AD; Tue, 1 Jul 2008 12:11:48 -0700 (PDT) Subject: Re: remote protocol target byte ordering question From: Michael Snyder To: Ananth Sowda Cc: gdb@sourceware.org In-Reply-To: References: Content-Type: text/plain Date: Tue, 01 Jul 2008 19:12:00 -0000 Message-Id: <1214939508.3601.1551.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-7.fc7) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-07/txt/msg00006.txt.bz2 On Mon, 2008-06-30 at 18:42 -0700, Ananth Sowda wrote: > I know that GDB remote protocol uses target byte ordering for > multi-bytes values as in register set content, memory address or > values to be written to the target memory. I don't see where in the > GDB code this swapping from host to target byte order is done. Can > someone point to the right segment of the code? Thanks for any > pointers. There is a family of conversion functions whose names begin with either "store_" or "extract_", and then a type such as "signed_integer" or "unsigned_long", so eg. "extract_unsigned_integer". When you "extract" a value, you're taking it from target format to host format, and when you "store" one you are sending it from host format to target format.