Executing Shell Commands

You can have the debugger execute a call to the operating system's system function. This function is documented in system(3). The call results from the sh (dbx) or shell (gdb) commands.

DBX Mode

 

execute_shell_command

        : sh string

 

For example, you can execute a system command through a shell from the debugger by issuing the following command:

 

(idb) sh uname -s

Linux

(idb)

 

To execute more than one command at the specified shell, spawn a shell as follows, for example:

 

(idb) sh csh -f

% ls out

out

% ls *.b

recio.b

stdio.b

% exit

(idb)

GDB Mode

 

execute_shell_command

        : shell string

 

For example:

 

(idb) shell uname -s

Linux

(idb)

 

To execute more than one command at the shell, spawn a shell as follows:

 

(idb) shell bash --norc

$ ls out

out

$ ls *.b

recio.b

stdio.b

$ exit

(idb)