Re: Mysteriously changing variable

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Oleg Starodumov (com-dot-debuginfo-at-oleg)
Date: 12/03/04

  • Next message: Illia Baidakov: "Re: So many string types!"
    Date: Fri, 3 Dec 2004 10:35:20 +0200
    
    

    > Actually com dll is the only programing I have done in C++ so I have never
    > used breakpoints. But in the other languages I've used you can only use
    > breakpoints in the IDE. So how do you run the dll in your IDE?
    >

    How to debug a DLL:
    http://msdn.microsoft.com/library/en-us/vccore98/html/_core_methods_for_debugging_dlls.asp

    Then, after you have reproduced the problem again,
    set a data breakpoint on the variable that changes unexpectedly:

    1. Set a normal breakpoint in the function that contains the variable.
    Wait until this breakpoint is hit.

    2. Obtain the address of the variable (e.g. by entering "&l_MyVariable"
    in Watch window).

    3. Open Data tab in Breakpoints window
    (Edit | Breakpoints | Data)

    4. Enter the address of the variable into "Enter the expression to be evaluated" field,
    and enter 4 into "... the number of elements to watch ..." field.

    5. Step through the function and wait until the data breakpoint is hit.
    If it is hit, the debugger can stop at the line that wrote into the variable,
    or on the next line after it.

    Note that after the function with the local variable returns, you should deactivate
    the data breakpoint, because its location on the stack will be reused
    and something else can be stored there, thus triggering the breakpoint again,
    which will be a "false alarm".

    Also compile the DLL with /GZ compiler option.

    Regards,
    Oleg


  • Next message: Illia Baidakov: "Re: So many string types!"

    Relevant Pages

    • Re: Compact Framework 2.0 team needs to finish the .NET CF 2.0 release
      ... is that breakpoint in the DLL which is dynamically loaded (or ... First investigations seems that the IDE for some reason are not deploying ... debugging to a USB attached device is faster. ...
      (microsoft.public.dotnet.framework.compactframework)
    • Re: Breakpoint not hit
      ... > another DLL. ... > wonder how one would specify which DLL the breakpoint is to be set in? ... (IMO this is the most error-prone moment in library debugging) ... * Check that the DLLs are built with debug information (default Debug configuration ...
      (microsoft.public.vc.language)
    • Re: Breakpoint not hit
      ... > another DLL. ... > wonder how one would specify which DLL the breakpoint is to be set in? ... (IMO this is the most error-prone moment in library debugging) ... * Check that the DLLs are built with debug information (default Debug configuration ...
      (microsoft.public.vc.debugger)
    • Breakpoints and Visual Studio 2005
      ... The DLL compiles fine, gets registered automatically, gets referenced correctly when the C# program compiles, and gets called correctly during execution. ... During execution of the DLL, a call to the ATL/MFC shared library method CImage::Create returns FALSE.So I tried to set a breakpoint before the call. ... Visual Studio displays a brown dot saying that the breakpoint is valid. ...
      (microsoft.public.dotnet.languages.vc)
    • Re: ms word addin doesent load (HELP) 1235711
      ... I ordered a virtual machin and I blive I ll have it on sunday. ... breakpoint to the line of the messagebox then the breakpoint is ignored even ... Does it imply that my dll is corrupted and it is causing problems when being ... Is there a way to reset all office settings without reinstalling it. ...
      (microsoft.public.office.developer.com.add_ins)