Cannot find the execution point at debug evaluation expression - appcode

I want log something when breakpoint is hit in AppCode. But there is no documentation for how to write a right evaluation expression for the evaluate and log section on debug configuration window.
if i write
NSlog(#"some message")//error
the console log:
error evaluating NSLog(#"some message");: Cannot find the execution point
I have no idea how to write correctly!

There is a feature in AppCode called "Evaluate expression" (⌥F8). You can call it during the Debug and evaluate particular code expression without p/po and LLDB console. You can normally write the code in the window, press "Enter" and see the result of this particular expression.
This field uses this feature to evaluate some particular code at breakpoint, and evaluation result of NSLog is void. Here you can right for example something like self.view.frame.size.width <= 100 and have result printed to console. If you want just print some message to console - select only Log message to console and AppCode will print something like
Breakpoint reached: ViewController.m:6

Related

Getting Warning sign : OMEGA13 was used but was never set (will evaluate as its name)

Getting warning from Script Checker : "OMEGA13 was used but was never set (will evaluate as its name)"
I've set
start using Omega13
-- some codes here --
stop using Omega13
Anyone has any idea on why the warning sign is there?
Eggplant documentation - Advance scripting: Error Recovery with Omega13
What's probably happened is somewhere you've mistyped some variant of omega13.
Sensetalk treats uninitialized variables as strings. This results in lots of hard to debug errors.
name = "my name"
put naame
This will print naame which is probably not what you wanted.
It looks like the correct form to invoke is omega13 not Omega13, or OMEGA13. I'd check the documentation and make sure that you haven't mistyped it anywhere.
You may also want to look into the strictVariables global which if true will treat using an uninitialized variable as an error.

How to get output of Kotlin IntelliJ scratch file?

A script as simple as
println("a")
doesn't produce any output in the Scratch output window. I expect an a to appear in the output window.
I'm using IntelliJ 2019.1.2 CE.
EDIT: Information regarding the expected functionality
According to a question I had asked: IntelliJ Ultimate Kotlin Script REPL skips first printed lines - Scratch Output cut off
It seems to be the case that the REPL wants to output per line, and will only overflow into the bottom area after a certain line length is reached.
In the question I state that I generally add some initial padding so that it always flows into the lower area with something similar to:
repeat(10) { println("BLANK ") }
END EDIT
You have to make sure that Interactive Mode is turned off at the top of the scratch window
This will cause prints to be put into the Scratch Output window.
Be warned, atleast in the version I have of IntelliJ ultimate 2019.1.3, the first 5-9 lines generally dont print so I do something like:
repeat(9) { println("blank") }
If you've defined everything inside of a function, the script won't execute the function automatically - you'll need to explicitly call the function.
You can create your own print, like this:
fun <T> myPrint(x: T) : T = x
then calling e.g.:
myPrint(5)
should show 5 in the result window.

Watch every next line while debugging in Intelij Idea?

I was wondering if there is any way in Intellij to know the output of the next line while debugging?
Sometimes errors occur in the next line for which I have to use expression elevator to see what kind of error, error message etc.
Watching(or evaluating) every next line and showing the result before hand without breaking the flow would be helpful.
Any setting, any plugin?
Did you try to use Evaluate expression? In case ob exception you will see it but debug mod won't be stoped

debugging JavaScript runtime syntax errors

Short: I am looking for a way to get the text of the script that was evaluated and caused a syntax error from within the context of window.onerror.
Long:
The full scenario includes a phone gap application and the PushNotifications plugins.
When a push message is sent to the device a javascript error is caught using window.onerror.
with the text "SyntaxtError: Expected token '}'"
the reported line number is 1 (is it is usually when dealing with EVALuated code.
The way the plugin executs its code is by using:
NSString * jsCallBack = [NSString stringWithFormat:#"%#(%#);", self.callback, jsonStr];
[self.webView stringByEvaluatingJavaScriptFromString:jsCallBack];
I belive but not 100% sure that this is the code PhoneGap Build are pushing
more code can be seen in here https://github.com/phonegap-build/PushPlugin/blob/master/src/ios/PushPlugin.m#L177
the self.callback is a string passed by me to the plugin and jsonStr is (supposed to be) an object describing the push message.
when I tried to pass as the parameter that ends up being self.callback the string alert('a');// then I did get the alert and no syntax error. ad now I am trying to understand what does jsonStr gets evaluated to so that maybe I can find a way around it or figure out if its my fault somehow (maybe for the content I am sending in the push notification....)
I also tried to look at the last item of the $('script') collection of the document hopeing that maybe stringByEvaluatingJavaScriptFromString generates a new script block but that does not seem to be the case.
further more in the window.onerror I also tried to get the caller
using var c=window.onerror.caller||window.onerror.arguments.caller; but this returns undefined.
As I stated before - I am looking for ideas on how to determine what exactly is causing the syntax error possibly by getting a hold of the entire block of script being evaluated when the syntax error happened.

Expression in Xcode 4.3.2 Debug area not evaluated

I'm doing something wrong. I have added an expression, I can see the expression with the "E" symbol in the Debug area, but the expression is not being evaluated, its value is not displayed there (it is in scope at that time).
When I use the debugger (lldb) directly, it works well.
Xcode 4.3.2.
What should I do?
Thanks
You are trying to evaluate a boolean and print it as an object.
You want to use print [self isEditing] or print (BOOL)[self isEditing], depending upon whether the debugger complains that it doesn't know the type of the member or not.
The po command prints an object description, not an arbitrary value, and should only be used when the result of the expression on the right is an object, such as po self.
The same problem occurs in the expression editor. If you use the expression [self isEditing], the debugger won't understand it. However, if you use (BOOL)[self isEditing], it will display correctly.
try adding the expression as self.isEditing, without the square brackets. Works here