|
From: Scott L. <sc...@sw...> - 2005-06-08 18:18:48
|
John Reiser wrote: > Memcheck waits until as late as possible (just before the program relies > on the uninit value) before complaining. In addition to some theoretic > beauty, this prevents "false positive" complaints. But as you experience, > it is not always the most helpful for finding and fixing problems. I'll throw an idea out there... Each register could carry with it the last memory address it was loaded from. This address is either "NONE" (if the register has been set via an immediate MOV, or other similar operation), or an actual address. Register copies would copy this address to the new register, as well. Then, if the uninitialized register is used, the last known address could be reported. Obviously, this can't work in all cases. Here's one case it wouldn't work (using bastardized AT&T syntax): mov [uninitialized_val], eax add [uninitialized_val], eax In that case, eax consists of a "mixture" of two uninitialized values. Only one of these could be reported (probably the second one). However, not all is lost. The developer would fix the reported case, re-run, and then the other uninitialized value would be reported. Does this idea have any merit? -- Scott Long <sc...@sw...> Software Engineer SwiftView, Inc. (971) 223-2639 |