Debugging with VS.net 2003 + Attach to Process

Discussion in 'Xbox (Original console)' started by nullChar, Oct 22, 2015.

  1. nullChar

    nullChar Active Member

    Joined:
    Jan 12, 2012
    Messages:
    32
    Likes Received:
    12
    I'm running WinXP within VirtualBox on Windows 10. I'd like to be able to debug C++ code running on console from within VS.net 2003. Is this possible with a green debug kit?

    I'm building my code against XDK5933, and Xbox Neighborhood can connect with the kit.
    I can deploy my binaries to the console, and execute, but when I attempt to either
    1. Start Debugging in VS
    or
    2. Attach to remote console process, I get the following error message:

    "Unable to start debugging. Unable to start program 'xe:\[MyProjectName]\BinaryName.xbe'"

    Is debugging code only possible with a crystal development kit?
    Is Visual Studio somehow unable to connect to my target kit, while Xbox Neighborhood can?
    Also, is it possible to mod a green debug kit to behave identically to a development kit?

    Thanks!

    EDIT:

    After some fiddling with Property pages, I found that it's necessary to configure VirtualBox's network adapter to "Bridged Adapter." (See: http://www.emuxtras.net/forum/viewtopic.php?f=193&t=4132) It won't work with any other setup.

    So now I can debug a running process, but VS isn't hitting my breakpoints... I'll keep investigating.
     
    Last edited: Oct 23, 2015
    nonosto likes this.
  2. nonosto

    nonosto Intrepid Member

    Joined:
    Jan 5, 2012
    Messages:
    698
    Likes Received:
    53
    Virtualbox, you mean via Win 7 or higher?
     
  3. weinerschnitzel

    weinerschnitzel Spirited Member

    Joined:
    Sep 23, 2012
    Messages:
    153
    Likes Received:
    13
    As long as you have a proper debug enabled BIOS, debugging is all the same for modded Xbox's, debug kits, and dev kits. The real dev kit is really only useful if you want to run your code on an emulated DVD on your dev PC's Raptor card, or for kernel debugging. Always wanted to put the Raptor card in external housing with a USB->PCI adapter and see if I could use it in VirtualBox. One day...

    I just ran a debug session via Bridged Adapter on VirtualBox. Everything worked, including breakpoints, as it should. NAT always worked fine for Xbox Neighborhood, and IIRC FTP transfers were faster. Now, I do remember having issues on an old XP laptop where I could not use the debugger. I want to attribute it to some Windows XP update, or that registry hack that gives you another 5 years of support, pretending your OS is Windows XP Embedded Edition. My current dev environment VBox 5 and "vanilla" XP + SP3 works just fine.

    Hope this helps. What are you tinkering with, btw?
     
  4. nullChar

    nullChar Active Member

    Joined:
    Jan 12, 2012
    Messages:
    32
    Likes Received:
    12
    @nonosto: Yep, running a WindowsXP SP3 install within VirtualBox on Windows 10.

    @weinerschnitzel Thanks,
    I was ultimately able to get debugging fully working, and I think the problem was related to symbols not being loaded for the xbe being debugged. I had been using a UNC path to my project, because it lived in a folder shared with my host system. Looks like the debugger had a problem with it. Just playing around with the hardware really, and wanting to try a small port of something.

    Cool, now I can have some fun!
    [​IMG]
     
    nonosto likes this.
  5. nonosto

    nonosto Intrepid Member

    Joined:
    Jan 5, 2012
    Messages:
    698
    Likes Received:
    53
    Thank you, do you think work with Win 7 64 bit and Win XP mode for "emulate" XP 32 bit?
     
  6. Borman

    Borman Digital Games Curator

    Joined:
    Mar 24, 2005
    Messages:
    9,537
    Likes Received:
    1,856
    XP mode should work.
     
  7. nonosto

    nonosto Intrepid Member

    Joined:
    Jan 5, 2012
    Messages:
    698
    Likes Received:
    53
    Thanks...I have a XP partiton only for it, and I would llike create a neww HDD without XP partition.
     
  8. nonosto

    nonosto Intrepid Member

    Joined:
    Jan 5, 2012
    Messages:
    698
    Likes Received:
    53
    Hello could you explain how to please? I succes to compil and run .xbe but impossible to debug it.
     
  9. nullChar

    nullChar Active Member

    Joined:
    Jan 12, 2012
    Messages:
    32
    Likes Received:
    12
    You were successfully able to build your project within Visual Studio, but aren't able to set+hit breakpoints and step through code?
    Can you deploy the .xbe to the console?
    How about trying the steps in the attached image below? Once you select a console, it should show you a list of processes running on the system, which you can attempt to attach to.
    attachToProcess.png
     
    nonosto likes this.
  10. nonosto

    nonosto Intrepid Member

    Joined:
    Jan 5, 2012
    Messages:
    698
    Likes Received:
    53
    THX very much I try but dont run....

    [​IMG]

    [​IMG]

    [​IMG]
    [​IMG]

    Any idea please?
     
  11. nullChar

    nullChar Active Member

    Joined:
    Jan 12, 2012
    Messages:
    32
    Likes Received:
    12
    Hey nonosto,

    When you press Debug -> Start in Visual Studio, it should automatically start the .xbe and attach to the new process.
    Does it not?

    I see that you're able to view registers, which means that you can successfully attach.
    You have a breakpoint on line 92. Does the debugger pause on line 92, or do you immediately crash with "Unhandled exception at ..."?
     
  12. nonosto

    nonosto Intrepid Member

    Joined:
    Jan 5, 2012
    Messages:
    698
    Likes Received:
    53
    THX
    Unfortanally not I have this:
    [​IMG]


    Same thing above.

    In output I have it:

    'xboxkrnl.exe': Loaded 'xboxkrnl.exe', No symbols loaded.
    'xboxkrnl.exe': Loaded 'xbdm.dll', No symbols loaded.
    'xboxkrnl.exe': Loaded 'vx.dxt', No symbols loaded.
    The program '[cee5a22e] Hello_World_3.xbe: Native' has exited with code 0 (0x0).
     
  13. nullChar

    nullChar Active Member

    Joined:
    Jan 12, 2012
    Messages:
    32
    Likes Received:
    12
    Hmm... My output window at least mentions my .xbe's name, and that symbols were loaded correctly:
    'HelloXbox.xbe': Loaded 'HelloXbox.exe', Symbols loaded.
    'HelloXbox.xbe': Loaded 'xboxkrnl.exe', No symbols loaded.
    'HelloXbox.xbe': Loaded 'xbdm.dll', No symbols loaded.
    ...

    Other than that, are you running within VirtualBox?
    If so, I had to fiddle with my network adapter settings initially, and found that Bridged Adapter mode was the only way it would work in my configuration:
    bridgedAdapter.png
     
  14. nonosto

    nonosto Intrepid Member

    Joined:
    Jan 5, 2012
    Messages:
    698
    Likes Received:
    53
    thx My network is very closed from you except network card name (we dont have the same). So I assume is good because xbox neighborhood run well, and .xbe is create.

    My VS2003 setting maybe can help for find:

    [​IMG]
     
  15. nullChar

    nullChar Active Member

    Joined:
    Jan 12, 2012
    Messages:
    32
    Likes Received:
    12
    Hi nonosto,

    I compared your property pages with mine, and found a couple differences. Everything is the same except for the red highlights.
    My project was generated using the "Xbox Project" template installed with "XDKSetup5933.exe".
    I wonder if changing them would do it?
    HelloXboxPropertyPages.png
     
  16. nonosto

    nonosto Intrepid Member

    Joined:
    Jan 5, 2012
    Messages:
    698
    Likes Received:
    53
    Finally I found the problem....I use Hack-devkit-GueuX-V2 for run game or Phoenix Bios Loader to load an other bios from debug dashboard and use bigger HDD (until 2TB). It create a linker to E partition called Volume B: it's like B partition. I must remove 2 little file for desabled the hack and when I want play game I move it back (just copy paste from a folder). I forgot it...I fromat my new PC and install all I need.

    THX all
     

Share This Page