From: Ashutosh <ashutoshpal2006@gmail.com>
To: Paul_Koning@dell.com
Cc: gdb@sourceware.org
Subject: Re: endianness handling inside gdb
Date: Fri, 23 Oct 2015 07:22:00 -0000 [thread overview]
Message-ID: <CADHm+zu_1JnfrLWyXxAPeZh4APDtC6buRbBVMnLG==mtVK3VSw@mail.gmail.com> (raw)
In-Reply-To: <A619260E-0459-49FC-B318-1BBE778BA31B@dell.com>
Hi paul,
Actually, the ELF that I am dealing with, organizes the data in the
following way:
- all values inside non-allocatable/non-loadable sections like the
dwarf sections are encoded as per the endianness of the ELF
- all the processor-specific (i.e. all loadable) values are encoded as
per the endianness of the target processor
Since all the processor-specific data (code + data sections) are
encoded as per processor's endianness, it will execute fine on it.
But, gdb will interpret the dwarf values incorrectly because it is
using the processor's endianness for the same (as shown in the
code-snippets in the original mail)
Thinking again about this now, the scenario that I mention looks
somewhat uncommon (and may be digressing a bit from the ELF standard);
and probably that's why it's not considered inside Gdb. So for now, I
will proceed further by adapting the dwarf-reader in the gdb code and
keep it locally.
Thanks for your reply.
Regards,
ash
On Fri, Oct 23, 2015 at 12:53 AM, <Paul_Koning@dell.com> wrote:
>
>> On Oct 22, 2015, at 3:01 PM, Ashutosh <ashutoshpal2006@gmail.com> wrote:
>>
>> Hi Experts,
>>
>> Does gdb handles the case where endianness of the ELF file is
>> different from the endianness of the target processor?
>
> That doesn't make any sense. The executable file (I assume that's what you're talking about) is built for the byte order being used. A processor can only execute code that matches the byte order it's using. Either because that's the way the processor is configured, or because it has selectable order and this particular process has selected that order. But a mismatch between processor and executable file byte order doesn't make any more sense than, say, trying to debug on an x86 processor using a MIPS binary.
>
> paul
>
next prev parent reply other threads:[~2015-10-23 7:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-22 19:01 Ashutosh
2015-10-22 19:23 ` Paul_Koning
2015-10-23 7:22 ` Ashutosh [this message]
2015-10-23 11:56 ` Gary Benson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADHm+zu_1JnfrLWyXxAPeZh4APDtC6buRbBVMnLG==mtVK3VSw@mail.gmail.com' \
--to=ashutoshpal2006@gmail.com \
--cc=Paul_Koning@dell.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox