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

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.

Related

I accidentally unbound my c-key in my macOS terminal when enabling autofill. How do I restore it?

So I was looking into how to enable mac terminal auto complete and stumbled upon solutions involving .inputrc. However, I must have messed up some input along the way, because now my c key doesn't work while in the terminal. Whenever I press it my terminal does a quick flash of disapproval and nothing else happens. Also, for some reason, upper case C still works just fine.
I would greatly appreciate any help!
For what it's worth: the auto complete works like a charm....
I've been searching for a way to factory reset my bindings, but to no avail.
Unfortunately I'm so new to messing with the terminal that I don't really now where to start or what to look for :/

Why The application is in break mode?

I swear I used to remember Visual Studio just breaking on an exception. It would take you straight to the line where the exception was thrown and allowed you to inspect variables just by hovering over them.
Or maybe that was a dream. Or maybe this is a nightmare.
But it's actually not a problem, right, because now instead of it just working all you need to do is go to Debug > Windows > Exception Settings where you get this mess.
Which has many glaring problems. For example:
Remember when I said it used to just work?
I don't have all these Exception types memorized.
Clicking toggle all on/off removes your previous selections.
Oh and also, clicking this checkbox does absolutely nothing
It used to just work. Is it possible to get it back to just doing that?
Under exception settings, Go to Common Language Runtime Exceptions->check all. This will not break your application, but show you the exact line of occurrence of the exception.
Per that first image you posted, it appears the application is throwing an exception in "external" code, so you likely have the "Just My Code" enabled in the debugging options. Try unchecking that "Just My Code" option via your Tools|Options dialog (Debugging\General category), and that'll likely fix you up.

TextMate: Comment-line shortcut does not work anymore (Cmd-/ or Cmd-Shift-7 on my swiss layout)

I experience a quite strange behavior in TextMate since some time.
I had troubles to use the keyboard shortcut for commenting a line (which is Cmd-/ or on my swiss layout it is CMD+SHIFT+7 where SHIFT+7 results in a /) a few times already since I switched to Lion 2 months ago (before I never had any problems). I then used to restart TextMate and it worked again.
But now, restart doesn't solve the problem. So I went into the Bundle Editor and tried to reset the shortcut, and there I can set it to anything I like, but not to Cmd-/! Nothing happens when I want to record the shortcut and press CMD+SHIFT+7`, the input field stays blank!
I have some bundles installed since my switch to Lion (Cucumber, RSpec, RubyAMP, Ruby Debug, Shoulda), so maybe one of those makes troubles?? Or does the fact that I even don't seem to be able to send CMD+SHIFT+7 in the Bundle Editor imply that the Shortcut is blocked from somewhere else "outside" of TextMate?
How should I debug this? Thanks for help.
Turns out it was Skitch that was running and occupied Cmd-Shift-7.

XCode 4 Step into doesn't work

Im using XCode 4 and seeing a problem with debugging that did not exist in 3.x.
I am putting a breakpoint at a line where I call an object method.
Product *p = [[Product alloc] init];
[p print]; <-- Put a breakpoint here
After control stops at that line, I try to step into the method (F7). But nothing happens. System just skips over the line and goes to the next line (same behavior as Step Over).
Step into works fine for plain C language projects. The problem is with Objective-C methods. How do I fix this problem? Thanks.
Not sure if this will help -- Go into system preferences, and under the Keyboard general settings ensure that the "Use all F1 F2 etc. as standard function keys" option is checked.
F7 started to work for me after I checked that.
Hope that helps...
Check that the instance is not nil before trying to step into it's instance method. As embarrassing as it may seem, we all do it occasionally.
Stepping into ObjC method calls is not always possible. The way it was explained to me, there are internal runtime data structures that must be in a consistent state in order to reliably step into an ObjC method. If those internals happen to be in an inconsistent state when the program stops at your breakpoint, stepping in in the debugger will fail, and it will step over the call instead. This was also true in Xcode 3, and really has little or nothing to do with Xcode, but is an ObjC runtime and debugger issue. I estimate anecdotally (working in Xcode full-time for 3+ years) that stepping into an ObjC method call fails ~5% of the time. I find that it happens most often when it will be the most inconvenient to me. :)
That said, if you're NEVER able to step into ANY ObjC method call, then there's likely another problem, as I've been able to step into ObjC method calls many times with Xcode 4, and don't see this problem any more or less often than I did with Xcode 3.
fn+f7 always works for me. Although step into in Obj-C is kinda weird from time to time. You'd better set more breakpoints if you know where the code is heading.
I don't know enough about OSX to understand why this is fubar but I just tried changing the default key bindings to f13-f17 for all the usual bindings of pause/continue, step into/out of etc. Works for me. Pretty sucky QA on the XCode4 team possibly?
Switching to the gdb debugger works for me. Go to Edit Schemes, the Info tab for the Run phase, change from LLDB to GDB.
It's still not perfect. In particular it seems you have to use "Step into instruction" (with the appropriate key, or holding ctrl while hitting the step button) a lot if nothing happens, and to see registers and so on you have to use the gdb command line within the Xcode windows.
Remove the particular file and add the file again. This fixes my problem.

How to find source of print() or NSLog() console output in Xcode

I'm not sure if this is possible. Here is an example situation:
Something is printing to my console and I don't know where it is coming from in the code. I did a quick search using the Finder in Xcode on terms such as 'NSLog' and 'print'. Nothing relevant came up.
Is there any quick way that Xcode has of finding where the source of the output is coming from ?
Kind of like when you right click on a method and you have all the options of exploring different parts of the code associated with that method.
Also: are there other functions that print besides NSLog and print?
Thanks so much!
Try running in the debugger, with breakpoints set on printf, NSLog, etc. When you hit a breakpoint do a backtrace (bt) to see where it's being called from
There's a plugin LinkedLog for that. You replace all NSLogs with LLogs and then will be able to just tap on link in Xcode's console to get to the line caused it to appear.
Didn't try it myself, but definitely will.

Resources