Thread: Remote debug not working in Visual Studio 2003

  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    17

    Angry Remote debug not working in Visual Studio 2003

    Hope this is right place to ask:

    Ive been trying to get my Visual Studio 2003 to remote debug to another pc. And its driving me crazy!

    When I attempt to remote debug with pipe I get a Access is Denied.

    Ive tried many security and registry settings, things Ive tried:

    * The username and password are the same on both the host and the remote machine.
    * Added my account to the Debugger Users group on my pc and the remote pc.
    * Altered reg key to allow other users
    * Using dcomcnfg, under COM Security tab set Edit Limits and Access Permission for ANONYMOUS LOGON account set the Remote Access OK for all. Applied to all other accounts too.
    * Did all the settings as mentioned here: http://support.microsoft.com/kb/833977
    * Disabled firewalls on both.

    The remote pc is definately recieving a message from the host as I can see the host's ip briefly appear when I watch the list of ip's with TcpipView program on the remote pc.

    If I use the TCPIP version of remote debugging and by typing "msvcmon -tcpip -anyuser" on the remote pc, the msvcmon says "Debugging session in progress" on the remote pc when I press F5 on the main pc. But nothing else happens. My pc eventually after about 3 minutes of inactivity returns a popup saying "msvcmon disconnected or youre using pipe". Ughhh.

    Running VS2003 on XP SrvPk2.

    Project is C++.

    Any help much appreciated.

    Thanks

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I have no idea how to solve this problem. Have you tried using WinDBG instead [although that may require that you have serial or firewire connection to the relevant machin, so if the machine is on the other side of the building, it may not help you].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Jun 2008
    Posts
    17
    Hey matsp.

    Wish I could use serial or firewire, but only my pc has both, the laptop doesnt have either.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > the laptop doesnt have either.
    Perhaps a USB to Serial (or Firewire) dongle would be of some use to you then.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Salem View Post
    > the laptop doesnt have either.
    Perhaps a USB to Serial (or Firewire) dongle would be of some use to you then.
    If the target machine has serial port then that would work. I beleive that the target machine goes directly at the serial port (to avoid interlocking problems with driver debugging - otherwise functions that aren't reentrant that are common between "my driver" and the Serial Port driver will not be available to debug - and debugging driver from WinDBG is much of it's purpose in life).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #6
    Registered User
    Join Date
    Jun 2008
    Posts
    17
    Would another option be to get a pcmcia serial or firewire card for the laptop maybe?

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Bassquake View Post
    Would another option be to get a pcmcia serial or firewire card for the laptop maybe?
    Possibly, I'd probably go for the serial variety for two reasons:
    1. In my experience (although that may just be me), Firewire communication in WinDBG is not as reliable as serial port - and I didn't see any great speed difference either.
    2. WinDBG (or rather, the kernel debug module) is picky on which Firewire modules it supports. At the very least, check which Firwire chip the card is built around and check that it's on the "recommended for WinDBG". I believe the reason for the limited support is the same as the serial port being used directly by the kernel rather than using traditiona drivers - the kernel debug module should not interfere with drivers (or the kernel itself for that matter - the MS kernel developers use WinDBG to debug the kernel itself too).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  8. #8
    Registered User
    Join Date
    Jun 2008
    Posts
    17
    Finally got it working!

    If anyones interested heres how:

    * Make an identical account on the remote pc. Same username and password as the pc which your running Visual Studio on.

    Still on the remote pc, now do:

    * Goto Administrative Tools > Local Security Policy
    * Click on Local Policies folder, then Security Options folder.
    * Right click on the line Network access: Sharing and security model for local accounts and choose Properties.
    * Change from Guest Only to Classic.

    Done!

    Debugging with Pipes over the network should work now.

    Good luck.
    Last edited by Bassquake; 08-22-2008 at 07:19 AM.

  9. #9
    Registered User
    Join Date
    Jun 2008
    Posts
    17
    I have another question.

    When I debug, it doesnt copy over the new debug exe. I have to keep manually copying it over to the remote pc. I thought it would do it automatically. Is there a way to?

    Thanks.

  10. #10
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Bassquake View Post
    I have another question.

    When I debug, it doesnt copy over the new debug exe. I have to keep manually copying it over to the remote pc. I thought it would do it automatically. Is there a way to?

    Thanks.
    You can add an "postprocessing step" in Visual Studio that copies it. I never did that, but I used a perl-script that I would run on the build machine to copy the code over to the target machine (it would check the date/time of the file and only copy if it actually changed - and since I did driver development, it would also reboot the machine when the copy was done).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  11. #11
    Registered User
    Join Date
    Jun 2008
    Posts
    17
    Hi matsp.

    Im not familiar with adding a "postprocessing step". Could you elaborate or point me to a tutorial on it? Thanks
    Last edited by Bassquake; 08-22-2008 at 09:06 AM.

  12. #12
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Bassquake View Post
    Hi matsp.

    Im not familiar with adding a "postprocessing step". Could you elaborate or point me to a tutorial on it? Thanks
    It is part of a project in MS Visual Studio - I'm not that familiar with it, as it was about 6 years since I last used it myself [for a similar purpose]. Essentially, it's a box where you enter a command to process after the last of the standard build steps [that is, after linking the executable file].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  13. #13
    Registered User
    Join Date
    Jun 2008
    Posts
    17
    Had a google around. Finally found a solution. How you may ask? (or not )

    * Share your destination folder on the remote pc. Allow Admin permissions or choose user.
    * In Visual Studio, goto the Properties of the project, then to Build List Events, then Post-Build Events.
    * Type in the command box: copy /Y "$(ProjectDir)$(TargetFileName)" "\\MACHINENAME\FOLDER" (alter machinename and folder to whichever it is for you).
    * Press F5 and voila, exe is copied over and executed.

    Last edited by Bassquake; 08-22-2008 at 12:14 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. using classes
    By krazykrisi in forum C++ Programming
    Replies: 9
    Last Post: 11-22-2006, 10:41 AM
  2. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM
  3. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM
  4. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 04:49 AM
  5. Using 'if' with char arrays or string objects
    By c++_n00b in forum C++ Programming
    Replies: 36
    Last Post: 06-06-2002, 09:04 PM