76 |
76 |
77 !GDBVariable methodsFor:'accessing-private'! |
77 !GDBVariable methodsFor:'accessing-private'! |
78 |
78 |
79 varobj |
79 varobj |
80 varobj isNil ifTrue:[ |
80 varobj isNil ifTrue:[ |
81 | result currentThreadId currentFrameId | |
81 varobj := debugger evaluate: name in: frame. |
82 |
|
83 result := debugger send: (GDBMI_thread_list_ids new). |
|
84 currentThreadId := result propertyAt: 'current-thread-id'. |
|
85 result := debugger send: (GDBMI_stack_info_frame new). |
|
86 currentFrameId := (result propertyAt: 'frame') level. |
|
87 |
|
88 frame thread id ~= currentThreadId ifTrue:[ |
|
89 debugger send: (GDBMI_thread_select new arguments:(Array with:frame thread id)). |
|
90 debugger send: (GDBMI_stack_select_frame new arguments:(Array with:frame level)). |
|
91 ] ifFalse:[ |
|
92 frame level ~= currentFrameId ifTrue:[ |
|
93 debugger send: (GDBMI_stack_select_frame new arguments:(Array with:frame level)). |
|
94 ]. |
|
95 ]. |
|
96 |
|
97 result := debugger send: (GDBMI_var_create new arguments: (Array with: '-' with: '*' with: name)). |
|
98 |
|
99 frame thread id ~= currentThreadId ifTrue:[ |
|
100 debugger send: (GDBMI_thread_select new arguments: (Array with: currentThreadId)). |
|
101 debugger send: (GDBMI_stack_select_frame new arguments:(Array with: currentFrameId)). |
|
102 ] ifFalse:[ |
|
103 frame level ~= currentFrameId ifTrue:[ |
|
104 debugger send: (GDBMI_stack_select_frame new arguments:(Array with: currentFrameId)). |
|
105 ]. |
|
106 ]. |
|
107 |
|
108 varobj := result value. |
|
109 varobj |
|
110 setDebugger: debugger; |
|
111 setExpression: name; |
|
112 setFrame: frame. |
|
113 varobj registerForFinalization. |
|
114 ]. |
82 ]. |
115 ^ varobj |
83 ^ varobj |
116 |
84 |
117 "Created: / 27-02-2015 / 17:18:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
85 "Created: / 27-02-2015 / 17:18:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
118 "Modified: / 15-01-2018 / 23:10:31 / jv" |
86 "Modified: / 15-01-2018 / 23:10:31 / jv" |
119 "Modified: / 15-02-2018 / 09:30:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
87 "Modified: / 13-02-2018 / 22:23:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
120 ! ! |
88 ! ! |
121 |
89 |
122 !GDBVariable methodsFor:'initialization'! |
90 !GDBVariable methodsFor:'initialization'! |
123 |
91 |
124 setFrame: aGDBFrame |
92 setFrame: aGDBFrame |