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

Issues running in Swift #80

Closed
nickkjordan opened this issue Mar 18, 2015 · 17 comments
Closed

Issues running in Swift #80

nickkjordan opened this issue Mar 18, 2015 · 17 comments
Assignees
Labels

Comments

@nickkjordan
Copy link

I am getting errors because my expressions are running in Swift despite the evaluateExpressionValueInFrameLanguage function

Typical error statement:

error: expected ',' separator
(int)((BOOL)((unsigned long)CFGetTypeID((CFTypeRef)(shape)) == (unsigned long)CGImageGetTypeID()))

Is there something I'm missing here? I'm just calling visualize <value>

@donshefer
Copy link

I'm seeing something similar in my Swift project:

(lldb) caflush
error: :1:22: error: expected ',' separator
(void)[CATransaction flush]

@kastiglione
Copy link
Contributor

Thanks for the reports! I will try to take a look at this soon.

@kastiglione kastiglione self-assigned this Apr 16, 2015
@yxztj
Copy link

yxztj commented May 6, 2015

Hi, I'm also seeing this error:
(lldb) pviews
error: :1:20: error: expected ',' separator
(id)[(id)[UIWindow keyWindow] recursiveDescription]

@kastiglione
Copy link
Contributor

@yxztj I just tried running pviews using the "Master-Detail Application" template that comes with Xcode. I could not reproduce the error you've reported. I am using the latest Xcode GM, 6.3.2 GM. If you're able to try the GM and let me know whether the GM fixes this for you, that would be great. Or, using whichever version you have installed currently, could you try creating a new project based on the "Master-Detail Application" template and let me know if pviews is broken? Thanks!

@kastiglione
Copy link
Contributor

@donshefer I just tried caflush using Xcode 6.3.2 GM, and could not reproduce the error you reported. When you update to 6.3.2, if you try caflush on your Swift project and it still fails, I would love to know and investigate more. Thanks!

@kastiglione
Copy link
Contributor

@nickkjordan I am seeing different errors when I run visualize. I'll look into them. I was calling visualize on a view. Were you calling it on a image, view, or layer?

@nickkjordan
Copy link
Author

This is bad, but I can't quite remember at this point. I think it was on a layer though, because I remember doing some animations around then

@ignat980
Copy link

I am also getting this error.

(lldb) caflush
error: <EXPR>:1:22: error: expected ',' separator
(void)[CATransaction flush]
                     ^
                    ,

I am running the command within a swift context, and I have no idea how to change the language from swift inside the debugger. I think this is related to #74 and #68 .

@ghost
Copy link

ghost commented Aug 4, 2015

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

@alireza
Copy link

alireza commented Aug 18, 2015

Seems like the problem only occurs in Swift projects in which lldb expects swift commands.

Basically, in the python scripts commands sent to the debugger using lldb.debugger.HandleCommand are all in objc. They won't work when lldb debugger is in swift mode.

@stkent
Copy link

stkent commented Sep 1, 2015

Same issue and output as @ignat980 above. Is there an easier fix than explicitly updating all the commands sent to the debugger to use expression -l objc++?

@schwarrrtz
Copy link

Same issue and output as @ignat980 and @stkent. Similar issues with flicker.

@theonepa1
Copy link

self is of type UICollectionViewController. Ran mask and got following error.

(lldb) mask 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 81, in runCommand
command.run(args, options)
File "/usr/local/Cellar/chisel/1.2.0/libexec/commands/FBDisplayCommands.py", line 55, in run
layer = viewHelpers.convertToLayer(args[0])
File "/usr/local/opt/chisel/libexec/fblldbviewhelpers.py", line 51, in convertToLayer
if fb.evaluateBooleanExpression('[(id)%s isKindOfClass:(Class)[CALayer class]]' % viewOrLayer):
File "/usr/local/opt/chisel/libexec/fblldbbase.py", line 69, in evaluateBooleanExpression
return (int(evaluateIntegerExpression('(BOOL)(' + expression + ')', printErrors)) != 0)
File "/usr/local/opt/chisel/libexec/fblldbbase.py", line 61, in evaluateIntegerExpression
output = evaluateExpression('(int)(' + expression + ')', printErrors).replace(''', '')
AttributeError: 'NoneType' object has no attribute 'replace'

@webdevotion
Copy link

@ultramiraculous, from what I saw in #121 you expected this ticket to be resolved as wel.
Today I still get an error when running for example mask self.view in lldb.
Got rid of my Homebrew install and using a clone from the main branch.

(lldb) mask self.view
error: error: use of undeclared identifier 'self'
error: 1 errors parsing expression
error: error: use of undeclared identifier 'None'
error: 1 errors parsing expression
error: <EXPR>:1:13: error: expected ',' separator
(void)[None removeFromSuperview]
            ^
           ,
error: <EXPR>:1:22: error: expected ',' separator
(void)[CATransaction flush]
                     ^
                    ,
error: error: use of undeclared identifier 'None'
error: 1 errors parsing expression
Traceback (most recent call last):
  File "/...path-to-chisel.../chisel/fblldb.py", line 79, in runCommand
    command.run(args, options)
  File "/...path-to-chisel.../chisel/commands/FBDisplayCommands.py", line 93, in run
    viewHelpers.maskView(viewOrLayer, options.color, options.alpha)
  File "/...path-to-chisel.../chisel/fblldbviewhelpers.py", line 24, in maskView
    origin = convertPoint(0, 0, viewOrLayer, window)
  File "/...path-to-chisel.../chisel/fblldbviewhelpers.py", line 46, in convertPoint
    fromLayer = convertToLayer(fromViewOrLayer)
  File "/...path-to-chisel.../chisel/fblldbviewhelpers.py", line 51, in convertToLayer
    if fb.evaluateBooleanExpression('[(id)%s isKindOfClass:(Class)[CALayer class]]' % viewOrLayer):
  File "/...path-to-chisel.../chisel/fblldbbase.py", line 69, in evaluateBooleanExpression
    return (int(evaluateIntegerExpression('(BOOL)(' + expression + ')', printErrors)) != 0)
  File "/...path-to-chisel.../chisel/fblldbbase.py", line 61, in evaluateIntegerExpression
    output = evaluateExpression('(int)(' + expression + ')', printErrors).replace('\'', '')
AttributeError: 'NoneType' object has no attribute 'replace'

@tracicot
Copy link

I'm seeing the same issues. Executing show scrollView results in:
error: <EXPR>:1:19: error: expected ',' separator (void)[scrollView setHidden:0] ^ , error: <EXPR>:1:22: error: expected ',' separator (void)[CATransaction flush] ^ ,

@albertstartup
Copy link

Using show and hide work when using clone from main branch. Try cloning the latest version @tracicot
mask still produces same error as @webdevotion

@kastiglione
Copy link
Contributor

I think this be closed now. Swift interop has been improved, and we can create new issues for specific issues as they arise.

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