Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete all debug expressions from Xcode 5.1 Project

Tags:

c++

xcode

I accidentally added a debug expression while working with C++ and XCode 5.1, and now every time I try to view the stack of the function I added this expression to, XCode crashes. I have no idea how to get rid of this expression without clicking on that function, so I'm a bit lost! I have found references to an Expressions.something file, but that was for XCode 4, and I don't see it anywhere for XCode 5. Any ideas?

like image 563
pat Avatar asked Aug 13 '14 19:08

pat


1 Answers

Here's how you do it:

1) Close Xcode.

2) In Finder, right click on your Xcode project and choose 'Show package contents' then keep navigating in and opening package contents when required to:

[your_workspace].xcworkspace/xcuserdata/[login_user_name].xcuserdatad/xcdebugger/Expressions.xcexplist

3) Delete the Expressions.xcexplist file.

4) Open Xcode.

You should now have no expressions set for this project.

Some interesting things to note about this file for editing purposes:

  • It is a plist type structure, hence you can open it as XML / text.
  • You can manually remove sections of scoped expressions.
  • <ContextState contextName="GLOBAL"> contains all the global expressions that can cause Xcode slowdown under some circumstances, ie. unconstrained C++ containers (with no explicit size) that must be evaluated in each stack frame context such as std::list<>. If you use C++ - you may know the pain of the Xcode UI locking up whilst each debugger step is taken. This is why i sought out this issue in the first place.
  • Other <ContextState> sections contain the decorated function name containing expressions for that stack frame context.
like image 116
mysticcoder Avatar answered Nov 15 '22 21:11

mysticcoder