I don't want to spend time searching for the PID of the process I want to attach to, so I do something like this,
gdb -p ($pidof foo)
where foo is the process name.
I want to know if I can so something like this from within GDB.
I am looking for something like the following.
(gdb) attach $(pidof foo)
Illegal process-id: $(pidof foo).
(gdb) attach `pidof foo`
Illegal process-id: `pidof foo`.
Is there anything like this in GDB?