Segmentation fault when remotely debugging into a shared library from Qt creator 2.7.1

We have a app and a linked shared library. When we remotely debug it under Qt creator 2.7.1, we suffered from a segmentation fault when we step into (F11) a function defined in shared library.

One solution in here said we must define LD_LIBRARY_PATH to our library path. We defined it in Qt creator's Projects->Build & Run->Run tag as below:

LD_LIBRARY_PATH=/usr/lib

However no luck after defining that env variable. Finally, another solution in here said we must set the sysroot path in Kits setting (Projects->Build & Run->Manage Kits). The sysroot path need to have a copy of target file system (in our case, the target device is an arm device).

We followed the suggestion from second link. We copied some folder under the root directory (/). They are listed as below image.


Set the sysroot path to the path of this copied target file system. Rebuild our shared library and app and redeploy to device, press F5 to start remotely debugging, then some magic happened! We can step into the shard library!

However, in Qt creator's Module list, we still found that the symbol is still not loaded. The variable evaluation window is not work as well.

留言

熱門文章