Hi all, Valgrind identifies uninitialized memory when it's used in a conditional. It's very smart and can tell when one uninitialized value is assigned to another. I'd like to be able to see is a trace of all of those assignments that lead to the report starting from the reported conditional. Can I?
In the following code for instance valgrind reports line 16. But could it report lines 7,14,15 as well? That would be very useful! In real life the flagged if statement can be far removed from the initial source of the bug! 1 #include<iostream> 2 using std::cerr; 3 using std::endl; 4 5 int fun(int d) 6 { 7 return d+1; 8 } 9 10 int main(int argc, char **argv) 11 { 12 int r,q,j; 13 14 q=j; 15 r=fun(q); 16 if (r) { ++k; } 17 cerr << k << endl; 18 19 return 0; 20 } -- Burlen Loring Kitware, Inc. R&D Engineer 28 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-371-3971 x137 ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users