Debugging Improvements in Visual Studio 2015

Play Debugging Improvements in Visual Studio 2015

Description

In this episode Robert is joined by Andrew Hall, who shows us improvements to debugging in Visual Studio 2015. He shows enhancements to how you configure breakpoint settings that make it easier to work with breakpoints [01:00], the ability to execute lambda expressions in the Immediate and Watch windows [10:00] and how the C++ debugger can unfreeze threads in a process so locked functions can execute [15:45].

Embed

Download

The Discussion

  • User profile image
    mik

    Awkward silence there at the end. If you feel one of those coming on again just do a little dance to fill the gap :-)

  • User profile image
    rogreen

    @mik: We put that in there on purpose to test whether anyone actually watches these to the end. :)

    Robert

  • User profile image
    JohnLudlow

    Lambdas in the Immediate Window == awesome

  • User profile image
    Andrej

    Adding lambdas in the immediate/watch window is super useful. But ideally it would be possible to edit it right in the code.
    Is Edit and Continue of lambdas statements something that we will see in the future?

  • User profile image
    andrehal

    @Andrej: We are working on the ability to edit and continue lambda expressions, so it is something you will see in the future, although I cannot tell you exactly when it will be available at this point.

  • User profile image
    Deactivated User

    Totally love the C++ debugger's Visual Studio integration, that grows my understanding by trying out different approaches every time the C++ standard progresses.

  • User profile image
    androidi

    Since I got tired of waiting these improvements, here's what I'd like to be doing in addition to what I'm doing now in 2013 (except for the color changes and direct interaction with the debugger):

    1. move caret where you want the bp

    2. press add breakpoint key

    3. this changes the bg color of the line for the characters that follow until esc/arrow up/down or "; " is entered (inline debugger condition that looks just like regular code except talks to the debugger and doesn't end up in the code file but in meta data file)

    4. Now if you want multiple conditions, just press return/enter after ; instead of space to create a new condition line entirely with the custom "inline debugger condition background color"

    5. The code written here can be in a global project that is loaded all the time. So you can write custom debug tool code that's always available and since it's within the market, you don't need to use namespaces or classes. This debug tool project can be in any CLR language.

    Advantages over the current solution:

    1. to create a x==5 condition, there is a total of 6 key presses excluding the toggle BP key: "[BPKEY]x==5; " and then you're back to writing code normally. I suspect there's more to the shown approach (space,tab,arrow) - assuming you can use the new system completely without mouse.

    2. Condition code can be as complex as you want with as it's compiled into the executable like regular code with a check whether the condition/debugger is active right now - the compiled conditions can be changed with E&C during runtime

    3. Unlike regular code this code also gets access to intellitrace/debugger during runtime, by way of the auto-included debug-aids project referencing the VS stuff

    4. Takes less vertical space - adds only new lines when multiple conditions/actions present at same spot - yet is visually obvious with the background coloring (my current solution isn't)

    I implemented the above system into my projects sometime ago. What I don't have is ability to talk to debugger/intellitrace or the custom background color, so my custom bp code is kinda lost in the code (that's why I made it ALL CAPS like : d.BP(x==5); where d is the global "debugging stuff" class. To help with IntelliTrace I did a load of dummy "nop" methods: d.IT(object,...) that will cause IntelliTrace to show the variable content at that point - but this could be improved a lot by having a "sample global debug tools class" which shows what you can do by talking to debugger/intellitrace when condition is hit.

     

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.