executing shell commands at gdb prompt

M R Swami Reddy MR.Swami.Reddy@nsc.com
Tue Sep 16 10:23:00 GMT 2008



ranjith kumar wrote:
> Hi,
>             I am new to gdb.
> I want to know is there any way to execute shell commands (like ls, ps
> .......)  at  gdb  command prompt??
> 
> Suppose if I want to know list of files in current directory while
> running "gdb", I have to open another shell to know it. Without
> opening it, is it possible to execute "ls " command at gdb command
> prompt??

Yes, you can do it. See below "shell command" in gdb prompt.
==
(gdb) help shell
Execute the rest of the line as a shell command.
With no arguments, run an inferior shell.
(gdb) shell ls
==

Best Regards
Swami



More information about the Gdb mailing list