XCode lldb autocomplete - xcode

I have searched everywhere but can't seem to get answer. I am using Xcode 6.1.1.
I recall (possibly incorrectly) autocomplete being available in the lldb debug pane of XCode. I am currently typing fully all variables and functions; there must be a better way. Is autocomplete/intellisense available in Xcode?
Many Thanks.

The autocomplete available today in Xcode debugger console is for lldb commands. You can type fr<TAB> v<TAB> instead of frame variable. The autocomplete in lldb often can complete function names, for instance br s -n MyClass::MyMeth<TAB>. Or for a source file, br s -f myfil<TAB> -l 15. But once you're entering an expression (expr, or p, or po), the code completion you're used to seeing in the text editor panes is not available.

Related

How to prevent distortion of code window in gdb -tui? Debugging commands scroll up and break graphics

I just started using gdb, so gdb -tui helps visualize process.
However when gdb commands rise up they push window with source code so everything becomes broken.
I set variable to TERM=xterm-256color
as some suggest and this didn't help.
Same behavior for st alacritty and even tty.
You can use ctrl + L to refresh your tui. But the output of your code (like printf) will be lost together with distortion.
Recommended a tremendous gdb plugin -- gdb-dashboard
Faced the same issue. Using the following command helped.
ref
This should resolve the graphics issue.
I haven't found how to prevent graphics distortion in gdb -tui.
But there are better tools to archive same goal.
Probably -tui option exists only for limited cases when better options are not available due to limitations of installed software.
Using vim with Termdebug lets view code during debug as gdb -tui mode does but without graphics break.
enable termdebug
:packadd termdebug
start termdebug
:Termdebug
You can press control_l in gdb -tui to refresh screen. But adding additional key combination after every command is obviously inconvenient.

How do you debug on breakpoints in swift on xcode?

I face trouble using po/p command in xcode using swift. It doesn't work always and gives error most of the time. Also its response is not useful most of the time. For example, when i type "po user" it gives instead of its details and items which i could expand while using objective-c
How do you debug any breakpoint? Are there any great external tools or alternatives available for this?
po command works in swift too
po yourvariable.description
po yourvariable.debugDescription
or
po print(yourvariable)
Having the same problem with Xcode 6 to 7.1.1. Here is a workaround until the gets bug fixed:
Use the p command instead. If this doesnt work then do "step into" before you type the p command.
p yourvariable.yourparameter
Reference this:
https://stackoverflow.com/a/28841849/4144106

Swift code completion isn't working

I installed Xcode 6.0 beta and downloaded the iOS8 library Documentation.
but when i create a Swift project, try to typing code
func aa(){
let format = NSDateFormatter()
var pageData = format.
}
I find Xcode can't dot any property and function. Am I missing any step?
The problem is sloved, typing a whitespace can aid code completion
It's append when you change the hardware type and you choose less than iphone5.
Choose Iphone 6 for example in the list at the right of the stop button and the code completion for 'format' will appear.
I met the same problem and solve it by removing the non-ASCII char in comment (in my problem, it's a chinese char "年" automatically generated in comment by xcode).
btw. "typing a whitespace can aid code completion" doesn't work for me
It’s a bug, your code works on my system (OS X 10.9). Note that when typing code, I sometimes see the code completion crash for two seconds and come back.
When trying a first project named "swift", code completion crashed in a infinite loop… beta bugs… I just had to name it something else to test the language.
You know, I've experienced something similar with Objective C projects in Xcode 6 Beta 1. It seems Apple have changed the default behaviour a bit:
In Xcode 5.x code would always automatically complete as you type, but in this early beta try pressing ESCAPE - that will bring up the list you're looking for. Works for me. Some code auto completes as you type (both in Swift and Objective C), but at times only ESCAPE will bring up what we're looking for.
I'm nor sure if this is expected behaviour or a bug (I'm guessing the latter).
I must admit that your code works fine on my system without this trick. Just make sure you have code completion setup under Xcode - Preferences - Text Editing:

How do you stop the XCode debugger from autocompleting without options?

The debugger is really (de)bugging me. Every time I try to type a po ... command, it autocompletes (without giving me any options) and I end up typing stuff like po [selfelf and so on until I go mad. Is there any way of stopping this, or of always giving me the autocomplete popup like in the standard editor?
This answer applied to the GDB debugger which is no longer the standard debugger used with Xcode
This is achieved by adding the following line to the "readline init file" (which, by default, I think does not exist). I created the file ~/.inputrc and put the following text in it:
set disable-completions 'On'
Hmm, the accepted answer is kind of overkill.
How about the answer provided to this question:
The closest I've come to solving this incredibly annoying problem is
to turn off automatic code completion in general (Preferences > Text
Editing > Suggest Completions While Typing) and then hit esc whenever
I actually do want code completion.

xcode 3.2 c++: how can i enable a proper code completion?

I have snow leopard and I'm building a cpp Application with xcode.
I would like to be able to get proper code completion with xcode, and by that i mean the following:
std::string f;
f.
just when I type f. i would like to see all the relevant functions to that string class. is it possible in xcode ?
You just need to press the ESC key to get the code completion menu to show.
It may seem counterintuitive but press the ESC key after the period.
If you want the completion menu to display automatically, you can also set that in your preferences:
Code Sense -> Code Completion -> Automatically Suggest

Resources