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

chisel does not work with swift #148

Closed
cuong1112035 opened this issue Mar 17, 2016 · 5 comments
Closed

chisel does not work with swift #148

cuong1112035 opened this issue Mar 17, 2016 · 5 comments

Comments

@cuong1112035
Copy link

I try chisel but it only work with objective-c project. when trying with swift project I got some error like this
border self.view
error: error: use of undeclared identifier 'self'
error: 1 errors parsing expression
Traceback (most recent call last):
File "/usr/local/opt/chisel/libexec/fblldb.py", line 79, in runCommand
command.run(args, options)
File "/usr/local/Cellar/chisel/1.4.0/libexec/commands/FBDisplayCommands.py", line 75, in run
if viewHelpers.isView(obj):
File "/usr/local/opt/chisel/libexec/fblldbviewhelpers.py", line 66, in isView
return isUIView(obj) or isNSView(obj)
File "/usr/local/opt/chisel/libexec/fblldbviewhelpers.py", line 60, in isUIView
return not runtimeHelpers.isMacintoshArch() and fb.evaluateBooleanExpression('[(id)%s isKindOfClass:(Class)[UIView class]]' % obj)
File "/usr/local/opt/chisel/libexec/fblldbbase.py", line 70, in evaluateBooleanExpression
return (int(evaluateIntegerExpression('(BOOL)(' + expression + ')', printErrors)) != 0)
File "/usr/local/opt/chisel/libexec/fblldbbase.py", line 62, in evaluateIntegerExpression
output = evaluateExpression('(int)(' + expression + ')', printErrors).replace(''', '')
AttributeError: 'NoneType' object has no attribute 'replace'

Could you give me some advice to make it run with swift?

@alanzeino
Copy link
Contributor

There are some specific swift commands. Type help into LLDB and you'll see them:

  poobjc       -- For more information run 'help poobjc'
  poswift      -- For more information run 'help poswift'

@kastiglione
Copy link
Contributor

@cuong1112035 in #121 support was added to ensure chisel evaluates code correctly regardless of whether code is objc or swift. If you have any troubles, please let us know, thanks.

@srpoucse
Copy link

srpoucse commented Feb 17, 2017

I see the same issue, any suggestions?

error: error: use of undeclared identifier 'self'
Traceback (most recent call last):
File "/usr/local/opt/chisel/libexec/fblldb.py", line 79, in runCommand
command.run(args, options)
File "/usr/local/Cellar/chisel/1.4.0/libexec/commands/FBDisplayCommands.py", line 75, in run
if viewHelpers.isView(obj):
File "/usr/local/opt/chisel/libexec/fblldbviewhelpers.py", line 66, in isView
return isUIView(obj) or isNSView(obj)
File "/usr/local/opt/chisel/libexec/fblldbviewhelpers.py", line 60, in isUIView
return not runtimeHelpers.isMacintoshArch() and fb.evaluateBooleanExpression('[(id)%s isKindOfClass:(Class)[UIView class]]' % obj)
File "/usr/local/opt/chisel/libexec/fblldbbase.py", line 70, in evaluateBooleanExpression
return (int(evaluateIntegerExpression('(BOOL)(' + expression + ')', printErrors)) != 0)
File "/usr/local/opt/chisel/libexec/fblldbbase.py", line 62, in evaluateIntegerExpression
output = evaluateExpression('(int)(' + expression + ')', printErrors).replace(''', '')
AttributeError: 'NoneType' object has no attribute 'replace'

@jotshin
Copy link

jotshin commented Feb 21, 2017

I'm having the same issue while using border. However there's no problem for show/hide the same view.

error: error: :1:11: error: use of undeclared type '$__lldb_context'
extension $__lldb_context {
^~~~~~~~~~~~~~~

error: :18:5: error: use of unresolved identifier '$__lldb_injected_self'
$__lldb_injected_self.$__lldb_wrapped_expr_11(
^~~~~~~~~~~~~~~~~~~~~

error: error: use of undeclared identifier 'None'
Traceback (most recent call last):
File "/usr/local/opt/chisel/libexec/fblldb.py", line 83, in runCommand
command.run(args, options)
File "/usr/local/Cellar/chisel/1.5.0/libexec/commands/FBDisplayCommands.py", line 78, in run
if viewHelpers.isView(obj):
File "/usr/local/opt/chisel/libexec/fblldbviewhelpers.py", line 66, in isView
return isUIView(obj) or isNSView(obj)
File "/usr/local/opt/chisel/libexec/fblldbviewhelpers.py", line 60, in isUIView
return not runtimeHelpers.isMacintoshArch() and fb.evaluateBooleanExpression('[(id)%s isKindOfClass:(Class)[UIView class]]' % obj)
File "/usr/local/opt/chisel/libexec/fblldbbase.py", line 84, in evaluateBooleanExpression
return (int(evaluateIntegerExpression('(BOOL)(' + expression + ')', printErrors)) != 0)
File "/usr/local/opt/chisel/libexec/fblldbbase.py", line 76, in evaluateIntegerExpression
output = evaluateExpression('(int)(' + expression + ')', printErrors).replace(''', '')
AttributeError: 'NoneType' object has no attribute 'replace'

@kastiglione
Copy link
Contributor

Thanks for the reports. I'll try to figure out the root cause.

This issue was closed.
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

No branches or pull requests

5 participants