Thread: ms visual studio debugger

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    242

    ms visual studio debugger

    i'm trying to learn how to use the debugger, as one presumably should, rather than debugging through strategic std::cout statements but had the problem that the debugger steps me through huge numbers of lines of optimized STL code (or other library code) where i know there's no error.

    in vs 2010, how do you get the debugger to jump over library code so that you can look only at the new stuff you have written? it's presumably under debug > options and settings, but i don't know where to look under the many options that come up from there.

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    For the standard keyboard setup:
    F9 - set breakpoint
    F10 - step over
    F11 -step into

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Set a breakpoint on the line you want to investigate.

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    242
    that's not the problem.

    i set the breakpoint, then when i step into it, it takes me to all kinds of other code, mainly code from built-in header files, before i get to the problem. i don't want to see all the intricacies of vector.h, etc. but only what's happening (variable values, etc.) from one line of my own code to the next.

    there should be filters available so that it doesn't show you this much.

  5. #5

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Simply put, the easiest way:
    - Find a function that you don't want to step into? Press F10, or step over.
    - Find yourself in a function you don't want to look in? Press Shift+F11, or step out.
    - If you WANT to step into a function, press F11, or step in.
    It doesn't take a genius to figure out what's library calls and what isn't. That stuff comes with time.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Well if you step over calls into the STL, that's one solution. I agree there should be a way to not step into the STL code, but I can't find the option.

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Sometimes you want to step into it. Though 99% of the time, you don't. Try the link above?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Nice find, adeyblue...I missed that in the Googling.

  10. #10
    Registered User
    Join Date
    May 2009
    Posts
    242
    yeah, eclipse has it for java, so i figured vs would have it for c++, but after retrying, elysia's technique of just using the hotkeys seems to work fine.

    in the interesting spot in my code, i got a tour first through vector, then through ostream, then some other files i didn't even realize were involved, and with repeated f11 i just kept getting in deeper without ever getting back to my own functions. f10 and shift + f11 got me where i wanted to be, though.

  11. #11
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    elysia's technique of just using the hotkeys seems to work fine.
    You can read right?

    For the standard keyboard setup:
    F9 - set breakpoint
    F10 - step over
    F11 -step into
    Do I have to draw a picture of the keyboard or something?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. what am I missing? (Program won't compile)
    By steals10304 in forum C Programming
    Replies: 3
    Last Post: 08-25-2009, 03:01 PM
  2. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  3. Templates and Macros plus more...
    By Monkeymagic in forum C++ Programming
    Replies: 8
    Last Post: 01-20-2007, 05:53 PM
  4. Errors with including winsock 2 lib
    By gamingdl'er in forum C++ Programming
    Replies: 3
    Last Post: 12-05-2005, 08:13 PM
  5. header file bringing errors?
    By bluehead in forum Windows Programming
    Replies: 4
    Last Post: 08-19-2003, 12:51 PM