Debugging ncurses application with gdb

后端 未结 2 765
野性不改
野性不改 2020-12-17 20:51

I\'m trying to debug my ncurses application, using gdb. I use tty command to redirect program\'s I/O to another terminal. Output works like a charm, but I\'m having

2条回答
  •  一个人的身影
    2020-12-17 21:36

    You can attach to your process to debug from a different terminal instead of trying to run the application from within gdb.

    Run your process as normal. When it is blocked for user input, find its process ID, and then attach to it with gdb from a different window:

    gdb -p 
    

    Your problem is due to the program still expecting its interactive input to be coming from your gdb session.

提交回复
热议问题