Setup OpenEars for debugging

Home Forums OpenEars Setup OpenEars for debugging

Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)

  • Author
    Posts
  • #1021819
    Daniel Asher
    Participant

    Hi,

    I’m new here and am looking forward to working with OpenEars!

    I’ve downloaded the OpenEarsDistribution and have successfully stepped into OpenEarsSampleApp, but have not managed to step into OpenEars.

    The steps I took were:

    * Opened OpenEarsSampleApp into Xcode 5.1.1
    * Dragged OpenEars into OpenEarsSampleApp as a subproject
    * Added OpenEars as a OpenEarsSampleApp -> Build Phases -> Target Dependency
    * Placed first breakpoint at ViewController.m:71
    * Placed second breakpoint at PocketsphinxController.m:85
    * Product -> Run

    The first breakpoint is hit, but the second is not.
    I know OpenEars.framework is being built and loaded correctly because inserting an NSAssert(false,…) before PocketsphinxController.m:85 causes OpenEarsSampleApp to fail with an uncaught exception.

    Any help to enable debugging into OpenEars Objective-C and pocketsphinx C would be much appreciated!

    regards,

    Daniel

    #1021820
    Halle Winkler
    Politepix

    Welcome Daniel,

    A framework is already object code – you can’t add breakpoints to it. What do you need to debug? Maybe I can help.

    #1021824
    Daniel Asher
    Participant

    Hi Halle,

    Many thanks for your quick response! I’m sure you can help :)

    I wish to step through pocketsphinx code to help me understand how it works. I believe I’m building the object code in Xcode. Is Xcode able to produce a debug version of the framework?

    Daniel

    #1021825
    Halle Winkler
    Politepix

    Sure, you can definitely build a debug version by setting the target’s scheme to build/run debug, but when you build it, the target is a framework which is compiled object code that your app then links to, so no breakpoints since there is nothing in the workspace connecting the built framework and your project changes. I think that stepping through OpenEars in a debugger is probably not going to be a good approach for learning how Pocketsphinx works, since OpenEars is really designed for painless continuous-listening app and vocabulary building and that means it ships a drag-and-drop framework to keep things simple.

    I think an elegant way to use your approach for learning Pocketsphinx would be to step into the Pocketsphinx executables for Linux, which are easy to build on (for instance) Ubuntu. I always keep an Ubuntu virtual machine (or several) around for when I need to get quality time with Pocketsphinx directly.

    #1021826
    Daniel Asher
    Participant

    Hi Halle,

    I don’t have Linux or Ubuntu. So I must ask – is it impossible to step into OpenEars.framework from OpenEarsSampleApp in Xcode?

    I feel there must be a solution to this problem.

    thanks,

    Daniel

    #1021827
    Halle Winkler
    Politepix

    Hi Daniel,

    is it impossible to step into OpenEars.framework from OpenEarsSampleApp in Xcode?

    Yes, this is what I have been saying in my answers above. A built framework does not have a mechanism for sharing its breakpoints with an app project. If Apple shipped their iOS frameworks with breakpoints turned on accidentally, they would also not break in your debugger when you linked an app to those frameworks.

    #1021834
    Daniel Asher
    Participant

    Hi Halle,

    can you share how you use the Xcode debugger with the OpenEars.framework? I would really appreciate any guidance here. Do you compile to a static library – any tips would help!

    many thanks,

    Daniel

    #1021836
    Halle Winkler
    Politepix

    Hi Daniel,

    I have a very particular setup here for testing and it’s unfortunately a bit outside of the scope of the support I can give here. Sorry! This hasn’t come up before as a developer need, but the use case you’ve described sounds like a perfect match for doing your debugging directly on Pocketsphinx’s executables, since Pocketsphinx is your interest in stepping through rather than OpenEars. VirtualBox and Ubuntu are 100% free and they make a great setup for doing exactly the kind of Pocketsphinx research you have described.

    #1021837
    Daniel Asher
    Participant

    Hi Halle,

    of course it is disappointing to hear that stepping through and debugging the source code is not currently supported by the OpenEars project. I really hope that this can be changed in the near future.

    I have started to play with the code, modifying it to return ps_seg_frames in getAndReturnHypothesisForDecoder. I need these for my application. I very much hope to work with you and OpenEars in the future, but without debugging support I believe my workflow will be frustrated.

    Any hints, however quick, will be very much appreciated!

    with kindest regards,

    Daniel

    #1021839
    Halle Winkler
    Politepix

    Sorry!

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.