Use GDB to debug a C++ program called from a shell script

前端 未结 6 1679
自闭症患者
自闭症患者 2020-12-24 13:18

I have a extremely complicated shell script, within which it calls a C++ program I want to debug via GDB. It is extremely hard to separate this c++ program from the shell si

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-24 13:52

    Modify the c++ application to print its pid and sleep 30 seconds (perhaps based on environment or an argument). Attach to the running instance with gdb.

提交回复
热议问题