* Alignment error
@ 2010-09-27 10:08 Thomas Joseph
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Joseph @ 2010-09-27 10:08 UTC (permalink / raw)
To: gdb
Hi,
This is regarding to the alignment error generated by GDB when compiled
in
same GCC with u-boot makefile.
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Alignment error
@ 2010-09-27 10:11 Thomas Joseph
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Joseph @ 2010-09-27 10:11 UTC (permalink / raw)
To: gdb
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-27 10:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-27 10:08 Alignment error Thomas Joseph
2010-09-27 10:11 Thomas Joseph
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox