July 2, 2014 at 12:58 pm #1021819
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!
DanielJuly 2, 2014 at 1:03 pm #1021820
A framework is already object code – you can’t add breakpoints to it. What do you need to debug? Maybe I can help.July 2, 2014 at 3:09 pm #1021824
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?
DanielJuly 2, 2014 at 3:22 pm #1021825
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.July 2, 2014 at 3:50 pm #1021826
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.
DanielJuly 2, 2014 at 3:56 pm #1021827
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.July 2, 2014 at 5:25 pm #1021834
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!
DanielJuly 2, 2014 at 5:33 pm #1021836
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.July 2, 2014 at 6:22 pm #1021837
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,
DanielJuly 2, 2014 at 6:34 pm #1021839
- You must be logged in to reply to this topic.