GDBVariable.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 13 Feb 2018 22:13:28 +0000
changeset 108 f34505ec6a7f
parent 106 12c96f17fc53
child 109 f57ce907abf4
permissions -rw-r--r--
Variable objects: keep track of frame in which variable object has been created
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
"
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
"{ Package: 'jv:libgdbs' }"
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
"{ NameSpace: Smalltalk }"
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
106
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
    23
GDBDebuggerObject subclass:#GDBVariable
74
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    24
	instanceVariableNames:'frame name value varobj'
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
	classVariableNames:''
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
	poolDictionaries:''
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
	category:'GDB-Core'
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
!
437ee6413c74 Initial support for variables
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
!GDBVariable 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
! !
76
29efc28d989a Fixed `GDBVariable>>varobj` to actually keep the varobj
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 74
diff changeset
    52
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
!GDBVariable class methodsFor:'accessing - GDB value descriptors'!
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
description
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
    ^ (super description)
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
        define:#name as:String;
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
        yourself
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
    "Created: / 16-09-2014 / 23:59:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
    "Modified: / 27-02-2015 / 15:00:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
! !
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
!GDBVariable methodsFor:'accessing'!
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
name
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
    ^ name
56
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
    68
!
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
    69
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
    70
value
74
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    71
    ^ self varobj value
56
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
    72
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
    73
    "Created: / 27-02-2015 / 23:37:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
74
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    74
    "Modified: / 18-03-2015 / 16:47:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    75
! !
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    76
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    77
!GDBVariable methodsFor:'accessing-private'!
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    78
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    79
varobj
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    80
    varobj isNil ifTrue:[ 
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    81
        | result currentThreadId currentFrameId |
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    82
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    83
        result := debugger send: (GDBMI_thread_list_ids new).
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    84
        currentThreadId := result propertyAt: 'current-thread-id'.
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    85
        result := debugger send: (GDBMI_stack_info_frame new).
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    86
        currentFrameId := (result propertyAt: 'frame') level.
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    87
        
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    88
        frame thread id ~= currentThreadId ifTrue:[ 
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    89
            debugger send: (GDBMI_thread_select new arguments:(Array with:frame thread id)).       
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    90
            debugger send: (GDBMI_stack_select_frame new arguments:(Array with:frame level)).       
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    91
        ] ifFalse:[ 
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    92
            frame level ~= currentFrameId ifTrue:[ 
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    93
                debugger send: (GDBMI_stack_select_frame new arguments:(Array with:frame level)).       
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    94
            ].
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    95
        ].
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    96
90
6046abc9ddf4 Replaced Squek computed arrays by more verbose `Array with:...`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 83
diff changeset
    97
        result := debugger send: (GDBMI_var_create new arguments: (Array with: '-' with: '*' with: name)).
74
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    98
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
    99
        frame thread id ~= currentThreadId ifTrue:[ 
95
f417138e9c48 Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   100
            debugger send: (GDBMI_thread_select new arguments: (Array with: currentThreadId)).       
f417138e9c48 Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   101
            debugger send: (GDBMI_stack_select_frame new arguments:(Array with: currentFrameId)).       
74
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
   102
        ] ifFalse:[ 
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
   103
            frame level ~= currentFrameId ifTrue:[ 
95
f417138e9c48 Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   104
                debugger send: (GDBMI_stack_select_frame new arguments:(Array with: currentFrameId)).       
74
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
   105
            ].
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
   106
        ].
76
29efc28d989a Fixed `GDBVariable>>varobj` to actually keep the varobj
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 74
diff changeset
   107
29efc28d989a Fixed `GDBVariable>>varobj` to actually keep the varobj
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 74
diff changeset
   108
        varobj := result value.
108
f34505ec6a7f Variable objects: keep track of frame in which variable object has been created
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   109
        varobj 
f34505ec6a7f Variable objects: keep track of frame in which variable object has been created
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   110
            setDebugger: debugger; 
f34505ec6a7f Variable objects: keep track of frame in which variable object has been created
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   111
            setExpression: name;
f34505ec6a7f Variable objects: keep track of frame in which variable object has been created
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   112
            setFrame: frame.
102
d573a3b2abe2 Variable objects: delete var. objects that are no longer needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 101
diff changeset
   113
        varobj registerForFinalization.
74
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
   114
    ].
83
b2fb8968f1f4 Improved some #printOn: and #inspectorExtraAttributes to ease debugging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   115
    ^ varobj
74
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
   116
d53d325c2930 Initial work on varobjs. Tests locks up an image, should be polished and folded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 56
diff changeset
   117
    "Created: / 27-02-2015 / 17:18:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
95
f417138e9c48 Win32: initial support for Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 91
diff changeset
   118
    "Modified: / 15-01-2018 / 23:10:31 / jv"
108
f34505ec6a7f Variable objects: keep track of frame in which variable object has been created
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   119
    "Modified: / 15-02-2018 / 09:30:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
56
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
   120
! !
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
   121
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
   122
!GDBVariable methodsFor:'initialization'!
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
   123
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
   124
setFrame: aGDBFrame
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
   125
    self assert: frame isNil.
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
   126
    self assert: (debugger isNil or:[ debugger == aGDBFrame debugger ]).
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
   127
    frame := aGDBFrame.
106
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   128
    self setDebugger: frame debugger.
56
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
   129
20989de12cfb More work on variables + tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 55
diff changeset
   130
    "Created: / 27-02-2015 / 17:08:02 / 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
   131
    "Modified: / 04-02-2018 / 21:41:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
104
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   132
!
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   133
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   134
setValue: aString
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   135
    value := aString
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   136
4add55336dfe Variable objects: automagically update values whenever changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   137
    "Created: / 01-02-2018 / 21:34:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   138
! !
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   139
83
b2fb8968f1f4 Improved some #printOn: and #inspectorExtraAttributes to ease debugging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   140
!GDBVariable methodsFor:'inspecting'!
b2fb8968f1f4 Improved some #printOn: and #inspectorExtraAttributes to ease debugging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   141
b2fb8968f1f4 Improved some #printOn: and #inspectorExtraAttributes to ease debugging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   142
inspectorExtraAttributes
b2fb8968f1f4 Improved some #printOn: and #inspectorExtraAttributes to ease debugging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   143
    ^ super inspectorExtraAttributes
b2fb8968f1f4 Improved some #printOn: and #inspectorExtraAttributes to ease debugging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   144
        add:('-varobj' -> [ self varobj ]);
b2fb8968f1f4 Improved some #printOn: and #inspectorExtraAttributes to ease debugging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   145
        yourself
b2fb8968f1f4 Improved some #printOn: and #inspectorExtraAttributes to ease debugging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   146
b2fb8968f1f4 Improved some #printOn: and #inspectorExtraAttributes to ease debugging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   147
    "Created: / 13-06-2017 / 14:51:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b2fb8968f1f4 Improved some #printOn: and #inspectorExtraAttributes to ease debugging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   148
! !
b2fb8968f1f4 Improved some #printOn: and #inspectorExtraAttributes to ease debugging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   149
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   150
!GDBVariable methodsFor:'printing & storing'!
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   151
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   152
printOn:aStream
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   153
    "append a printed representation if the receiver to the argument, aStream"
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   154
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   155
    super printOn:aStream.
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   156
    aStream nextPutAll:'('.
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   157
    name printOn: aStream.
83
b2fb8968f1f4 Improved some #printOn: and #inspectorExtraAttributes to ease debugging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   158
    aStream nextPutAll:': '.
b2fb8968f1f4 Improved some #printOn: and #inspectorExtraAttributes to ease debugging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   159
    aStream nextPutAll: self valueString.
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   160
    aStream nextPutAll:')'.
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   161
83
b2fb8968f1f4 Improved some #printOn: and #inspectorExtraAttributes to ease debugging
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   162
    "Modified: / 13-06-2017 / 17:01:41 / 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: 76
diff changeset
   163
!
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   164
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   165
valueString
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   166
    "Return value as string to be presented to user. The difference
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   167
     to sending `value displayString` is that #valueString returns a
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   168
     pretty-printed value (if pretty printing was enabled for GDB)
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   169
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   170
     @see GDBMI_enable_pretty_printing
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   171
     @see GDBDebugger >> enablePrettyPrinting
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   172
    "
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   173
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   174
    ^ value notNil ifTrue:[ value ] ifFalse:[ self value displayString ]
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   175
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   176
    "Created: / 11-06-2017 / 23:24:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7ee72b7a498f Added #enablePrettyPrinting and #enableFrameFilters to allow Python scripts to augment presentation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   177
    "Modified (comment): / 12-06-2017 / 09:26:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
55
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   178
! !
437ee6413c74 Initial support for variables
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   179
106
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   180
!GDBVariable methodsFor:'testing'!
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   181
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   182
isValid
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   183
    ^ frame isValid
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   184
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   185
    "Created: / 04-02-2018 / 21:32:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   186
! !
12c96f17fc53 Variable objects: invalidate variable object when thread on inferior terminates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 104
diff changeset
   187
76
29efc28d989a Fixed `GDBVariable>>varobj` to actually keep the varobj
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 74
diff changeset
   188
!GDBVariable class methodsFor:'documentation'!
29efc28d989a Fixed `GDBVariable>>varobj` to actually keep the varobj
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 74
diff changeset
   189
29efc28d989a Fixed `GDBVariable>>varobj` to actually keep the varobj
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 74
diff changeset
   190
version_HG
29efc28d989a Fixed `GDBVariable>>varobj` to actually keep the varobj
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 74
diff changeset
   191
29efc28d989a Fixed `GDBVariable>>varobj` to actually keep the varobj
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 74
diff changeset
   192
    ^ '$Changeset: <not expanded> $'
29efc28d989a Fixed `GDBVariable>>varobj` to actually keep the varobj
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 74
diff changeset
   193
! !
29efc28d989a Fixed `GDBVariable>>varobj` to actually keep the varobj
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 74
diff changeset
   194