Memory Write Breakpoint in vc7

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anil Aksay

    #1

    Memory Write Breakpoint in vc7

    I need to put a breakpoint when a particular memory location is
    written. To be more specific I want to know when 0 is written onto that
    memory location. Is there a way to do it in vc7?

    Regards,

    Anil.

  • David Lowndes

    #2
    Re: Memory Write Breakpoint in vc7

    >I need to put a breakpoint when a particular memory location is[color=blue]
    >written. To be more specific I want to know when 0 is written onto that
    >memory location. Is there a way to do it in vc7?[/color]

    Anil,

    Use the Data tab page of the New Breakpoint dialog.

    Dave

    Comment

    • Anil Aksay

      #3
      Re: Memory Write Breakpoint in vc7

      Data tab page requires a variable in some context. There is a local
      variable in some function but it is overwritten by someone else. I've
      debugged and everytime that function is called variable has the same
      address. Code is as follows:

      int variable = a/b;
      ASSERT(variable );
      c = d / variable;

      when assert break the application, I've checked that a/b result is 14,
      however the variable has 0 inside. The address of the variable is
      0x975f328. (everytime we enter that code segment the address is same).
      And assert only stops occasionally.

      So I want to put a breakpoint when that variable is overwritten by
      another thread.

      In the new Data tab page there are following items:

      Variable:
      Context:
      Condition:

      I've tried to write something like:

      (* ((int *)(0x975f328))) == 0

      in either condition or variable edit box but it refuses that it is not
      proper.

      What can I do about it?

      Anil.



      -David Lowndes'in mesaji: > >I need to put a breakpoint when a
      particular memory location is[color=blue][color=green]
      > >written. To be more specific I want to know when 0 is written onto that
      > >memory location. Is there a way to do it in vc7?[/color]
      >
      > Anil,
      >
      > Use the Data tab page of the New Breakpoint dialog.
      >
      > Dave[/color]

      Comment

      • Anil Aksay

        #4
        Re: Memory Write Breakpoint in vc7

        actually i've managed to put the breakpoint but since it is a local
        variable address.. many places in the application use that memory quite
        often. now i need to find a better way to find who actually wrote after
        variable is defined and before its context finishes.

        any suggestions?

        -Anil Aksay'in mesaji: > Data tab page requires a variable in some
        context. There is a local[color=blue]
        > variable in some function but it is overwritten by someone else. I've
        > debugged and everytime that function is called variable has the same
        > address. Code is as follows:
        >
        > int variable = a/b;
        > ASSERT(variable );
        > c = d / variable;
        >
        > when assert break the application, I've checked that a/b result is 14,
        > however the variable has 0 inside. The address of the variable is
        > 0x975f328. (everytime we enter that code segment the address is same).
        > And assert only stops occasionally.
        >
        > So I want to put a breakpoint when that variable is overwritten by
        > another thread.
        >
        > In the new Data tab page there are following items:
        >
        > Variable:
        > Context:
        > Condition:
        >
        > I've tried to write something like:
        >
        > (* ((int *)(0x975f328))) == 0
        >
        > in either condition or variable edit box but it refuses that it is not
        > proper.
        >
        > What can I do about it?
        >
        > Anil.
        >
        >
        >
        > -David Lowndes'in mesaji: > >I need to put a breakpoint when a
        > particular memory location is[color=green][color=darkred]
        > > >written. To be more specific I want to know when 0 is written onto that
        > > >memory location. Is there a way to do it in vc7?[/color]
        > >
        > > Anil,
        > >
        > > Use the Data tab page of the New Breakpoint dialog.
        > >
        > > Dave[/color][/color]

        Comment

        • David Lowndes

          #5
          Re: Memory Write Breakpoint in vc7

          >any suggestions?

          If you're not already doing these, I'd ensure I had all the compiler
          run-time checks enabled, compile at the highest warning level, and if
          they don't show anything, try a product such as bounds checker or
          purify.

          Dave
          --
          MVP VC++ FAQ: http://www.mvps.org/vcfaq

          Comment

          Working...