GDBFrame.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 04 Feb 2018 23:37:35 +0000
changeset 106 12c96f17fc53
parent 104 4add55336dfe
child 111 7ce18f6f18ac
permissions -rw-r--r--
Variable objects: invalidate variable object when thread on inferior terminates ...and delete the variable and all its children (by means of `-var-delete`).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
91
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
     1
"
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
     2
jv:libgdbs - GNU Debugger Interface Library
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
     3
Copyright (C) 2015-now Jan Vrany
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
     4
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
     5
This library is free software; you can redistribute it and/or
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
     6
modify it under the terms of the GNU Lesser General Public
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
     7
License as published by the Free Software Foundation; either
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
     8
version 2.1 of the License. 
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
     9
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    10
This library is distributed in the hope that it will be useful,
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    11
but WITHOUT ANY WARRANTY; without even the implied warranty of
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    13
Lesser General Public License for more details.
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    14
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    15
You should have received a copy of the GNU Lesser General Public
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    16
License along with this library; if not, write to the Free Software
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    17
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    18
"
40
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
"{ Package: 'jv:libgdbs' }"
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
    21
"{ NameSpace: Smalltalk }"
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
    22
103
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
    23
GDBDebuggerObject subclass:#GDBFrame
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
    24
	instanceVariableNames:'thread level addr func file fullname line from variables'
40
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
	classVariableNames:''
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
	poolDictionaries:''
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
	category:'GDB-Core'
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
!
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
91
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    30
!GDBFrame class methodsFor:'documentation'!
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    31
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    32
copyright
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    33
"
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    34
jv:libgdbs - GNU Debugger Interface Library
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    35
Copyright (C) 2015-now Jan Vrany
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    36
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    37
This library is free software; you can redistribute it and/or
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    38
modify it under the terms of the GNU Lesser General Public
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    39
License as published by the Free Software Foundation; either
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    40
version 2.1 of the License. 
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    41
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    42
This library is distributed in the hope that it will be useful,
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    43
but WITHOUT ANY WARRANTY; without even the implied warranty of
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    44
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    45
Lesser General Public License for more details.
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    46
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    47
You should have received a copy of the GNU Lesser General Public
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    48
License along with this library; if not, write to the Free Software
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    49
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    50
"
472a4841a8b6 License this package under 'GNU Lesser General Public License'
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 90
diff changeset
    51
! !
71
016b716773e3 GDBFrame: fix for framew with empty variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    52
40
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
!GDBFrame class methodsFor:'accessing - GDB value descriptors'!
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
45
deb908479a37 Code refactored to use Magritte to meta-describe GDB objects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
    55
description
deb908479a37 Code refactored to use Magritte to meta-describe GDB objects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
    56
    ^ (super description)
deb908479a37 Code refactored to use Magritte to meta-describe GDB objects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
    57
        define:#level as:Integer;
deb908479a37 Code refactored to use Magritte to meta-describe GDB objects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
    58
        define:#func as:String;
deb908479a37 Code refactored to use Magritte to meta-describe GDB objects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
    59
        define:#file as:String;
deb908479a37 Code refactored to use Magritte to meta-describe GDB objects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
    60
        define:#fullname as:String;
deb908479a37 Code refactored to use Magritte to meta-describe GDB objects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
    61
        define:#line as:Integer;
deb908479a37 Code refactored to use Magritte to meta-describe GDB objects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
    62
        define:#from as:String;
deb908479a37 Code refactored to use Magritte to meta-describe GDB objects.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 43
diff changeset
    63
        define:#addr as:Integer;
40
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
        yourself
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
    "Created: / 16-09-2014 / 23:59:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
103
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
    67
    "Modified: / 15-02-2018 / 08:27:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
40
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
! !
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
!GDBFrame methodsFor:'accessing'!
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
addr
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
    ^ addr
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
!
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
file
82
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    77
    "Return filename containing frame's function source."
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    78
    ^ fullname notNil ifTrue:[ fullname ] ifFalse:[ file ]
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    79
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    80
    "Modified: / 11-06-2017 / 20:59:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
40
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
!
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
from
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
    ^ from
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
!
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    87
fullname
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
    ^ fullname
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
!
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
func
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
    ^ func
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
!
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
level
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
    ^ level
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
!
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
line
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
    ^ line
43
22236b6d1d9a Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 41
diff changeset
   101
!
22236b6d1d9a Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 41
diff changeset
   102
22236b6d1d9a Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 41
diff changeset
   103
thread
22236b6d1d9a Remove threads from thread group when threadgroup terminates.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 41
diff changeset
   104
    ^ thread
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   105
!
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   106
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   107
variables
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   108
    self ensureIsValid.
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   109
    variables isNil ifTrue:[
104
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   110
        variables := GDBTransientDataHolder debugger: debugger factory:[ :old |
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   111
            | result new |
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   112
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   113
            result := debugger send: (GDBMI_stack_list_variables new arguments: (Array with: '--thread' with: thread id with: '--frame' with: level with: '--no-values')).
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   114
            new := (result propertyAt: #variables) ? #().
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   115
            old notNil ifTrue:[ 
106
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   116
                old size == new size ifTrue:[
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   117
                    1 to: new size do:[:i | 
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   118
                        | oldVar newVar |
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   119
106
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   120
                        oldVar := old at: i.
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   121
                        newVar := new at: i.
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   122
                        newVar name = oldVar name ifTrue:[ 
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   123
                            new at: i put: (old at: i)
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   124
                        ].
104
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   125
                    ].
106
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   126
                ] ifFalse:[ 
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   127
                    "/ Sorry for this - but I'm not sure when this may happen
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   128
                    "/ so I would like get a debugger to investigate
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   129
                    self breakPoint: #jv.  
104
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   130
                ].
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   131
            ] ifFalse:[ 
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   132
                new do:[:newVar | newVar setFrame: self ]
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   133
            ].
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   134
            new
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   135
        ].
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   136
    ].
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   137
    ^ variables value
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   138
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   139
    "Created: / 27-02-2015 / 14:56:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
106
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   140
    "Modified (format): / 04-02-2018 / 21:21:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
40
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   141
! !
0ce76b671515 Some more support for stack frames.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   142
103
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   143
!GDBFrame methodsFor:'initialization'!
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   144
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   145
setAddr: aString
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   146
    addr := aString
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   147
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   148
    "Created: / 31-01-2018 / 09:50:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   149
!
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   150
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   151
setLevel: anInteger
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   152
    level := anInteger
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   153
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   154
    "Created: / 15-02-2018 / 08:34:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
104
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   155
    "Created: / 02-02-2018 / 12:16:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
103
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   156
!
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   157
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   158
setLine: anInteger
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   159
    line := anInteger
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   160
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   161
    "Created: / 01-02-2018 / 10:09:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   162
!
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   163
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   164
setThread: aGDBThread
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   165
    thread := aGDBThread
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   166
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   167
    "Created: / 30-01-2018 / 15:56:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   168
! !
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   169
41
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   170
!GDBFrame methodsFor:'printing & storing'!
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   171
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   172
displayString
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   173
    ^ String streamContents: [ :aStream |
82
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   174
        | f |
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   175
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   176
        f := self file.
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   177
        level printOn:aStream base: 10 size: 2 fill: Character space.
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   178
        aStream nextPutAll:' '.
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   179
        addr printOn:aStream.
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   180
        aStream nextPutAll:' '.
82
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   181
        func notNil ifTrue:[
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   182
            func printOn:aStream.
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   183
        ] ifFalse:[ 
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   184
            aStream nextPutAll: '?'
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   185
        ].
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   186
        f notNil ifTrue:[
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   187
            aStream nextPutAll:' ('.
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   188
            aStream nextPutAll: f startingAt: (f lastIndexOf: Filename separator) + 1.
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   189
            line notNil ifTrue:[
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   190
                aStream nextPutAll:':'.
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   191
                line printOn:aStream.
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   192
            ].
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   193
            aStream nextPutAll:')'.
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   194
        ].
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   195
    ].
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   196
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   197
    "Created: / 27-02-2015 / 15:20:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
82
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   198
    "Modified: / 12-06-2017 / 09:04:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   199
!
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   200
41
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   201
printOn:aStream
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   202
    "append a printed representation if the receiver to the argument, aStream"
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   203
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   204
    super printOn: aStream.
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   205
    aStream nextPutAll:'('.
41
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   206
    level printOn:aStream base: 10 size: 2 fill: Character space.
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   207
    aStream nextPutAll:' '.
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   208
    addr printOn:aStream.
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   209
    aStream nextPutAll:' '.
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   210
    func printOn:aStream.
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   211
    aStream nextPutAll:' - '.
41
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   212
    file printOn:aStream.
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   213
    aStream nextPutAll:':'.
41
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   214
    line printOn:aStream.
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   215
    aStream nextPutAll:')'.
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   216
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 51
diff changeset
   217
    "Modified: / 27-02-2015 / 15:21:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
41
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   218
! !
fb48207b6104 Fixes in thread's stack mangement. Dispatch events to applications using their UI event loop.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 40
diff changeset
   219
103
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   220
!GDBFrame methodsFor:'testing'!
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   221
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   222
isValid
106
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   223
    ^ thread isValid and:[addr notNil]
103
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   224
106
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   225
    "Modified: / 04-02-2018 / 21:30:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
103
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   226
! !
56bf65352505 Variable objects: preserve the identity of `GDBFrame` and `GDBVariable` objects
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   227
71
016b716773e3 GDBFrame: fix for framew with empty variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
   228
!GDBFrame class methodsFor:'documentation'!
016b716773e3 GDBFrame: fix for framew with empty variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
   229
016b716773e3 GDBFrame: fix for framew with empty variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
   230
version_HG
016b716773e3 GDBFrame: fix for framew with empty variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
   231
016b716773e3 GDBFrame: fix for framew with empty variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
   232
    ^ '$Changeset: <not expanded> $'
016b716773e3 GDBFrame: fix for framew with empty variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
   233
! !
016b716773e3 GDBFrame: fix for framew with empty variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
   234