|
From: <ps...@ic...> - 2003-08-14 09:38:26
|
Hi there Many thanks for Valgrind I have been using it since 1.0.0 to clean all my applications, but now I am developing on a non-Intel platform. Solution is easy: i just develop on Linux, and recompiled later. However, the target platform (ARM) does not allow non-aligned short and int accesses. It also does not show up the error - the result of non-aligned access is cache corruption (ouch). I would really appreciate a feature being added to detect non-aligned access - i.e. could the valgrind VM halt if it reads or writes a 2-byte value from an odd address? or a 4-byte value from a non-4-aligned address? (or have an option to give a warning?) This is possibly a good feature for others as well - it can ensure portability of your code to the SPARC, for example. (Note that I am aware of the -Wcast-align option to gcc, but trying to make code free of this warning is sometimes too difficult a task for legacy code - certainly for myself at this point.) many thanks -paul --------------------------------------------- This message was sent using World Mail. http://www.worldonline.co.za |
|
From: Tom H. <th...@cy...> - 2003-08-14 10:36:34
|
In message <E19...@sc...>
ps...@ic... wrote:
> However, the target platform (ARM) does not allow
> non-aligned short and int accesses. It also does not show
> up the error - the result of non-aligned access is cache
> corruption (ouch).
I don't believe that the ARM will corrupt the cache if you do an
unaligned access but what it will do is load a wierd rotated value
that you won't be expecting. The behaviour is well defined, if a
little on the odd side, and truly sick people have been known to
write code that relies on it ;-)
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|