Why does GDB debugger constantly freeze Xcode 4?

2019-05-06 20:35发布

This is a really weird bug...

I'm working on an iPhone project using the camera feed and running it through an OpenGL shader to apply effects to it. However, every time I simply create a new GLfloat in the code, the debugger freezes when launched... I can't copy and paste the text because the whole of XCode freezes up, but I've cobbled it together from one of the log files:

GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:56:02 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin --target=arm-apple-darwin".2#b2a16f854957b341^2@43"Xcode.IDEFoundation.ConsoleAdaptor.Debugger17"tty /dev/ttys000
(gdb) 

The phone has not frozen, because I can hit the home button and carry on doing other stuff on it. However, Xcode 4 has completely frozen with a beachball running at 99% CPU, and I have to Force Quit and start it again.

However... The really strange thing is I have an iPhone 3GS, and when I borrow someone's iPhone 4 it compiles and runs fine. When I switch back to the iPhone 3GS, it's fine for the first time only... After that, it freezes constantly again.

Is this possibly something I am doing, or is it yet another XCode 4 bug? I wanted to try switching the debugger to LLDB, but that doesn't appear in my dropdown list in the Scheme window... Even though the Xcode User Guide states that both GDB and LLDB are available:

http://developer.apple.com/library/mac/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/Debugging/Debugging.html

Thanks!

5条回答
Juvenile、少年°
2楼-- · 2019-05-06 21:06

Minimizing "NSLog" statements within loops helps for applications using OpenGL ES, OpenCV, etc.

查看更多
做个烂人
3楼-- · 2019-05-06 21:08

I am working on a video processing app as well, and this is exactly the symptoms i am having. it works in waves. I don't know what the reason for this is, but i am slowly gathering facts to solve it:

  • turning off GDB in Scheme settings removes the issue
  • with GDB ON, "wait for app to launch" seems to solve the issue (need more testing)
  • after getting into "stable freeze" mode, meaning, beachball on run every single time, Committing to repository removes the issue (??)
  • restoring device as a new device to latest iOS through iTunes solves the issue

all of the above except turning off GDB only solves the issue temporary - it comes back after few more runs...

查看更多
我想做一个坏孩纸
4楼-- · 2019-05-06 21:26

Try to have terminal open, AND IN THE FOREGROUND (ON TOP OF XCODE) when the program builds and begins running.

Also, if possible, try downloading xcode 4.1. This seemed to fix this annoying problem for good, AND I can actually use the debugger again !

查看更多
可以哭但决不认输i
5楼-- · 2019-05-06 21:30

I had this problem once before and it started happening again all day today. I've tried everything from cleaning the project to restart both my iPad and MacBook Pro and even swapping a different cable.

What worked the two times this has happened: I cleaned the project, changed the build target, and ran it on the iPhone simulator, iPad simulator. Then returned to the original (main) build target (the actual app) and ran that on the iPhone and iPad simulators. All of those ran correctly, so I finally ran the original app on the iPad device and it worked and has kept working.

Seems like a combination of cleaning the project, changing build targets, and running on the simulator is flushing something out that previously caused XCode and my iPad device to hang and freeze.

Good luck

查看更多
beautiful°
6楼-- · 2019-05-06 21:33

In my case it was the wrong Code Signing Identity

查看更多
登录 后发表回答