How to run multiple command in a single line?

debugging, gdb, linux

Solution

Use `define` command to define your own command:

(gdb) define mycommand
Type commands for definition of "mycommand".
End with a line saying just "end".
>info threads
>c
>end
(gdb) mycommand

For detailed information, you can refer: https://sourceware.org/gdb/onlinedocs/gdb/Define.html#Define.

Problem

I'm trying to run multiple commands on a single line, e.g ``` (gdb) info threads; c Args must be numbers or '$' variables. ``` But it looks like gdb doesn't support so. Any ideas?

Original source

Related problems