Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run multiple command in a single line? [duplicate]

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?

like image 499
daisy Avatar asked Jul 07 '14 15:07

daisy


People also ask

Can you run 2 command prompts at once?

Click Start, type cmd, and press Enter to open a command prompt window. In the Windows taskbar, right-click the command prompt window icon and select Command Prompt. A second command prompt window is opened.

How do you run multiple commands with execute?

Run Multiple Commands Through &, &&, and || sign This will allow your second command to run after the complete execution of the first command. The second command will run as soon as the first command completely runs. It won't matter that first command has run successfully or not.


1 Answers

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.

like image 70
Nan Xiao Avatar answered Nov 15 '22 15:11

Nan Xiao