This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: remote protocol target byte ordering question
- From: Michael Snyder <msnyder at specifix dot com>
- To: Ananth Sowda <asowda at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Tue, 01 Jul 2008 12:11:48 -0700
- Subject: Re: remote protocol target byte ordering question
- References: <c92b40c80806301842l3671c69iaa7fbc0163a5266d@mail.gmail.com>
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.