> Hello, I was wondering if it is possible to partially mark
> a memory location as undefined when running under valgrind.

Quoting the documentation  http://valgrind.org/info/tools.html :
>  Memcheck tracks addressability at the byte-level, and initialisation of 
> values at the bit-level. As a result, it can detect the use of single 
> uninitialised bits, and does not report spurious errors on bitfield operations

Therefore: Run memcheck under a debugger, and watch while memcheck checks this 
program:
-----
#include <stdlib.h>
int *p;
int main()
{
        p = (int *)malloc(100);
        p[5] &= 0xec6da539;  /* clear some bits, leave the rest uninit */
        return p[0xff & p[5]];  /* indexing by uninit is an immediate error */
}
-----

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to