Thread: How to debug a Service?

  1. #1
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545

    How to debug a Service?

    Hi,
    I found out how to do remote debugging, but now I need to debug a service.
    How would I go about setting a breakpoint in a service on a remote machine, since it's Windows that starts the service, not Visual Studio?
    BTW, this is VC++ 6.0.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    You can use "attach to process", I'm 99.9% sure that Visual Studio supports that.

    --
    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
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Attach to process on a remote machine?

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Well, if visual studio can't do that [which I don't know for sure], and you are reasonably close to the target machine, you could use a serial cable to link the two, and then use the WinDBG debugger - it's not as slick as Visual Studio, but on the other hand it's powerful - it's more like a big 4-wheel drive truck than a Mercedes saloon car, if you see what I mean. But you can certainly step through your code, set breakpoints, view variables, etc.

    If you aren't close enough to connect a serial cable [or Firewire], then I don't know what to do - get yourself closer, I suppose.

    --
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. running my program as service
    By daher in forum Windows Programming
    Replies: 5
    Last Post: 09-05-2008, 12:30 PM
  2. Windows service status checking
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 06-01-2008, 08:19 AM
  3. makefiles - debug & release?
    By cpjust in forum C Programming
    Replies: 6
    Last Post: 10-26-2007, 04:00 PM
  4. eek a virus
    By MisterSako in forum Tech Board
    Replies: 17
    Last Post: 06-08-2005, 03:29 PM
  5. Another windows service question... starting/stopping
    By BrianK in forum Windows Programming
    Replies: 1
    Last Post: 03-20-2003, 12:22 AM