Skip to content

[lldb] Allow "var" persistent variables to be modified #5651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kastiglione
Copy link

@kastiglione kastiglione commented Nov 23, 2022

Unconditionally call SwiftExpressionVariable::SetIsModifiable, for both let and var variables. Previously SetIsModifiable(false) was called for let variables - now var variables will result in SetIsModifiable(true).

This fixes the following bug:

(lldb) expr var $count = 123
(lldb) expr $count = 456
error: expression failed to parse:
error: <EXPR>:3:1: error: cannot assign to value: '$count' is immutable
$count = 456
^~

rdar://102675900

Unconditionally call `SwiftExpressionVariable::SetIsModifiable`, for both
`true` and `false`. Previously `SetIsModifiable(false)` was called for `let`
variables - now `var` variables will result in `SetIsModifiable(true)`.

This fixes the following bug:

    (lldb) expr var $count = 123
    (lldb) expr $count = 456
    error: expression failed to parse:
    error: <EXPR>:3:1: error: cannot assign to value: '$count' is immutable
    $count = 456
    ^~
@kastiglione kastiglione changed the title [lldb] Allow "var" expr variables to be modified [lldb] Allow "var" persistent variables to be modified Nov 23, 2022
@kastiglione
Copy link
Author

@swift-ci test

1 similar comment
@kastiglione
Copy link
Author

@swift-ci test

@kastiglione kastiglione merged commit 6089eda into stable/20220421 Nov 28, 2022
@kastiglione kastiglione deleted the dl/lldb-allow-var-expr-variables-to-be-modified branch November 28, 2022 18:33
kastiglione added a commit that referenced this pull request Dec 3, 2022
Unconditionally call `SwiftExpressionVariable::SetIsModifiable`, for both `let` and `var` variables. Previously `SetIsModifiable(false)` was called for `let` variables - now `var` variables will result in `SetIsModifiable(true)`.

This fixes the following bug:

    (lldb) expr var $count = 123
    (lldb) expr $count = 456
    error: expression failed to parse:
    error: <EXPR>:3:1: error: cannot assign to value: '$count' is immutable
    $count = 456
    ^~

rdar://102675900
(cherry picked from commit 6089eda)
kastiglione added a commit that referenced this pull request Feb 9, 2023
Unconditionally call `SwiftExpressionVariable::SetIsModifiable`, for both `let` and `var` variables. Previously `SetIsModifiable(false)` was called for `let` variables - now `var` variables will result in `SetIsModifiable(true)`.

This fixes the following bug:

    (lldb) expr var $count = 123
    (lldb) expr $count = 456
    error: expression failed to parse:
    error: <EXPR>:3:1: error: cannot assign to value: '$count' is immutable
    $count = 456
    ^~

rdar://102675900
(cherry picked from commit 6089eda)
kastiglione added a commit that referenced this pull request Feb 9, 2023
Unconditionally call `SwiftExpressionVariable::SetIsModifiable`, for both `let` and `var` variables. Previously `SetIsModifiable(false)` was called for `let` variables - now `var` variables will result in `SetIsModifiable(true)`.

This fixes the following bug:

    (lldb) expr var $count = 123
    (lldb) expr $count = 456
    error: expression failed to parse:
    error: <EXPR>:3:1: error: cannot assign to value: '$count' is immutable
    $count = 456
    ^~

rdar://102675900
(cherry picked from commit 6089eda)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants