This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: help! redboot console


kneep,
	Yeah, I think so. Endianness should not affect the byte order of a string.
	So the situation is really strange since everything is normal except the byte order of the strings. And the problem can be solved by setting big-endian a second time.
	Please take a look at the gdb.log.txt file. I make some stops in _vprintf() when the problem is happening. Pay attention to the value of 'c' and '*fmt'. It's really strange, isn't it?
if you carefully look through the gdb log you have sent, you will find that even though your GDB's output is messed up, accessing of bytes is still happening in a more regular pattern.

Original byte sequence : B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 ....
GDB display goes in cycle as

B4 - ( B3 B1 B2 ) ( B5 B6 B7 B8 ) ( B12 B11 B9 B10 ) ....
B3 - ( B1 B2 ) ( B5 B6 B7 B8 ) ( B12 B11 B9 B10 ) ....
B2 - ( B1 ) ( B5 B6 B7 B8 ) ( B12 B11 B10 B9 ) ....
B1 - ( B5 B6 B7 B8 ) ( B9 B10 B11 B12 ) ....

your GDB is getting confused in displaying the string. also weird is the treatment it gives to every even group of four bytes formed at multiple of 4 address - by displaying is correctly; and change in display pattern at third step. so GDB display is one issue.

but your accesses are happening as if collection of 4 bytes is swapped in original string. Assuming your string is placed in memory correctly (hey, did you try 'dump memory' from gdb prompt at your string address??), could the suspect be code generation???

you can try the similar thing (accessing the characters of the string one by one) with a simple c program compiled and linked with similar options as you used to build your redboot, and verify if it's a code generation problem or not. alternatively you can have a look at the assembly dump of code around the area in vfnprintf where you have put your breakpoint. having a look at relevant assembly code dump, someone might be able to help you.

If that turns out true, then you might need to pass around some 'target endianness' related flags during your compilation process and give it a shot.

* I am assuming you have same code as in eCos cvs repository *


-- regards sandeep -------------------------------------------------------------------------- I predict that today will be remembered until tomorrow! --------------------------------------------------------------------------


-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]