@@ -44,6 +44,28 @@ export class ArduinoVariableHandler {
44
44
return variables ;
45
45
}
46
46
47
+ /** TODO */
48
+ async getStaticVariables ( frameHandle : number ) : Promise < DebugProtocol . Variable [ ] > {
49
+ throw new Error ( 'Static variables are not supported yet.' ) ;
50
+ const frame = this . frameHandles . get ( frameHandle ) ;
51
+ const result = await this . gdb . sendStackInfoFrame ( this . gdb , frame . threadId , frame . frameId ) ;
52
+ const file = path . normalize ( result . frame . file || '' ) ;
53
+ const symbolInfo : any [ ] = [ ] // this.symbolTable.getStaticVariables(file);
54
+ const variables : DebugProtocol . Variable [ ] = [ ] ;
55
+
56
+ // Fetch stack depth to obtain frameId/threadId/depth tuple
57
+ const stackDepth = await mi . sendStackInfoDepth ( this . gdb , { maxDepth : 100 } ) ;
58
+ const depth = parseInt ( stackDepth . depth , 10 ) ;
59
+
60
+ for ( const symbol of symbolInfo ) {
61
+ const name = `${ file } _static_var_${ symbol . name } ` ;
62
+ const variable = await this . getVariables ( frame , name , symbol . name , depth ) ;
63
+ variables . push ( variable ) ;
64
+ }
65
+
66
+ return variables ;
67
+ }
68
+
47
69
private async getVariables ( frame : FrameReference , name : string , expression : string , depth : number ) : Promise < DebugProtocol . Variable > {
48
70
let global = this . varMgr . getVar ( frame . frameId , frame . threadId , depth , name ) ;
49
71
@@ -79,28 +101,6 @@ export class ArduinoVariableHandler {
79
101
} ;
80
102
}
81
103
82
- /** TODO */
83
- async getStaticVariables ( frameHandle : number ) : Promise < DebugProtocol . Variable [ ] > {
84
- throw new Error ( 'Static variables are not supported yet.' ) ;
85
- const frame = this . frameHandles . get ( frameHandle ) ;
86
- const result = await this . gdb . sendStackInfoFrame ( this . gdb , frame . threadId , frame . frameId ) ;
87
- const file = path . normalize ( result . frame . file || '' ) ;
88
- const symbolInfo : any [ ] = [ ] // this.symbolTable.getStaticVariables(file);
89
- const variables : DebugProtocol . Variable [ ] = [ ] ;
90
-
91
- // Fetch stack depth to obtain frameId/threadId/depth tuple
92
- const stackDepth = await mi . sendStackInfoDepth ( this . gdb , { maxDepth : 100 } ) ;
93
- const depth = parseInt ( stackDepth . depth , 10 ) ;
94
-
95
- for ( const symbol of symbolInfo ) {
96
- const name = `${ file } _static_var_${ symbol . name } ` ;
97
- const variable = await this . getVariables ( frame , name , symbol . name , depth ) ;
98
- variables . push ( variable ) ;
99
- }
100
-
101
- return variables ;
102
- }
103
-
104
104
async handlePinStatusRequest ( ) : Promise < DebugProtocol . Variable [ ] > {
105
105
const variables : DebugProtocol . Variable [ ] = [ ] ;
106
106
variables . push ( {
0 commit comments