Execute GDB commands before attaching to a running program

Theo <[email protected]>
Newsgroups gmane.comp.kde.users.kdevelop
Message-ID <[email protected]>
How do I execute GDB commands before the debugger gets attached to a
running program? Attaching with "Run/Attach to Process/Attach to Process
with GDB" seems to be equivalent to "gdb -p procID". I need an
equivalent of the GDB "-command=file" option where I include the attach
command into "file".
Alternatively, this would be possible if I could start GDB without being
attached to a program and use the command line interface "GDB cmd" of
KDevelop to execute my commands, although this would become tedious for
a long list of commands, so it would be more useful if there was a way
to feed a batch of commands at once into GDB.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.