Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / April 2006



Tip: Looking for answers? Try searching our database.

How to debug a static library in XCode?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lou Pecora - 26 Apr 2006 14:58 GMT
In XCode 1.5 I could set breakpoints in the source code windows of
library modules and they would work.  IN XCode 2.0 they no longer work.  
I set them, but they are ignored.  Breakpoints in the source code for
the executable work fine.

I have searched Help and some online stuff (XCode Forums seem shut
down), but have not found out how to "turn on" library debugging.  There
is some (dense) information about lazy loading of symbols and setting
things in the shared library debugging window, but nothing seemed to
work (not sure what I did right or wrong either).

Any pointers appreciated.

My library is  static carbon.  Code is in C++.  The executable is a
carbon app.  Running on a Powerbook in OS X 10.4.

Thanks.

-- Lou Pecora  (my views are my own) REMOVE THIS to email me.
Patrick Machielse - 26 Apr 2006 16:03 GMT
> In XCode 1.5 I could set breakpoints in the source code windows of
> library modules and they would work.  IN XCode 2.0 they no longer work.
> I set them, but they are ignored.  Breakpoints in the source code for
> the executable work fine.

Could it be that you build the static library without debugging symbols?

patrick
Lou Pecora - 26 Apr 2006 17:28 GMT
> > In XCode 1.5 I could set breakpoints in the source code windows of
> > library modules and they would work.  IN XCode 2.0 they no longer work.
[quoted text clipped - 4 lines]
>
> patrick

Yes, but how do I build it with the symbols?  Somehow (I guess) that
happened automatically under XCode 1.5, but not 2.0.  The executable
must have symbols turned on automatically.

-- Lou Pecora  (my views are my own) REMOVE THIS to email me.
Patrick Machielse - 26 Apr 2006 19:45 GMT
> > Could it be that you build the static library without debugging symbols?
>
> Yes, but how do I build it with the symbols?  Somehow (I guess) that
> happened automatically under XCode 1.5, but not 2.0.  The executable
> must have symbols turned on automatically.

In each target's build setting you can specify the 'Generate Debug
Symbols', so it is possible that the settings are different between you
static library target and the application target. The default setting
(as far as I know) is for the Debug style to generate the symbols.

patrick
Lou Pecora - 28 Apr 2006 12:29 GMT
> > Yes, but how do I build it with the symbols?  Somehow (I guess) that
> > happened automatically under XCode 1.5, but not 2.0.  The executable
[quoted text clipped - 6 lines]
>
> patrick

My setting is checked, but the phrase Generate Debug Symbols has a line
through it like it is stricken out.  I cannot change that.  Does anyone
know what that means?

-- Lou Pecora  (my views are my own) REMOVE THIS to email me.
Wade Williams - 28 Apr 2006 21:13 GMT
>>> Yes, but how do I build it with the symbols?  Somehow (I guess) that
>>> happened automatically under XCode 1.5, but not 2.0.  The executable
[quoted text clipped - 10 lines]
> through it like it is stricken out.  I cannot change that.  Does anyone
> know what that means?

It means the target setting is overridden by an active build style.

See the XCode documentation:

http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuid
e20/Contents/Resources/en.lproj/bs_build_settings/chapter_31_section_8.html#//ap
ple_ref/doc/uid/TP40001440-CH229-BACHHHIJ


(Item

#2 under that link)

Wade
Patrick Machielse - 28 Apr 2006 23:53 GMT
> On 2006-04-28 06:29:17 -0500, Lou Pecora
>
[quoted text clipped - 3 lines]
>
> It means the target setting is overridden by an active build style.

Lou,

As of Xcode 2.2 the 'build styles' of old have been replaced by 'build
configurations'. In the new build configuration system, the settings in
the target's build configuration override the settings in the project
build configuration. The 'build styles' worked the other way around: the
project build style would override the target build style setting.

In Xcode 2.0, when you enable 'generate debug symbols' in the project's
Debug build style, all targets should be build with symbols. This should
be the default setting, so I'm not sure if this solves your original
problem.

patrick
Lou Pecora - 29 Apr 2006 13:23 GMT
> > On 2006-04-28 06:29:17 -0500, Lou Pecora
> >
[quoted text clipped - 11 lines]
> build configuration. The 'build styles' worked the other way around: the
> project build style would override the target build style setting.

I realize there's a whole lot that I do not know about Xcode.  How do I
change build styles and/or the new build configurations.  I have no clue
where/how they are set.  I did go to the documention as someone
suggested, but I must be overlooking something.

Thanks for your help.

-- Lou Pecora  (my views are my own) REMOVE THIS to email me.
Patrick Machielse - 29 Apr 2006 14:28 GMT
> I realize there's a whole lot that I do not know about Xcode.  How do I
> change build styles and/or the new build configurations.  I have no clue
> where/how they are set.  I did go to the documention as someone
> suggested, but I must be overlooking something.

You can change the build settings in 2 places:

- for the whole project: click on the (top, blue) project icon, press
command-i, choose build
- for each target: click on the target, press command-i, choose build

In your situation (styles), any project wide build setting you change
overrides the corresponding setting for all targets.

In any event, I would advise upgrading to Xcode 2.2; it's better, it
adds support for universal binaries, and it's free.

patrick
Lou Pecora - 30 Apr 2006 15:54 GMT
> You can change the build settings in 2 places:
>
[quoted text clipped - 4 lines]
> In your situation (styles), any project wide build setting you change
> overrides the corresponding setting for all targets.

Thanks.

> In any event, I would advise upgrading to Xcode 2.2; it's better, it
> adds support for universal binaries, and it's free.

Yes, this is probably a good idea.  Thanks.

-- Lou Pecora  (my views are my own) REMOVE THIS to email me.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.