Loy wrote:
> Thanks Ben and Noah
>
> Seems like we need help from the sos.dll developers
>
> I know this is tricky due to heap compaction by the GC
> Your (Ben) point about memory hit by the GC itself is a good point I
> learned
>
> The complexity of this issue cry for help from Microsoft
> It would be highly appreciated if the next version of SOS will allow
> setting data breakpoint
> - and do all the necessary work to move the breakpoint and ignore GC
> itself reading the memory ... - behind the scenes
> I assume the same issue exists in Visual studio - and might explain
> why conditional breakpoints don't always work
>
> This is a needed tool while debugging and not having it make it harder
> to debug some issues in .net applications.
>
>
> Hope I'm not asking for too much
>
> Loy
>
>
>
>
> Ben Voigt wrote:
> > "Noah Sham" <noahsham@verizon.net> wrote in message
> > news:euWcU248GHA.4808@TK2MSFTNGP03.phx.gbl...
> > > RTM
> > >
http://msdn2.microsoft.com/en-us/library/350dyxd0.aspx > > >
> > > What you want is a data breakpoint. These are only available in C++
> > > navtive code .
> >
> > The essential problem here is that, even though the JIT turns your managed
> > code into native code, and the processor debug registers allow you to break
> > when a memory location is written, the garbage collector will move your
> > variable here, there, and everywhere and not adjust the address in the debug
> > register. Maybe you can find a way using a pinning pointer. Or you could
> > use a (global static) gcroot, set a data breakpoint on that to find out when
> > your variable gets moved around in the gc heap, and then update the data
> > breakpoint on the variable. That breakpoint would be hit once each time the
> > gc collects your generation -- so probably not much fun to track by hand.
> >
> > >
> > >
> > > "Loy" <l.oyolox@gmail.com> wrote in message
> > > news:1161243543.773443.110810@h48g2000cwc.googlegroups.com...
> > >>I still don't have it clear...
> > >>
> > >> Is there (or isn't) a way to set breakpoint on managed variable change?
> > >>
> > >> A property requires change of code and even than - you need to compare
> > >> to previous value and set the breakpoint only if the new value is
> > >> different
> > >>
> > >> When I debug production code using windbg + sos.dll - how can I break
> > >> when, for example, an Int32 variable has changed value?
> > >> And in Visual Studio?
> > >>
> > >> Loy
> > >>
> > >> McWawa wrote:
> > >>> > Encapsulate your variable into a class, use a property or a method to
> > >>> > change
> > >>> > its value, set the breakpoint in the setter or method, and use the
> > >>> > Call
> > >>> > Stack window to locate the calling line.
> > >>>
> > >>> Thank you all.
> > >>>
> > >>> Jeppe Jespersen
> > >>> Denmark
> > >>
> > >
> > >