<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57567>57567</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            When stepping, the scope of a block goes away just before the trailing }, not just after it
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          pallenking
      </td>
    </tr>
</table>

<pre>
     I am told by the Xcode folks that this is a perhaps a symbol table "feature" with llvm when used with and Swift. So here it goes:

It would make Xcode debugging a little easier if LLDB held the values of a block open (valid) when it stops on the line with the }, the line which ends the block. Now if LLDB lands there, it throws away the block's variables and stops. Consider:

```
if true {
    var c = f1
    f2(c)
} //  break here, c is not in scope
```
Here assume f1 and f2(c) are very complicated, perhaps even pages and seconds long. If there is a problem in f2(c) which is first determined after it's return, it's argument c is gone! How was f2 called?!

I run into this a few times a week (I do do a lot of stepping). There are workarounds, like adding a nop statement before the }. (Then re-build, rerun, finish testing, remove -- what a pain)

Breaking before the } is executed is a more intuitive behavior, since normal lines (not starting with }) don't execute ANYTHING before they stop. Why should this be any different? And I don't remember other debuggers with this behavior in my decades of coding.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtVMFu4zgM_RrnQtRwnNpJDj60DboNMOhlCszuUbZpWxNZCiQ52fz9PslJ0w42EBxZtMjHx0fWpr1UtCcxkjeqpfpCfmD6uzEtU2fUweFdeDykIyxBR7aDOIadu4y1UeRFrZiSPO9Y-MkydnSWfiClTiOdB9Y0OW7nM6Fb-nmWnU_pp6GBLZP01Bt2yeopyXZJdn3uPZ3NBESjONzwtFxPfS91j-BKeo-wLJxkS7KjHz92z3CIGyGBk1ATOzIdPq2VaQ5kjgCS5BtYZJvk2xkZgjtvkI7R8Z6Smmek4S1Z75L85YthkM1ArFsXz6LjlN7N-ROAEldj4OEluPeDNWfQdRaX-6UkXzt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