GDBMI_exec_run.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 26 May 2017 08:05:28 +0100
changeset 78 c24e7d8bc881
parent 61 b68d121e3895
child 85 6fea1000a2a5
permissions -rw-r--r--
BUpdated build files.

"{ Package: 'jv:libgdbs' }"

"{ NameSpace: Smalltalk }"

GDBMICommand subclass:#GDBMI_exec_run
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'GDB-Core-Commands-MI'
!

!GDBMI_exec_run class methodsFor:'documentation'!

documentation
"
The `-exec-run' Command
-----------------------

Synopsis
........

      -exec-run [ --all | --thread-group N ] [ --start ]

   Starts execution of the inferior from the beginning.  The inferior
executes until either a breakpoint is encountered or the program exits.
In the latter case the output will include an exit code, if the program
has exited exceptionally.

   When neither the `--all' nor the `--thread-group' option is
specified, the current inferior is started.  If the `--thread-group'
option is specified, it should refer to a thread group of type
`process', and that thread group will be started.  If the `--all'
option is specified, then all inferiors will be started.

   Using the `--start' option instructs the debugger to stop the
execution at the start of the inferior's main subprogram, following the
same behavior as the `start' command (*note Starting::).

{No value for `GDBN'} Command
.............................

The corresponding {No value for `GDBN'} command is `run'.

Examples
........

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

Program exited normally:

     (gdb)
     -exec-run
     ^running
     (gdb)
     x = 55
     *stopped,reason='exited-normally'
     (gdb)

Program exited exceptionally:

     (gdb)
     -exec-run
     ^running
     (gdb)
     x = 55
     *stopped,reason='exited',exit-code='01'
     (gdb)

   Another way the program can terminate is if it receives a signal
such as `SIGINT'.  In this case, GDB/MI displays this:

     (gdb)
     *stopped,reason='exited-signalled',signal-name='SIGINT',
     signal-meaning='Interrupt'


"
! !

!GDBMI_exec_run methodsFor:'accessing'!

operation
	^ 'exec-run'
! !

!GDBMI_exec_run methodsFor:'converting'!

asString

    "/ Following code is an workaround to a bug in GDB up to 7.9,
    "/ which does not correctly handle this command in async mode.
    "/ According to GDB source code, the MI command actually issues
    "/ CLI command run in background mode (if mi-async is on).
    "/ See https://sourceware.org/bugzilla/show_bug.cgi?id=18077
    "/ 
    "/ As a (temporary) workaround, substitute for CLI command here.
    ^ 'r &'

    "Created: / 04-03-2015 / 20:49:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!GDBMI_exec_run class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
! !