Brett
Brett

Reputation: 12007

Xcode: finding a variable value while setting a breakpoint

I am a seasoned Visual Studio programmer, and when I set a breakpoint, I can open an intermediate window and type ?variableName to view the current value of the variable.

In Xcode however, I can't seem to find an equivalent. I can hover over the variable name when stepping through the code, but long strings are truncated in the view.

Is there an Xcode equivalent to the intermediate window of Visual Studio? If not, how can I set a breakpoint and watch the value (the full value in the case of longer strings)?

Many thanks, Brett

Upvotes: 3

Views: 3756

Answers (2)

Winder
Winder

Reputation: 1984

There is a debugger GUI you can open by clicking the little spray bottle next to the step commands (or through Run > Debugger). It has a GUI window with pretty much all the objects in the frame you're looking at and the current call stack.

Upvotes: 0

Tal Bereznitskey
Tal Bereznitskey

Reputation: 2051

Use the console window (under the Run menu - choose "Show console") and then it's a gdb debugger. Then you can issue:

po variableName

Another way is to hover over the variable, right-click (or [Ctrl]+[left-click]) and choose "Print Description". The output will be sent to the gdb console.

Upvotes: 10

Related Questions