Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems mousing over variable names in iPhone debugger

I'm attempting to do some debugging in GDB for an iPhone app issue. When I mouse over a string variable to see the contents the console goes into an infinite scroll with the text "Unable to access variable ".

Any ideas on why this might be happening?

like image 959
radesix Avatar asked Apr 15 '10 18:04

radesix


People also ask

How to check variable value while debugging in Xcode?

See Variable Values in Code and the Variable Viewer When your app pauses at a breakpoint, hover over a variable in your source code to view its current value. If the variable is an image or other type that isn't expressible as text, click the Quick Look button at the upper-right to see a preview of the variable.

How to watch a variable in Xcode?

When you find your variable, right-click on it and choose “Watch”. Once that's done you can continue your program as normal, and anywhere the variable is read from or written to Xcode will pause and you can use the debug navigator to step through the call stack to figure out what happened.


1 Answers

For future reference, there are several major causes:

  • Target-level optimization settings: there should be no optimization
  • Target-level strip symbols: symbols should not be stripped
  • Target-level level of debugging symbols: default or all symbols should be used
  • Per-file compiler flags (get-info on file, choose Debug tab): Make sure there are no optimization per-file settings as there is no way to specify in what configuration (debug or release) they should be used, so they're always used.

I go into more detail here.

like image 101
Joshua Nozzi Avatar answered Nov 14 '22 21:11

Joshua Nozzi