kstenerud / iOS-Universal-Framework

An XCode project template to build universal frameworks (arm7, arm7s, and simulator) for iOS / iPhone.
2.95k stars 473 forks source link

Can't set breakpoints in framework project #38

Open mattjgalloway opened 12 years ago

mattjgalloway commented 12 years ago

Hi,

I'm not entirely sure if this is an issue with iOS-Universal-Framework or Xcode itself, but I'm having issues with a framework project I created using iOS-Universal-Framework. It's a fake framework and I'm using the normal .framework file. I have the framework project and my app project in a workspace and I set breakpoints in the framework project's code but GDB never breaks on them. If I manually add a breakpoint with, for instance, SomeFile.m:123 then GDB tells me that it can't find the file called SomeFile.m so it looks like debug symbols are being stripped. I've checked and I definitely have the option for stripping debug symbols set to NO though.

Any thoughts on this issue or how to work around it?

Setup:

Matt

jverkoey commented 12 years ago

Running into the same issue. No solution yet.

roxatdsi commented 12 years ago

Same issue here, any ideas for a work around?

armelle commented 12 years ago

I'm having the same problem!

EPage-Ed commented 12 years ago

I have this issue - quite frustrating.

mattjgalloway commented 12 years ago

FWIW I have a question open on StackOverflow for this as well - http://stackoverflow.com/questions/8743284/ios-framework-project-breakpoints-not-working

My solution so far is to sadly not use iOS Universal Framework. I've found that for me, using a normal static library is actually perfectly fine.

drivellc commented 12 years ago

So how do you share nibs and other resources from another library (or does anyone know a best practice?).

mattjgalloway commented 12 years ago

I wrote a tutorial for sharing resources with a static library: http://iphone.galloway.me.uk/iphone-sdktutorials/ios-library-with-resources/

That's the solution I use these days.

EPage-Ed commented 12 years ago

I don't see a dSYM file for the framework. Even though build settings are correct, it's not showing up in the products folder. A project in the workspace generates a dSYM file.

EPage-Ed commented 12 years ago

Odd... even though Strip Symbols is set to NO, I see a Strip command at the end of building the framework in the build log.

mattjgalloway commented 12 years ago

What's in the strip command though? Maybe it's being called but not actually doing any actual stripping?

EPage-Ed commented 12 years ago

Edited output from log...

Strip [path to framework] cd [framework dir] setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strip -x [path to framework]

jverkoey commented 12 years ago

I've taken some time to solve this problem here:

https://github.com/jverkoey/iOS-Framework

mattjgalloway commented 12 years ago

@jverkoey Nice work there. Like the work on a resources bundle, very similar to the tutorial I posted about it. What specific commit fixes the issue we're discussing here, OOI? <-- Sorry I totally misunderstood as I thought your project was forked from this one so thought there'd be a commit you fixed it in.

jverkoey commented 12 years ago

There is something peculiar about debugging fake frameworks. It possibly has to do with having to use the -framework flag to link the framework in, but I'm not 100% certain of the exact reason why it doesn't work. Treating the framework simply as a static library solves the problem though.

mattjgalloway commented 12 years ago

Ah right. Yes so you're basically changing the whole thing to a static library with the resources bundle trick. I am totally with you on that one and it's exactly what I've been doing. Great work on the project and associated documentation - very informative.