Debugging with GDB Manual HP WDB v6.3 (5900-2180, August 2012)

Alternatively, if signal is zero, continue execution without giving a signal.
This is useful when your program stopped on account of a signal and would
ordinary see the signal when resumed with the continue command;
'signal 0' causes it to resume without a signal.
signal does not repeat when you press RET a second time after executing
the command.
Invoking the signal command is not the same as invoking the kill utility from the shell. Sending
a signal with kill causes GDB to decide what to do with the signal depending on the signal
handling tables (see “Signals” (page 50)). The signal command passes the signal directly to
your program.
11.4 Returning from a function
You can use the following command to return from a function:
return, return
expression
You can cancel execution of a function call with the return command.
If you give an expression argument, its value is used as the return
value from the function value.
When you use return, GDB discards the selected stack frame (and all frames within it). You can
think of this as making the discarded frame return prematurely. If you wish to specify a value to
be returned, give that value as the argument to return.
This pops the selected stack frame (see “Selecting a frame” (page 56)), and any other frames
inside of it, leaving its caller as the innermost remaining frame. That frame becomes selected. The
specified value is stored in the registers used for returning values of functions.
The return command does not resume execution; it leaves the program stopped in the state that
would exist if the function had just returned. In contrast, the finish command (see “Continuing
and stepping” (page 48)) resumes execution until the selected stack frame returns naturally.
11.5 Calling program functions
call expr Evaluate the expression expr without displaying void returned values.
You can use this variant of the print command if you want to execute a function from your
program, but without cluttering the output with void returned values. If the result is not void, it is
printed and saved in the value history.
For the A29K, a user-controlled variable call_scratch_address specifies the location of a
scratch area to be used when GDB calls a function in the target. This is necessary because the
usual method of putting the scratch area on the stack does not work in systems that have separate
instruction and data spaces.
11.6 Patching programs
By default, GDB opens the file containing the executable code of your program (or the corefile)
as read-only. This prevents accidental alteration to machine code; and it also prevents you from
intentionally patching your program binary.
If you would like to be able to patch the binary, you can specify that explicitly with the set write
command. For example, you might want to turn on internal debugging flags, or even to make
emergency repairs.
set write on,
set write off
If you specify 'set write on', GDB opens executable and core files for
both reading and writing; if you specify 'set write off' (the default),
GDB opens them as read-only.
If you have already loaded a file, you must load it again (using the
exec-file or core-file command) after changing set write, for
your new setting to take effect.
11.4 Returning from a function 93