Search code examples
clinuxncurses

How to debug ncurses ?


I wanna learn something from ncurses, so that I can use assembly to write some simple functions to draw graphics.

For example, when I step into initscr, then I'm right here /lib/x86_64-linux-gnu/libncurses.so.6, I can't see any c code. Do you have some any ways to solve this problem?

I use below commands to install ncurses!

wget https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.2.tar.gz

tar xvzf ncurses-6.2.tar.gz

cd ...

./configure --with-shared --with-normal --with-debug --enable-overwrite

make

sudo make install

Solution

  • You need linker libncurses_g.a

    gcc -g ... -o ... /usr/lib/libncurses_g.a