Skip to content
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

Add command to enable writing to const types #115

Closed
kastiglione opened this issue Sep 29, 2015 · 2 comments
Closed

Add command to enable writing to const types #115

kastiglione opened this issue Sep 29, 2015 · 2 comments
Labels

Comments

@kastiglione
Copy link
Contributor

@rohan-mehta seeded this idea. When a variable is const, lldb will respect that and prevent assignment to the variable. Perhaps we could add a chisel convenience command that does this for the user:

(lldb) e CGFloat *p = (CGFloat *)&constVariable; *p = 1.0
@idrisr
Copy link
Contributor

idrisr commented Oct 12, 2015

Is that valid syntax? Am I missing something?

>>>> lldb >>>> e
Enter expressions, then terminate with an empty line to evaluate:
  1: CGFloat *p = (CGFloat *)&constVariable
  2: *p = 1.0
  3:
error: use of undeclared identifier 'constVariable'

@kastiglione
Copy link
Contributor Author

kastiglione commented Oct 12, 2015

constVariable refers to the variable that is const, that you want to edit. For example, given this definition:

const CGFloat labelWidth = fullWidth - iconWidth - padding * 2;

If you wanted to reassign labelWidth in lldb, you could use the above statement, except with labelWidth instead of constVariable. Note however, we tried this with x86, but not x86-64, or on arm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants