[SailfishDevel] Debugging external libraries

Dmitriy Purgin dpurgin at gmail.com
Mon Mar 16 16:13:22 UTC 2015


Hi,

thanks for answering.

Yes, I do have both debuginfo and debugsource packages on both Mer VM and
Jolla Emulator VM but it doesn't help much. If I understand it correctly,
the gdb client that runs on the host machine should access the sources that
debugging symbols point to, but these sources should be synchronised with
host machine in order to access them. Gdb output panel shows that gdb
receives an alias for /usr/src pointing to location at
SailfishOS/mersdk/targets/SailfishOS-i486 but I don't seem to have this
directory at all, and manual sync with scp doesn't help.

Moreover, I start to think that trying to step into C++ code from QML was a
bad idea because I can't even step to my own shared library from my own QML
code -- I have to put a break point at entry point of C++ procedure called
from QML and start from there.

Cheers
Dmitriy

2015-03-16 17:07 GMT+06:00 Tone Kastlunger <users.giulietta at gmail.com>:

> Also do you have debugging symbols for that particular library installed
> (either on phone or simulator, wherever you are testing)?
>
> Best,
> tk
>
> On Sun, Mar 15, 2015 at 7:10 PM, Andrey Kozhevnikov <
> coderusinbox at gmail.com> wrote:
>
>>  Yes i was thinking about no contacts case. As seaside is cached database
>> it can not produce any calls if no contacts. Talking about debugging imho
>> you need to build a static library to see what happening inside it. But i
>> may be wrong.
>>
>> 15.03.2015 18:08, Dmitriy Purgin пишет:
>>
>>  Hi,
>>
>>  thanks for answering.
>>
>>  What difference does debugging on device or emulator make to debugging
>> the contacts lib itself if the environment is set properly for both? The
>> worst case you get is that it tells you that there are no contacts
>> whatsoever. The question is not about debugging the contacts database but
>> about the principles of debugging any shared library. The only reason I've
>> brought the contacts lib as an example is because I'm working with it now.
>>
>> So in this case I'd like to trace the execution of personByPhoneNumber().
>> In other words, step into seasidefiltermodel.cpp and look what's happening
>> in SeasideFilteredModel::personByPhoneNumber and further
>> seasidecache.cpp's SeasideCache::itemByPhoneNumber, and so on.
>>
>>  Cheers
>>  Dmitriy
>>
>> 2015-03-15 18:00 GMT+06:00 Andrey Kozhevnikov <coderusinbox at gmail.com>:
>>
>>>  imho you need to install it to phone and debug contacts on device, not
>>> emulator?
>>>
>>> 15.03.2015 16:47, Dmitriy Purgin пишет:
>>>
>>>    Hi,
>>>
>>>  I'm struggling the whole day with this problem. Is there a way to debug
>>> a shared library not included to a project? In particular I'd like to see
>>> what's happening in nemomobile-qml-plugin-contacts-qt5.
>>>
>>>  I have the following sample code being executed in Sailfish Emulator:
>>>
>>>  import org.nemomobile.contacts 1.0
>>>
>>> // ...
>>>
>>>  PeopleModel {
>>>      id: people
>>>  }
>>>
>>> // ...
>>>
>>>  var p = people.personByPhoneNumber('somephonenumber');
>>>
>>>  I'm putting a break point on people.personByPhoneNumber() call and try
>>> to step in, and it doesn't work.
>>>
>>> Prior to trying to step into the library code I've installed both
>>> nemomobile-qml-plugin-contacts-qt5-debuginfo and
>>> nemomobile-qml-plugin-contacts-qt5-debugsource to i486 target using Qt
>>> Creator's SailfishOS tab. After that stepping in didn't work. Then I pushed
>>> the 'sync' button  a couple of times to make sure it worked but it didn't.
>>>
>>>  Then I've logged into the build machine and installed these packages
>>> using zypper. Pushed the 'sync' button in Qt Creator but stepping in still
>>> didn't work. Interesting thing is though that the packages were installed
>>> as if there were no packages installed using Qt Creator.
>>>
>>>  I've looked into gdb output and saw that it sets substitute-path
>>>
>>> SailfishOS/mersdk/targets/SailfishOS-i486/usr/src for /usr/src. I didn't
>>> have anything in SailfishOS/mersdk/targets/SailfishOS-i486/usr/src, in
>>> fact, I didn't have the src directory at all. It seems like the packages
>>> I've installed in the build machine were not synchonised with my host
>>> machine. I've done it with scp transfer but stepping in still doesn't work.
>>>
>>>
>>>  Could anyone please give me some hints on debugging external libraries
>>> or guide me to any resource explaining the process?
>>>
>>>
>>>  Thanks.
>>>
>>>
>>>  Cheers
>>>
>>> Dmitriy Purgin
>>>
>>>
>>>
>>>
>>>  _______________________________________________
>>> SailfishOS.org Devel mailing list
>>> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org
>>>
>>>
>>>
>>> _______________________________________________
>>> SailfishOS.org Devel mailing list
>>> To unsubscribe, please send a mail to
>>> devel-unsubscribe at lists.sailfishos.org
>>>
>>
>>
>>
>> _______________________________________________
>> SailfishOS.org Devel mailing list
>> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org
>>
>>
>>
>> _______________________________________________
>> SailfishOS.org Devel mailing list
>> To unsubscribe, please send a mail to
>> devel-unsubscribe at lists.sailfishos.org
>>
>
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscribe at lists.sailfishos.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20150316/ea846f0e/attachment-0001.html>


More information about the Devel mailing list