GDBMI_exec_finish.st
author Jan Vrany <jan.vrany@labware.com>
Wed, 10 Mar 2021 13:51:01 +0000
changeset 223 5ba4abfcb7e7
parent 91 472a4841a8b6
child 259 651864c2aa29
permissions -rw-r--r--
Track user context (selected thread and frame) in `GDBDebugger` `GDBDebugger` now responds to `#selectedInferior`, `#selectedThread` and `#selectedFrame` which answers the current user contexts, i.e, the thread and frame CLI command would operate on. Clients may get notified about user context changes by two ways: (i) listen to `GDBThreadSelectedEvent` (ii) listen to change notification emited by `GDBDebugger` object. The latter can be used in (Smalltalk/X) UI by hooking `AspectAdaptor`s on `GDBDebugger`. The only caveat is that the result value of `#selectedFrame` is not always identical to some instance in `selectedThread stack`.

"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany
Copyright (C) 2021 LabWare

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License. 

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
"
"{ Package: 'jv:libgdbs' }"

"{ NameSpace: Smalltalk }"

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

!GDBMI_exec_finish class methodsFor:'documentation'!

copyright
"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany
Copyright (C) 2021 LabWare

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License. 

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
"
!

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

Synopsis
........

      -exec-finish [--reverse]

   Resumes the execution of the inferior program until the current
function is exited.  Displays the results returned by the function.  If
the `--reverse' option is specified, resumes the reverse execution of
the inferior program until the point where current function was called.

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

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

Example
.......

Function returning `void'.

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

   Function returning other than `void'.  The name of the internal {No
value for `GDBN'} 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',fullname='/home/foo/bar/recursive2.c',line='14'},
     gdb-result-var='$1',return-value='0'
     (gdb)


"
! !

!GDBMI_exec_finish methodsFor:'accessing'!

operation
	^ 'exec-finish'
! !

!GDBMI_exec_finish class methodsFor:'documentation'!

version_HG

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