debugging - Use GDB to debug a C++ program called from a shell script -
i have extremely complicated shell script, within calls c++ program want debug via gdb. extremely hard separate c++ program shell since has lot of branches , lot of environmental variables setting.
is there way invoke gdb on shell script? looks gdb
requires me call on c++ program directly.
there 2 options can do:
invoke gdb directly within shell script. imply don't have standard in , standard out redirected.
run shell script , attach debugger running c++ process so:
gdb progname 1234
1234
process id of running c++ process.
if need things before program starts running option 1 better choice, otherwise option 2 cleaner way.
Comments
Post a Comment