User forums > Using Code::Blocks

Debug a shared library

(1/2) > >>

ifeelfree:
I have a question related to debugging a shared library with codeblocks in Ubuntu. I have no problem when I run a C++ program with a shared library. The main problem, however, is that when I debug the program, I cannot go into the source codes of the shared library. The source codes of the shared library is provided, and I build the shared library first before I build the program. I guess that I need to set some parameters for the program's codeblocks project before running the debugging, but I have no idea where I should do the setting. Many thanks.

Some additional information is as follows:
1. My project structure is something like that:

(1)./program the running application program that will invoke run_test.so

(2) run_test.so the test dynamic library that will invoke basic_library.so

(3) basic_library.so the library called by run_test.so

When I debug ./program project I can go into the source codes of run_test.so , but when I want to step into the functions coming from basic_library.so in the source code of run_test.so, I have problems. It just ignore the step into command.

2. The version of the codeblock is 12.11, and I am running it in Ubuntu.

3. The compile I have chosen is GCC 4.6.

4. The codeblock project is created by CMake scripts.

oBFusCATed:
Make sure that basic_library.so has been built with debugging symbols (-g option) and no stripping (no -s option or explicit strip command).
You case is no special, so if you can debug one lib you can debug the other if there are symbols. If there are no symbols you can't.

ifeelfree:
Thanks for the comments. basic_library.so and run_test.so are compiled with the same compilation options as both libraries are created by CMake script. In the run_test.so project, I can go to the functions of basic_library.so very easily by using the "Find the implementation of ' ' " operation. However, when I debug, I just cannot step into these functions.


--- Quote from: oBFusCATed on July 30, 2013, 03:44:00 pm ---Make sure that basic_library.so has been built with debugging symbols (-g option) and no stripping (no -s option or explicit strip command).
You case is no special, so if you can debug one lib you can debug the other if there are symbols. If there are no symbols you can't.

--- End quote ---

oBFusCATed:
Find implementation has nothing to do with the debugger!

Start reading here: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29
And here: http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks

ifeelfree:
I have read the documents you have suggested, but still I cannot figure it out. Thanks anyway.


--- Quote from: oBFusCATed on July 30, 2013, 04:09:18 pm ---Find implementation has nothing to do with the debugger!

Start reading here: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29
And here: http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks

--- End quote ---

Navigation

[0] Message Index

[#] Next page

Go to full version