C++ Debugging Tips and Tricks

Sign in to queue

Description

In this episode, Robert is joined by Andrew Hall, who shows a number of cool debugging tips and tricks for C++ developers. More specifically, he shows:

  • Configuring launch options from project properties (command line arguments and setting environment variables) [01:25]
  • Seeing function return values [02:34]
  • Set next statement [03:16]
  • Step into specific [04:07]
  • Run to cursor [05:05]
  • Edit and Continue (including x64 support) [06:57]
  • Exception Settings [08:31]
  • Conditional, Hit Count, and Filter Breakpoints [13:44]
  • Pinning DataTips [19:17]
  • Parallel Stacks window [19:42]
  • Show External Code [20:30]
  • Parallel Watch window [22:00]
  • Freeze and Thaw threads [23:13]
  • Flag Threads and Run Flagged Threads to Cursor [24:18]
  • Show Threads in source [26:13]
  • Debug Location toolbar [28:09]
  • Debugging Heap Corruption with Page Heap [29:43]
  • PerfTips [33:32]
  • Integrated CPU profiling [35:53]
  • Integrated Memory Profiling [38:01]
  • Natvis [41:03]
  • Showing what source code causes an Access Violation [42:43]

Embed

Download

The Discussion

  • User profile image
    Tomas1856

    Hi,

    thank you for this ! Especially for the freeze/thaw functionality, super useful.

  • User profile image
    Toruk

    Very nice stuff. A suggestion for improving parallel debugging further:
    I - and I suspect most native devs doing threaded work - would benefit greatly if you'd support the ability to name native threads. Currently there's a semi-hack to achieve that via a special exception code (https://ofekshilon.com/2009/04/10/naming-threads/) - even wrapping this and integrating into the IDE would be great.

  • User profile image
    William

    Really an Apple computer on Microsoft? That doesn't say much for Microsoft at all.

  • User profile image
    Apple brain

    Well it's a Mac running Windows 10. Been that way for years

  • User profile image
    Alberto

    Hi,
    Very usefull

    is there a way to get the source code of the demo?
    Tia

  • User profile image
    Ulysses1337

    40:56 Sigh. The correct C++/OO tactic is a smart pointer, NOT a manual delete. I know this video is about the tools rather than language features, but still, bad advice spreads like a virus. unique_ptr in renaissance C++, auto_ptr in antiquated C++.

  • User profile image
    Josh

    Please sir, may we have the source code? :)

  • User profile image
    Thrash​Abaddon

    Could we get the source code to try things out?

Add Your 2 Cents