gdb/2122: attach command does not accept PID in a variable
>Synopsis: attach command does not accept PID in a variable
>Arrival-Date: Thu May 04 20:08:02 GMT 2006
>Originator: [hidden email] >Release: 220.127.116.11-1.96rh
Red Hat Linux
attch does not accept a PID that is stored in a variable. For example,
(gdb) set $pid = 12345
(gdb) attach $pid
Illegal process -id:$PID
but instead if I just do
(gdb) attach 12345
it just works fine.
If there is a concern about why do we need to have the pid in a variable, then the reason is gdb can be used for automated testing for gnu based application and when there is a need to test some initialization behavior the application needs to be killed and restarted again through gdb scripts. I would be able to do every thing I need to automated testing if I could use a variable with attach command.
I have explained it in decription.