Announcement

Collapse
No announcement yet.

Debug and #include

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Debug and #include

    Hi everybody,

    I'm using the debugger and when I need to step into a code that
    is inside a include file I always receive an error message (GPF)
    in PBEDIT when debugging bigger programs.

    This is the error message:

    PBEDIT caused an invalid page fault at module OLEAUT32.DLL at 017f:65341543.
    Registers:
    EAX=00461560 CS=017f EIP=65341543 EFLGS=00010206
    EBX=004d5944 SS=0187 ESP=012cfbf0 EBP=012cfd94
    ECX=00000002 DS=0187 ESI=00003ffc FS=195f
    EDX=8166f27c ES=0187 EDI=8166f274 GS=0000
    Bytes at CS:EIP:
    8b 16 8b c8 83 c2 15 83 e2 f0 52 56 e8 04 00 00
    Stack:
    00004000 0042bc54 00004000 80000000 00000000 004d5944 0042c2b1 8166f274 00000000 00419c6f 00000000 00000000 00000000 00000000 00000000 00000000

    Is there any fix for this ?
    My program is using a Timer proc that is killed before the call
    and resetted after the call. Is this the problem ?
    I also need to set breakpoints outside my main program (inside the includes).

    Thanks,
    Gilmar.

    ------------------

  • #2
    The crash may not necessarily be PBEDIT itself.

    For example, your code could be arbitarily writing over memory incorrecly, such as writing beyond the bounds of an array, bad use of pointers, poor inline assembly, passing parameters incorrectly to Windows API functions, etc. Such activity could cause a memory corruption of the Debugger which subsequently crashes.

    Therefore, without being able to duplicate your problem, it is not possible to guess as to the specific cause.

    To step into code in a #INCLUDE file, try placing a MSGBOX at the point you wish to start single-stepping, then let the code RUN in the debugger. When the MSGBOX appears, hit "STOP" in the debugger and then clear the MSGBOX.

    Alternatively, set a breakpoint at the point the main code calls the code in the #INCLUDE file.


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Lance,

      The program works fine when I'm not using the debugger and
      even if I use the debugger and do not step into the code (using
      shift+F8) the program does not crash.

      When I try to use the MSGBOX and press the STOP button, the debugger
      stops at the CALLBACK procedure of my main window (probably
      because of the timer procedure).

      By now I'm placing all the code that has to be debugged on a
      single file and after that split into include files again.

      Thanks,
      Gilmar.

      PS: Is there any upgrade coming ?

      ------------------

      Comment


      • #4
        Understood, but that still does not totally preclude the possibility of a memory corruption in your code...

        Yes, an update is being actively developed. We have not announced any release date as yet, in keeping with the PowerBASIC "No-Vaporware" policy.


        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment

        Working...
        X