User talk:Mathieu: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
m (valgrind and unitialized)
m (tweak)
Line 14: Line 14:


Your best bet in that case is to inspect the code at the failing
Your best bet in that case is to inspect the code at the failing
location and see if there is an obvious cause, and if not then to
location and see if there is an obvious cause, and if not then to
try inserting some assertions using the valgrind macros to try and
try inserting some assertions using the valgrind macros to try and
work out what is uninitialised - assertions like this will do it:
work out what is uninitialised - assertions like this will do it:
   
   
   assert( !VALGRIND_CHECK_READABLE( &variable, sizeof( variable ) ) );
   assert( !VALGRIND_CHECK_READABLE( &variable, sizeof( variable ) ) );

Revision as of 19:13, 11 October 2004

Some tricks I always forgot on MacOSX:

ldd -> otools -L

strace/ltrace -> ktrace / kdump


some valgrind 'feature' to gdb an unitialized var you need to use valgrind macro:

From [How to output address of the unitialized value? ]

Your best bet in that case is to inspect the code at the failing location and see if there is an obvious cause, and if not then to try inserting some assertions using the valgrind macros to try and work out what is uninitialised - assertions like this will do it:

  assert( !VALGRIND_CHECK_READABLE( &variable, sizeof( variable ) ) );