diff --git a/script/shell_modify_variable_attach_parent.sh b/script/shell_modify_variable_attach_parent.sh index 87ee1cb..59717d8 100644 --- a/script/shell_modify_variable_attach_parent.sh +++ b/script/shell_modify_variable_attach_parent.sh @@ -1,13 +1,11 @@ #!/bin/bash expect -c " - spawn gdb -q attach $1 + set timeout 60000 + spawn gdb -q -iex \"set pagination off\" attach $1 expect { \"gdb\" {send \"set follow-fork-mode $2\n\";} } - expect { - \"gdb\" {send \"set pagination off\n\";} - } expect { \"gdb\" {send \"$3\n\";} } @@ -35,6 +33,9 @@ expect -c " expect { \"gdb\" {send \"c\n\";} } + expect { + \"exited\" {send \"quit\n\";} + } interact " \ No newline at end of file