From: "Thomas Joseph" <thomaskj@cdactvm.in>
To: <gdb@sourceware.org>
Subject: Alignment error
Date: Mon, 27 Sep 2010 10:11:00 -0000 [thread overview]
Message-ID: <002201cb5e2b$a0f497e0$781110ac@HDG120> (raw)
Hi,
This is regarding the alignment error generated by GDB.
I wrote a small code consisting of following statements for the ARM
platform
int* pInt = (int*)0x10002004; //word-aligned
char* pChar = (char* )0x10003005; //non-word-aligned
*pInt = 0x34;
*pChar = 'A';
The assembly mnemonics for the above two statements are STR and STRB
respectively.
This I made part of the u-boot and build successfully for the smdk2400
platform. But when I debugged with GDB, *pChar = 'A' throwed an
exception.
Later, I put the above code snippet into my own main() and compiled at
the
command prompt without any makefile. This time also STR and STRB
respectively were generated. But it worked without any exception in the
same gdb.
So, the same source code and also the same ASM mnemonic works
differently
with the code generation commands(i.e., gcc).
In this regard, I am searching for the gcc command line argument present
in the u-boot makefile which throws exception in GDB for accessing
non-word-aligned address that corresponds to char*.
Kindly give me useful tips.
Regards,
Thomas Joseph
______________________________________
Scanned and protected by Email scanner
next reply other threads:[~2010-09-27 10:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-27 10:11 Thomas Joseph [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-09-27 10:08 Thomas Joseph
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='002201cb5e2b$a0f497e0$781110ac@HDG120' \
--to=thomaskj@cdactvm.in \
--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