How to debug application built on another machine?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mihajlo Cvetanoviæ

    #1

    How to debug application built on another machine?

    My application crashed (with the "cannot read memory, press OK to
    terminate or Cancel to debug" message) on the machine that has VC7.1. I
    just copied the original project with pdb file to that machine, opened
    the project, pressed Cancel to the above message, and chose this
    instance of Visual Studio. But I couldn't step through my code, only
    through internal MFC code.

    Does anybody knows what am I doing wrong?
  • Gabest

    #2
    Re: How to debug application built on another machine?

    When the debugger is attached you can see whether it could load the pdb in
    the debug output window. It should say something like "symbols loaded" next
    to your exe or dll.

    "Mihajlo Cvetanoviæ" <mac@RnEeMtOsVe Et.co.yu> wrote in message
    news:uLlB5I$gFH A.3692@TK2MSFTN GP09.phx.gbl...[color=blue]
    > My application crashed (with the "cannot read memory, press OK to
    > terminate or Cancel to debug" message) on the machine that has VC7.1. I
    > just copied the original project with pdb file to that machine, opened the
    > project, pressed Cancel to the above message, and chose this instance of
    > Visual Studio. But I couldn't step through my code, only through internal
    > MFC code.
    >
    > Does anybody knows what am I doing wrong?[/color]


    Comment

    • Gabest

      #3
      Re: How to debug application built on another machine?

      When the debugger is attached you can see whether it could load the pdb in
      the debug output window. It should say something like "symbols loaded" next
      to your exe or dll.

      "Mihajlo Cvetanoviæ" <mac@RnEeMtOsVe Et.co.yu> wrote in message
      news:uLlB5I$gFH A.3692@TK2MSFTN GP09.phx.gbl...[color=blue]
      > My application crashed (with the "cannot read memory, press OK to
      > terminate or Cancel to debug" message) on the machine that has VC7.1. I
      > just copied the original project with pdb file to that machine, opened the
      > project, pressed Cancel to the above message, and chose this instance of
      > Visual Studio. But I couldn't step through my code, only through internal
      > MFC code.
      >
      > Does anybody knows what am I doing wrong?[/color]


      Comment

      • Tomas Restrepo \(MVP\)

        #4
        Re: How to debug application built on another machine?

        Mihajlo,
        [color=blue]
        > My application crashed (with the "cannot read memory, press OK to
        > terminate or Cancel to debug" message) on the machine that has VC7.1. I
        > just copied the original project with pdb file to that machine, opened the
        > project, pressed Cancel to the above message, and chose this instance of
        > Visual Studio. But I couldn't step through my code, only through internal
        > MFC code.
        >
        > Does anybody knows what am I doing wrong?[/color]

        The debugger is probably not finding the symbols for your libraries. Once
        you start debugging, open the Modules Window, and you should see your
        exe/dlls in that list. My bet is that they say "symbols not loaded". If so,
        you can right click on each one and select "Reload Symbols", which will
        bring up a Open File dialog where you can browse for the correct pdb file.

        Also, you'll want to load your source files in VS as well.


        --
        Tomas Restrepo
        tomasr@mvps.org



        Comment

        • Tomas Restrepo \(MVP\)

          #5
          Re: How to debug application built on another machine?

          Mihajlo,
          [color=blue]
          > My application crashed (with the "cannot read memory, press OK to
          > terminate or Cancel to debug" message) on the machine that has VC7.1. I
          > just copied the original project with pdb file to that machine, opened the
          > project, pressed Cancel to the above message, and chose this instance of
          > Visual Studio. But I couldn't step through my code, only through internal
          > MFC code.
          >
          > Does anybody knows what am I doing wrong?[/color]

          The debugger is probably not finding the symbols for your libraries. Once
          you start debugging, open the Modules Window, and you should see your
          exe/dlls in that list. My bet is that they say "symbols not loaded". If so,
          you can right click on each one and select "Reload Symbols", which will
          bring up a Open File dialog where you can browse for the correct pdb file.

          Also, you'll want to load your source files in VS as well.


          --
          Tomas Restrepo
          tomasr@mvps.org



          Comment

          • Mihajlo Cvetanoviæ

            #6
            Re: How to debug application built on another machine?

            Thank you fellows for the useful info, the error was the most obvious
            one: the application and the project don't match, with a half an hour
            distance.

            This only proves the point that whatever job you're trying to rush on
            Friday at 9 PM (like debugging the crash on another machine), it can't
            come out good.

            Saying that, I have another question. Is there a way to force the
            debugger to use inappropriate PDB? Granted, it would show the wrong info
            in some parts of the code, but it would still be usable in other parts.

            Comment

            • Mihajlo Cvetanoviæ

              #7
              Re: How to debug application built on another machine?

              Thank you fellows for the useful info, the error was the most obvious
              one: the application and the project don't match, with a half an hour
              distance.

              This only proves the point that whatever job you're trying to rush on
              Friday at 9 PM (like debugging the crash on another machine), it can't
              come out good.

              Saying that, I have another question. Is there a way to force the
              debugger to use inappropriate PDB? Granted, it would show the wrong info
              in some parts of the code, but it would still be usable in other parts.

              Comment

              • Oleg Starodumov

                #8
                Re: How to debug application built on another machine?

                [color=blue]
                > Saying that, I have another question. Is there a way to force the
                > debugger to use inappropriate PDB? Granted, it would show the wrong info
                > in some parts of the code, but it would still be usable in other parts.[/color]

                Yes, in many cases it is possible:


                Regards,
                Oleg
                [VC++ MVP]





                Comment

                • Mihajlo Cvetanoviæ

                  #9
                  Re: How to debug application built on another machine?

                  Oleg Starodumov wrote:[color=blue][color=green]
                  >>Saying that, I have another question. Is there a way to force the
                  >>debugger to use inappropriate PDB? Granted, it would show the wrong info
                  >>in some parts of the code, but it would still be usable in other parts.[/color]
                  >
                  > Yes, in many cases it is possible:
                  > http://www.debuginfo.com/articles/de...#loadunmatched[/color]

                  That's it, ChkMatch is what I was after (the only better solution is
                  that the debugger allows debug info mismatch). Thank you for the very
                  usable 50 kB piece of code.

                  Comment

                  Working...