Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

26.11. Command Descriptions

The following sections describe various commands.

26.11.1. The -exec-abortCommand

26.11.1.1. Synopsis

 -exec-abort

Kill the inferior running program.

26.11.1.2. gdb Command

The corresponding gdb command is kill.

26.11.1.3. Example

N.A.

26.11.2. The -exec-argumentsCommand

26.11.2.1. Synopsis

 -exec-arguments args

Set the inferior program arguments, to be used in the next -exec-run.

26.11.2.2. gdb Command

The corresponding gdb command is set args.

26.11.2.3. Example

Don't have one around.

26.11.3. The -exec-continueCommand

26.11.3.1. Synopsis

 -exec-continue

Asynchronous command. Resumes the execution of the inferior program until a breakpoint is encountered, or until the inferior exits.

26.11.3.2. gdb Command

The corresponding gdb corresponding is continue.

26.11.3.3. Example

-exec-continue
^running
(gdb)
@Hello world
*stopped,reason="breakpoint-hit",bkptno="2",frame={func="foo",args=[],
file="hello.c",line="13"}
(gdb)

26.11.4. The -exec-finishCommand

26.11.4.1. Synopsis

 -exec-finish

Asynchronous command. Resumes the execution of the inferior program until the current function is exited. Displays the results returned by the function.

26.11.4.2. gdb Command

The corresponding gdb command is finish.

26.11.4.3. Example

Function returning void.

-exec-finish
^running
(gdb)
@hello from foo
*stopped,reason="function-finished",frame={func="main",args=[],
file="hello.c",line="7"}
(gdb)

Function returning other than void. The name of the internal gdb variable storing the result is printed, together with the value itself.

-exec-finish
^running
(gdb)
*stopped,reason="function-finished",frame={addr="0x000107b0",func="foo",
args=[{name="a",value="1"],{name="b",value="9"}},
file="recursive2.c",line="14"},
gdb-result-var="$1",return-value="0"
(gdb)

26.11.5. The -exec-interruptCommand

26.11.5.1. Synopsis

 -exec-interrupt

Asynchronous command. Interrupts the background execution of the target. Note how the token associated with the stop message is the one for the execution command that has been interrupted. The token for the interrupt itself only appears in the ^done output. If the user is trying to interrupt a non-running program, an error message will be printed.

26.11.5.2. gdb Command

The corresponding gdb command is interrupt.

26.11.5.3. Example

(gdb)
111-exec-continue
111^running

(gdb)
222-exec-interrupt
222^done
(gdb)
111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
frame={addr="0x00010140",func="foo",args=[],file="try.c",line="13"}
(gdb)

(gdb)
-exec-interrupt
^error,msg="mi_cmd_exec_interrupt: Inferior not executing."
(gdb)

26.11.6. The -exec-nextCommand

26.11.6.1. Synopsis

 -exec-next

Asynchronous command. Resumes execution of the inferior program, stopping when the beginning of the next source line is reached.

26.11.6.2. gdb Command

The corresponding gdb command is next.

26.11.6.3. Example

-exec-next
^running
(gdb)
*stopped,reason="end-stepping-range",line="8",file="hello.c"
(gdb)

26.11.7. The -exec-next-instructionCommand

26.11.7.1. Synopsis

 -exec-next-instruction

Asynchronous command. Executes one machine instruction. If the instruction is a function call continues until the function returns. If the program stops at an instruction in the middle of a source line, the address will be printed as well.

26.11.7.2. gdb Command

The corresponding gdb command is nexti.

26.11.7.3. Example

(gdb)
-exec-next-instruction
^running

(gdb)
*stopped,reason="end-stepping-range",
addr="0x000100d4",line="5",file="hello.c"
(gdb)

26.11.8. The -exec-returnCommand

26.11.8.1. Synopsis

 -exec-return

Makes current function return immediately. Doesn't execute the inferior. Displays the new current frame.

26.11.8.2. gdb Command

The corresponding gdb command is return.

26.11.8.3. Example

(gdb)
200-break-insert callee4
200^done,bkpt={number="1",addr="0x00010734",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"}
(gdb)
000-exec-run
000^running
(gdb)
000*stopped,reason="breakpoint-hit",bkptno="1",
frame={func="callee4",args=[],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"}
(gdb)
205-break-delete
205^done
(gdb)
111-exec-return
111^done,frame={level="0",func="callee3",
args=[{name="strarg",
value="0x11940 \"A string argument.\""}],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"}
(gdb)

26.11.9. The -exec-runCommand

26.11.9.1. Synopsis

 -exec-run

Asynchronous command. Starts execution of the inferior from the beginning. The inferior executes until either a breakpoint is encountered or the program exits.

26.11.9.2. gdb Command

The corresponding gdb command is run.

26.11.9.3. Example

(gdb)
-break-insert main
^done,bkpt={number="1",addr="0x0001072c",file="recursive2.c",line="4"}
(gdb)
-exec-run
^running
(gdb)
*stopped,reason="breakpoint-hit",bkptno="1",
frame={func="main",args=[],file="recursive2.c",line="4"}
(gdb)

26.11.10. The -exec-show-argumentsCommand

26.11.10.1. Synopsis

 -exec-show-arguments

Print the arguments of the program.

26.11.10.2. gdb Command

The corresponding gdb command is show args.

26.11.10.3. Example

N.A.

26.11.11. The -exec-stepCommand

26.11.11.1. Synopsis

 -exec-step

Asynchronous command. Resumes execution of the inferior program, stopping when the beginning of the next source line is reached, if the next source line is not a function call. If it is, stop at the first instruction of the called function.

26.11.11.2. gdb Command

The corresponding gdb command is step.

26.11.11.3. Example

Stepping into a function:

-exec-step
^running
(gdb)
*stopped,reason="end-stepping-range",
frame={func="foo",args=[{name="a",value="10"},
{name="b",value="0"}],file="recursive2.c",line="11"}
(gdb)

Regular stepping:

-exec-step
^running
(gdb)
*stopped,reason="end-stepping-range",line="14",file="recursive2.c"
(gdb)

26.11.12. The -exec-step-instructionCommand

26.11.12.1. Synopsis

 -exec-step-instruction

Asynchronous command. Resumes the inferior which executes one machine instruction. The output, once gdb has stopped, will vary depending on whether we have stopped in the middle of a source line or not. In the former case, the address at which the program stopped will be printed as well.

26.11.12.2. gdb Command

The corresponding gdb command is stepi.

26.11.12.3. Example

(gdb)
-exec-step-instruction
^running

(gdb)
*stopped,reason="end-stepping-range",
frame={func="foo",args=[],file="try.c",line="10"}
(gdb)
-exec-step-instruction
^running

(gdb)
*stopped,reason="end-stepping-range",
frame={addr="0x000100f4",func="foo",args=[],file="try.c",line="10"}
(gdb)

26.11.13. The -exec-untilCommand

26.11.13.1. Synopsis

 -exec-until [ location ]

Asynchronous command. Executes the inferior until the location specified in the argument is reached. If there is no argument, the inferior executes until a source line greater than the current one is reached. The reason for stopping in this case will be location-reached.

26.11.13.2. gdb Command

The corresponding gdb command is until.

26.11.13.3. Example

(gdb)
-exec-until recursive2.c:6
^running
(gdb)
x = 55
*stopped,reason="location-reached",frame={func="main",args=[],
file="recursive2.c",line="6"}
(gdb)

26.11.14. The -file-exec-and-symbolsCommand

26.11.14.1. Synopsis

 -file-exec-and-symbols file

Specify the executable file to be debugged. This file is the one from which the symbol table is also read. If no file is specified, the command clears the executable and symbol information. If breakpoints are set when using this command with no arguments, gdb will produce error messages. Otherwise, no output is produced, except a completion notification.

26.11.14.2. gdb Command

The corresponding gdb command is file.

26.11.14.3. Example

(gdb)
-file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
(gdb)

26.11.15. The -file-exec-fileCommand

26.11.15.1. Synopsis

 -file-exec-file file

Specify the executable file to be debugged. Unlike -file-exec-and-symbols, the symbol table is not read from this file. If used without argument, gdb clears the information about the executable file. No output is produced, except a completion notification.

26.11.15.2. gdb Command

The corresponding gdb command is exec-file.

26.11.15.3. Example

(gdb)
-file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
(gdb)

26.11.16. The -file-list-exec-sectionsCommand

26.11.16.1. Synopsis

 -file-list-exec-sections

List the sections of the current executable file.

26.11.16.2. gdb Command

The gdb command info file shows, among the rest, the same information as this command. gdbtk has a corresponding command gdb_load_info.

26.11.16.3. Example

N.A.

26.11.17. The -file-list-exec-source-fileCommand

26.11.17.1. Synopsis

 -file-list-exec-source-file

List the line number, the current source file, and the absolute path to the current source file for the current executable.

26.11.17.2. gdb Command

There's no gdb command which directly corresponds to this one.

26.11.17.3. Example

(gdb)
123-file-list-exec-source-file
123^done,line="1",file="foo.c",fullname="/home/bar/foo.c"
(gdb)

26.11.18. The -file-list-exec-source-filesCommand

26.11.18.1. Synopsis

 -file-list-exec-source-files

List the source files for the current executable.

26.11.18.2. gdb Command

There's no gdb command which directly corresponds to this one. gdbtk has an analogous command gdb_listfiles.

26.11.18.3. Example

N.A.

26.11.19. The -file-list-shared-librariesCommand

26.11.19.1. Synopsis

 -file-list-shared-libraries

List the shared libraries in the program.

26.11.19.2. gdb Command

The corresponding gdb command is info shared.

26.11.19.3. Example

N.A.

26.11.20. The -file-list-symbol-filesCommand

26.11.20.1. Synopsis

 -file-list-symbol-files

List symbol files.

26.11.20.2. gdb Command

The corresponding gdb command is info file (part of it).

26.11.20.3. Example

N.A.

26.11.21. The -file-symbol-fileCommand

26.11.21.1. Synopsis

 -file-symbol-file file

Read symbol table info from the specified file argument. When used without arguments, clears gdb's symbol table info. No output is produced, except for a completion notification.

26.11.21.2. gdb Command

The corresponding gdb command is symbol-file.

26.11.21.3. Example

(gdb)
-file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
(gdb)

 
 
  Published under the terms of the GNU General Public License Design by Interspire