Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Insider News
  4. Improvements in variable visibility when debugging

Improvements in variable visibility when debugging

Scheduled Pinned Locked Moved The Insider News
csharpc++visual-studiocomdata-structures
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kent Sharkey
    wrote on last edited by
    #1

    Microsoft C++[^]:

    In Visual Studio 2022 17.10 Preview 2, we’re including a small quality-of-life improvement that results in the Watch/Locals window displaying local variables correctly for any arbitrary frames in the call stack in debug builds.

    Yup, there's the variable

    J 1 Reply Last reply
    0
    • K Kent Sharkey

      Microsoft C++[^]:

      In Visual Studio 2022 17.10 Preview 2, we’re including a small quality-of-life improvement that results in the Watch/Locals window displaying local variables correctly for any arbitrary frames in the call stack in debug builds.

      Yup, there's the variable

      J Offline
      J Offline
      Joe Woodbury
      wrote on last edited by
      #2

      What a dumb feature. Where does showing out-of-scope variables end? And what if both the called function and calling function have a variable of the same name?

      T 1 Reply Last reply
      0
      • J Joe Woodbury

        What a dumb feature. Where does showing out-of-scope variables end? And what if both the called function and calling function have a variable of the same name?

        T Offline
        T Offline
        trønderen
        wrote on last edited by
        #3

        I don't understand your rejection of this feature. In the example, y is certainly within scope when foo() is called. The problem arises because the scope determined by the return address is not correct until foo() returns. You select which set of locals to display by selecting a stack frame. If the called and calling function have identically named variables, they are in different stack frames. You'll see one when selecting one stack frame, the other when selecting the other stack frame. If this is not sufficient to keep the two apart, I guess that you will feel the same confusion when creating or modifying the code in a plain code editor, regardless of debugger features. [Edit: This was an answer to another reply that seems to have been subsequently deleted.]

        Religious freedom is the freedom to say that two plus two make five.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups