"target variable" at main not printing all the global variables if we have print ant global variable before starting execution. Instead it show only variables that we printed before starting execution.
It wont work on three scenarios.
case 1:
(lldb) print my_global_char ==> global variable
(char) $0 = 'X'
(lldb) b main
(lldb) r
(lldb) target variable
Global variables for **
(char) my_global_char = 'X' ==> not showing other global variables
(lldb)
case 2:
(lldb) target variable -r my_global_ch* ==> global variable
(char) $0 = 'X'
(lldb) b main
(lldb) r
(lldb) target variable
Global variables for **
(char) my_global_char = 'X' ==> not showing other global variables
(lldb)
case 3:
(lldb) target variable my_global_char ==> global variable
(char) $0 = 'X'
(lldb) b main
(lldb) r
(lldb) target variable
Global variables for **
(char) my_global_char = 'X' ==> not showing other global variables
(lldb)
For all other scopes we parse all the variables before we look for the required variable, so it would be updated in m_varibles.
For global scope, we look for required variable and only that updated m_variables which taken back for "target variable"