|
From: Bob R. <bo...@br...> - 2005-01-21 14:30:52
|
Hi, When valgrind alerts the user of a 'Conditional jump or move depends on uninitialised value(s)' is there any way it could tell you either - The name of the variable that is causing this to happen - The address of the data that is causing this to happen Here is an example, I am making up the function names, source file and line numbers. The best granularity I get in this example is the source file and line number. ==16717== Conditional jump or move depends on uninitialised value(s) ==16717== at 0x8D32303: func1 (foo.c:100) ==16717== by 0x8D3B7A2: func2 (foo.c:101) ==16717== by 0x8165B2A: func3 (foo.c:102) ==16717== by 0x8166C81: func4 (foo.c:103) Could I get the symbol name causing the problem? What about the address of the variable causing the problem? The reason I ask is because the if statement on the line where valgrind found the error is really complicated and it's difficult for me to determine what symbol is causing the problem. The symbol name would be most helpful, but if that could not be found, the address name would be also. At least, it would be helpful when using the 'db-attach' feature. I could look into adding this feature if it's simple, and if I could be put in the correct direction. Thanks, Bob Rossi |
|
From: Tom H. <th...@cy...> - 2005-01-21 14:51:19
|
In message <20050121143030.GA23610@white>
Bob Rossi <bo...@br...> wrote:
> When valgrind alerts the user of a 'Conditional jump or move depends on
> uninitialised value(s)' is there any way it could tell you either
> - The name of the variable that is causing this to happen
I believe it does try to do this if you use stabs but nobody has
written the necessary code for DWARF yet.
> - The address of the data that is causing this to happen
Once again I believe it does do this if there is one. In this case
the value is probably in a register so there is no address.
> The reason I ask is because the if statement on the line where valgrind
> found the error is really complicated and it's difficult for me to
> determine what symbol is causing the problem. The symbol name would be
> most helpful, but if that could not be found, the address name would be
> also. At least, it would be helpful when using the 'db-attach' feature.
Use VALGRIND_CHECK_READABLE on each variable to see which is causing
the problem.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Nicholas N. <nj...@ca...> - 2005-01-21 23:25:50
|
On Fri, 21 Jan 2005, Tom Hughes wrote: >> determine what symbol is causing the problem. The symbol name would be >> most helpful, but if that could not be found, the address name would be >> also. At least, it would be helpful when using the 'db-attach' feature. > > Use VALGRIND_CHECK_READABLE on each variable to see which is causing > the problem. Or just break up the conditional into multiple lines, such that only one variable is used on each line. That usually works too. N |