Debugging static library

  • Hello,

    scenario is simple (like a lot of films I saw lately), I have a
    standard tool apps, and a static BSD lib. That makes 2 Xcode projects.

    Now, I add my .a to my app, and everything compile fine, app run fine
    and all. The thing is, I wanna debug my lib. How can I do that? I
    mean, I have two projects open, I put breakpoints in my lib projects
    and I can stop at those. This is what I want.

    At the moment, as a workaround, I add all my lib files into my app
    Xcode project and I compile all at once, but this is a pain, so I
    want to avoid it.

    Regards

    --
    Kuon

    "Don't press that button."
    http://goyman.com/
    Blog: http://kuon.goyman.com/
  • One possibility would be to make the library dynamic.
    Then you would only need to recompile what you change.

    You can return to a static library for your final product.
    Good luck.

    -------------- Original message ----------------------
    From: Kuon <kuon...>
    > Hello,
    >
    > scenario is simple (like a lot of films I saw lately), I have a
    > standard tool apps, and a static BSD lib. That makes 2 Xcode projects.
    >
    > Now, I add my .a to my app, and everything compile fine, app run fine
    > and all. The thing is, I wanna debug my lib. How can I do that? I
    > mean, I have two projects open, I put breakpoints in my lib projects
    > and I can stop at those. This is what I want.
    >
    > At the moment, as a workaround, I add all my lib files into my app
    > Xcode project and I compile all at once, but this is a pain, so I
    > want to avoid it.
    >
    > Regards
    >
    > --
    > Kuon
    >
    > "Don't press that button."
    > http://goyman.com/
    > Blog: http://kuon.goyman.com/
    >
    >
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Xcode-users mailing list      (<Xcode-users...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/xcode-users/<ygor...>
    >
    > This email sent to <ygor...>
  • Usually this is a problem with Xcode's "lazy symbol loading"
    optimization.  We try to delay loading debug information till it is
    needed, but for that to work for file & line breakpoints, Xcode needs
    to know which executable a given source file was built into.  When you
    split up the projects, Xcode can't figure this out.

    You can verify that by going to the Debugging tab of the Xcode
    Preferences, and unchecking the "load symbols lazily" checkbox.  Then
    see if your breakpoints work.

    If your project is not terribly big, then you probably won't notice
    the slowdown in startup time from doing this.  But if this bugs you,
    then you can achieve the same effect by turning "Load symbols lazily"
    back on, and then changing the Default Loading Level in the Shared
    Libraries window for the executable that gets the .a file to All.
    There's some discussion of this in the on-line help if this comment is
    not clear to you...

    Jim

    On Jul 26, 2007, at 1:25 PM, Kuon wrote:

    > Hello,
    >
    > scenario is simple (like a lot of films I saw lately), I have a
    > standard tool apps, and a static BSD lib. That makes 2 Xcode projects.
    >
    > Now, I add my .a to my app, and everything compile fine, app run
    > fine and all. The thing is, I wanna debug my lib. How can I do that?
    > I mean, I have two projects open, I put breakpoints in my lib
    > projects and I can stop at those. This is what I want.
    >
    > At the moment, as a workaround, I add all my lib files into my app
    > Xcode project and I compile all at once, but this is a pain, so I
    > want to avoid it.
    >
    > Regards
    >
    > --
    > Kuon
    >
    > "Don't press that button."
    > http://goyman.com/
    > Blog: http://kuon.goyman.com/
    >
    >
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Xcode-users mailing list      (<Xcode-users...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/xcode-users/<jingham...>
    >
    > This email sent to <jingham...>
  • Kuon wrote:

    > scenario is simple (like a lot of films I saw lately), I have a
    > standard tool apps, and a static BSD lib.

    Not strictly "debugging", but if your app is intended to run in
    10.3.9, read
    <http://lists.apple.com/archives/xcode-users/2006/Apr/msg00293.html>

    > "Panther's /usr/bin/ld can't interpret object files created by gcc 4."

    Robert P.
previous month july 2007 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today