Outils pour utilisateurs

Outils du site


francois:vxworks_gdb_commands

VxWorks GDB commands

Generic commands

Command Description
cd directoryChange the working directory.
completeList the completions for the rest of the line as a command.
directory dir Append a directory to the DIRECTORY variable (for source file searches.)
echo string Print a string.
help command Print a description of command .
interpreter-exec mi command Send a GDB/MI command to the debug framework. command is the name of the command to execute.
list [line or symbol or filename ] Display ten lines of a source file, centered around a line number or symbol.
object flush Force the debugger to flush cached information about all TOS objects in a core.
output expression Like print, but don't put in value history and don't print a new line.
path pathname Append pathname to the PATH variable.
pwd Print the working directory.
printf “format_string ”, [arg0 ], …, [argN ] Write formatted operands to stdout. This is useful for formatted output in user-defined commands. The following basic format specifiers are supported: %s,%c,%d,%u,%x,%b,%o,%f. For format types %c, %b, %o, and %f, characters for flag (+, -, and so on), width (%4d), precision (%4.4f), and length (%lld, and so on) are not supported; the host shell ignores them. Format types %s, %d, %x, and %u support complex characters (such as %.2d or %#08x.)
q or quit Quit the host shell.
server If you prefix any command with server, it will not affect the command history. It will also not affect the host shell's rule for which command to repeat if you press ENTER on a line by itself. This means that commands can be run behind a user's back by a front-end in a transparent manner. The server prefix does not affect the recording of values into the value history. To print a value without recording it into the value history, use the output command instead of the print command. Using this prefix also disables confirmation requests.
shell command Execute the rest of the line as a shell command.
show path Show the PATH variable.
source [/v ort /i] filename Read commands from filename . The /v option specifies verbose mode: both the command and the output are printed. The /i option specifies that the host shell will ignore the first error (that is, it will not halt script execution on the first error.)
spawn tasknameSpawn a task on the target with default parameters. This command is only available when debugging a VxWorks kernel.

Points d'arrêt

break

To set a breakpoint, use the break command. Multiple breakpoints at one place are permitted, and useful if conditional.

Syntax

break [location ] [thread thread_ID ] [if condition ] [ignore count ] [ignore-reset count ] [count-or-condition] [condition-then-count] [count-then-condition] [timeslice timeslice_ID ] [before-prolog]

Arguments

location

may be a line number, a function name, or “*” and an address.

If you specify a line number, the host shell breaks at the start of code for that line. If you specify a function, the host shell breaks at the start of code for that function. If you specify an address, the host shell breaks at that exact address.

If you do not specify a location , the host shell uses the current execution address of the selected stack frame. (This is useful for breaking on a return to a stack frame.)

thread thread_ID

For a thread-specific breakpoint: stop the program when a particular thread reaches this breakpoint. thread_ID is one of the numeric thread identifiers assigned by gdb, shown in the first column of the info threads display.

if condition

Ignore stop until condition is met. You can use brackets to surround expressions that contain spaces. (For special behavior if the ignore option is also set, see below.) See also the condition command (Table 5-2.)

ignore count

Ignore first count stops at this breakpoint, and do not reset after breaking. The trigger value is count +1. (For special behavior if the if option is also set, see below.) See also the ignore command (Table 5-2.)

ignore-reset count

Ignore first count stops at this breakpoint, and reset after breaking. The trigger value is count +1. For special behavior if the if option is also set, see below.)

count-or-condition

If both the ignore option and the if option are set, then when the break address is hit, increment count . If count reaches the trigger value, or if condition is true, then stop; otherwise continue. If either the ignore option or the if option is not set, this argument does nothing.

condition-then-count

If both the ignore option and the if option are set, then when the break address is hit, evaluate condition. If condition is true, then increment count . If count reaches the trigger value then stop; otherwise continue. (This is the GDB/MI default.) If either the ignore option or the if option is not set, this argument does nothing.

count-then-condition

If both the ignore option and the if option are set, then when the break address is hit, increment count . If count reaches the trigger value, then evaluate condition . If condition is true then stop, otherwise continue. If either the ignore option or the if option is not set, this argument does nothing.

timeslice timeslice_ID

Sets a time-qualified breakpoint. Stop the program when the breakpoint is hit in the specified time slice. (Only supported for MILS targets. Time-qualified breakpoints are not supported for On-Chip Debugging connections.)

before-prolog

If an address matches the start of a function, set the breakpoint so that the host shell stops at that address (that is, at the start of the prolog.) By default, if the address matches the start of a function, the breakpoint would be set so that prolog is stepped over.

Note that information about local variables and backtrace could be incorrect if the prolog is not executed.

Autres commands liées aux points d'arrêt

tbreak or t Set a temporary breakpoint.Arguments are the same as break.
hbreak Set a hardware breakpoint.Arguments are the same as break.Not all targets support hardware breakpoints.
clear [ //line // | //function // | //file:line // ] Clear a breakpoint.
condition //bp_id condition // Change a breakpoint condition (re-initializes the breakpoint).
delete //bp_id // Delete a breakpoint.
disable //bp_id // Disable a breakpoint.
enable //bp_id // Enable a breakpoint.
enable delete [all | global-scope] //bp_id1 bp_id2 // … Enable breakpoints and delete them after they are hit.Arguments are breakpoint numbers with spaces in between.Use the all option to enable all breakpoints in all contexts.Use the global-scope option to apply the command to a context other than the currently selected context.
enable keep [all | global-scope] //bp_id1 bp_id2 // … Enable breakpoints and keep them enabled until commanded otherwise.Arguments are breakpoint numbers with spaces in between.Use the all option to enable all breakpoints in all contexts.Use the global-scope option to apply the command to a context other than the currently selected context.
enable once [all | global-scope] //bp_id1 bp_id2 // … Enable breakpoints until hit. After a breakpoint is hit, it becomes disabled.Arguments are breakpoint numbers with spaces in between.Use the all option to enable all breakpoints in all contexts.Use the global-scope option to apply the command to a context other than the currently selected context.
ignore //bp_id count // Ignore a breakpoint //count // times (re-initializes the breakpoint).
set breakpoint pending [on | off | auto] Set debugger behavior regarding pending breakpoints.on – an unrecognized breakpoint location causes gdb to create a pending breakpoint.off – an unrecognized breakpoint location results in an error.auto – an unrecognized breakpoint location results in a user query to ask if a pending breakpoint should be created.
set breakpoint scope [global | system] Set debugger behavior regarding scope of breakpoints.global – set an unrestricted breakpoint to affect all contexts.system – set a restricted breakpoint to the system of the selected debug target.The default is system.This command is supported only for VxWorks MILS targets.
show breakpoint pending Show the current setting for pending breakpoints.
show breakpoint scope Show the current setting for breakpoint scope.This command is supported only for VxWorks MILS targets.
unset //bp_id1 // //bp_id2 // … Delete breakpoints or auto-display expressions. Arguments are breakpoint numbers with spaces in between.Entering unset with no arguments deletes all breakpoints.This is also a prefix command for deletion of gdb objects.

Fichier à déboguer

CommandeSyntaxeDescription
file file filename Define filename as the program to be debugged.
exec-file exec-file filename Use filename as a program for retrieving contents of pure memory.
load load filename Load a module. (Not supported for VxWorks Cert.)
unload unload filename Unload a module. (Not supported for VxWorks Cert.)
attach attach process_id Attach to a process.
detach detach Detach from the attached process.
thread thread thread_id Select a thread as the current task to debug.
symbol-file symbol-file filename Load symbol table from the executable file filename .
add-symbol-file add-symbol-file filename [start_addr ] Load symbol information from the object file filename . (Optionally, specify the start address.)

Exécuter ou faire du pas à pas

Command Syntax Description
run run Run a process for debugging (use set arguments and set environment if your program needs them).
kill kill process_id Kill a specified process. If no process is specified, kill the current debugging process. (Not supported for VxWorks Cert.)
interrupt interrupt Interrupt a running task or process.
continue continue Continue an interrupted task or process.
system continue system continue Resume the system. This differs from the continue command, since it does not synchronize on stopped or context-exit events.
step step [n ] Step current task until it reaches a different source line. If n is used, step n times.
stepi stepi [n ] Step one instruction. If n is used, step n times.
next next [n ]
nexti nexti [n ] Step one instruction. If the instruction is a function call, proceed until the function returns. If n is used, execute n instructions.
until until Continue running until a source line past the current line in the current stack frame is reached.
finish finish Finish execution of current block. The finish command always acts on frame 0 (the frame where the instruction pointer is) even if you have selected another frame (for example, by using the frame or up commands).
francois/vxworks_gdb_commands.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki