Stepping through code from a library
Posted: Thu Jun 30, 2011 5:54 pm
Hi,
I am an inexperienced programmer and have the following question.
I have a C project and it uses a static linked library (that I created myself). I need to debug some code in this project and am stepping through the code in debug mode (using gdb, gcc). When the function from the library gets called, codelite editor does not show the C code of the function from the library and therefore I cannot step through the code from the library.
Thinking about it, such behaviour may be expected. A library contains object code and not the source code, so codelite editor is not aware of the source code of the library and may not show the source file from the library as I step through the code. However, the "Call Stack" tab in the Debugger pane shows the called function from the library and the "Locals" pane shows the local variables from the function in the library.
So, is it possible to step through the code from the library using codelite's editor when I want to debug the C project which links to that library ? And if so, how ?
A simple solution would be to forget about libraries and linking and copy over all the source code from the library to the C project, but I don't want that since I want to modify and reuse that library in other projects.
I appreciate any help. Thanks!
I am an inexperienced programmer and have the following question.
I have a C project and it uses a static linked library (that I created myself). I need to debug some code in this project and am stepping through the code in debug mode (using gdb, gcc). When the function from the library gets called, codelite editor does not show the C code of the function from the library and therefore I cannot step through the code from the library.
Thinking about it, such behaviour may be expected. A library contains object code and not the source code, so codelite editor is not aware of the source code of the library and may not show the source file from the library as I step through the code. However, the "Call Stack" tab in the Debugger pane shows the called function from the library and the "Locals" pane shows the local variables from the function in the library.
So, is it possible to step through the code from the library using codelite's editor when I want to debug the C project which links to that library ? And if so, how ?
A simple solution would be to forget about libraries and linking and copy over all the source code from the library to the C project, but I don't want that since I want to modify and reuse that library in other projects.
I appreciate any help. Thanks!