"{ Package: 'jv:libgdbs' }"
"{ NameSpace: Smalltalk }"
GDBTransientObject subclass:#GDBVariable
instanceVariableNames:'frame name value varobj'
classVariableNames:''
poolDictionaries:''
category:'GDB-Core'
!
!GDBVariable class methodsFor:'accessing - GDB value descriptors'!
description
^ (super description)
define:#name as:String;
yourself
"Created: / 16-09-2014 / 23:59:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 27-02-2015 / 15:00:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GDBVariable methodsFor:'accessing'!
name
^ name
!
value
^ self varobj value
"Created: / 27-02-2015 / 23:37:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 18-03-2015 / 16:47:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GDBVariable methodsFor:'accessing-private'!
varobj
varobj isNil ifTrue:[
| result currentThreadId currentFrameId |
result := debugger send: (GDBMI_thread_list_ids new).
currentThreadId := result propertyAt: 'current-thread-id'.
result := debugger send: (GDBMI_stack_info_frame new).
currentFrameId := (result propertyAt: 'frame') level.
frame thread id ~= currentThreadId ifTrue:[
debugger send: (GDBMI_thread_select new arguments:(Array with:frame thread id)).
debugger send: (GDBMI_stack_select_frame new arguments:(Array with:frame level)).
] ifFalse:[
frame level ~= currentFrameId ifTrue:[
debugger send: (GDBMI_stack_select_frame new arguments:(Array with:frame level)).
].
].
result := debugger send: (GDBMI_var_create new arguments: { '-' . '*' . name }).
frame thread id ~= currentThreadId ifTrue:[
debugger send: (GDBMI_thread_select new arguments:currentThreadId).
debugger send: (GDBMI_stack_select_frame new arguments:currentFrameId).
] ifFalse:[
frame level ~= currentFrameId ifTrue:[
debugger send: (GDBMI_stack_select_frame new arguments:currentFrameId).
].
].
varobj := result value.
].
^ varobj value
"Created: / 27-02-2015 / 17:18:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 24-05-2017 / 15:14:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GDBVariable methodsFor:'initialization'!
setFrame: aGDBFrame
self assert: frame isNil.
self assert: (debugger isNil or:[ debugger == aGDBFrame debugger ]).
frame := aGDBFrame.
self debugger: frame debugger.
"Created: / 27-02-2015 / 17:08:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GDBVariable methodsFor:'printing & storing'!
printOn:aStream
"append a printed representation if the receiver to the argument, aStream"
super printOn:aStream.
aStream nextPutAll:'('.
name printOn: aStream.
aStream nextPutAll:')'.
"Modified: / 27-02-2015 / 15:18:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GDBVariable class methodsFor:'documentation'!
version_HG
^ '$Changeset: <not expanded> $'
! !