Questions about debugging with Visual Studio

This is a discussion on Questions about debugging with Visual Studio within the C Programming forums, part of the General Programming Boards category; I've successfully created a project, added my files to it, and Built it. I have a couple of questions about ...

  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    67

    Questions about debugging with Visual Studio

    I've successfully created a project, added my files to it, and Built it. I have a couple of questions about my efforts to Debug after setting a breakpoint of interest:

    a) When I select Debug, I get the warning message:
    "Debugging information for 'myfile.exe' cannot be found or does not match. Binary was not built with debug information. Do you want to continue debugging?"

    --> Did I do something wrong when Building my project? What can I do to solve this warning message? Is this a serious problem that will prevent me from successfully debugging, or could I ignore it with no consequences?

    -----------------------------
    b) What I'm trying to do is to run the code until the breakpoint, and then step through the code, beginning at the break point, while I observe the values of several arrays and variables. However, I've searched through all of the menu options, and I can't figure out how to select/display the particular variables/arrays of interest. Can you please tell me how to do this?

    Thanks in advance for your help.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,556
    Make sure you're building the debug version, and not the release version.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jun 2010
    Posts
    67
    Quote Originally Posted by Salem View Post
    Make sure you're building the debug version, and not the release version.
    How can I do this? How do I know which one is the debug version & which is the release version? And which file are we talking about -- an executable that gets generated by the Build process?

    I just remembered that I'm supposed to delete the executable that I had previously generated using Cygwin. I did this, then Build --> Clean Solution, and then Build --> Build Solution again, and now that I don't have my pre-existing .exe file available, my Build process *fails*, with the message, "1>Project : error PRJ0003 : Error spawning 'cmd.exe'."

    Any suggestions about why my Build process is failing? If I need to provide more info, please let me know what's needed.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,556
    It's been a while since I last used VS, so you might need to experiment a little.

    As I recall, there was a drop-down list with either "Win32 - Debug" or "Win32 - Release" which set the default target rule when you did a build.

    Failing that, do a "Build->batch build" and you can have complete control over exactly which targets you build.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Jun 2010
    Posts
    67
    Thanks, Salem; I will use the Batch Build option in the future.

    For everyone's reference, I found this link that discusses the Build error I've been receiving:
    Beta 2 error, Project : error PRJ0003 : Error spawning 'cmd.exe'.

    I hope that one of the solutions suggested here works; I've tried one so far, no luck yet...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with cin and strings
    By putzboy20 in forum C++ Programming
    Replies: 4
    Last Post: 05-11-2010, 08:38 PM
  2. sorting the matrix question..
    By transgalactic2 in forum C Programming
    Replies: 47
    Last Post: 12-22-2008, 02:17 PM
  3. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  4. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 03:49 AM
  5. Linking error
    By DockyD in forum C++ Programming
    Replies: 10
    Last Post: 01-20-2003, 04:27 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21