winIDEA SDK
|
This class provides debug session function.
#include <CSessionCtrl.h>
Inherits isys::CSessionBaseCtrl, and std::enable_shared_from_this< CSessionCtrl >.
Public Member Functions | |
void | begin_program () |
Begins new debug session, starts emulation (HAR) on all SoCs and programs them. More... | |
void | begin_reset () |
Begins new debug session, starts emulation (HAR) on all SoCs. More... | |
void | begin_attach () |
Begins new debug session, attaches to all SoCs configured to attach on begin. More... | |
void | begin_prepare () |
Begins session, does not attach to any SoC. More... | |
void | end () |
Ends debug session (detaches from all SoCs). More... | |
SPSessionStatus | get_status () |
Returns session state. More... | |
SPSessionTopology | get_topology () |
Returns session topology - attached SoCs and processes. More... | |
std::vector< SPSessionTopology_CoreBinding > | get_core_SMP_bindings (uint32_t dwSoCIndex=0) const |
returns a union of SMPs and non-SMP bound cores binding for a non-SMP core will use the name of the core and only reference its core index | |
SPConnectionMgr | instance_attach (const std::string &strName) |
Returns a connection manager for the specified instance, possibly launching a new winIDEA instance. More... | |
SPConnectionMgr | instance_attach (uint32_t dwCoreIndex) |
Returns a connection manager for the specified instance, possibly launching a new winIDEA instance. More... | |
bool | instance_is_attached (uint32_t dwCoreIndex) const |
Returns true if the winIDEA instance controlling dwCoreIndex is attached. More... | |
std::string | process_attach () |
Attaches to the specified process. More... | |
void | process_focus (const std::string &strProcessURL) |
Focuses the specified process. More... | |
SPProcessCtrl | get_process (const std::string &strProcessURL) |
Returns CProcessCtrl for the specified process. More... | |
SPSoCCtrl | get_SoC (const std::string &strSoC) |
Returns CSoCCtrl for the specified SoC. More... | |
SPTerminalCtrl | get_terminal (std::string strConfiguration="") |
Returns CTerminalCtrl for the specified terminal configuration. More... | |
void isys::CSessionCtrl::begin_attach | ( | ) |
Begins new debug session, attaches to all SoCs configured to attach on begin.
In other words, connects to an already running target.
TException | if session initialization fails. |
Python example: test_get_process.py
cmgr = ic.ConnectionMgr() cmgr.connect() sess_ctrl = ic.CSessionCtrl(cmgr) sess_ctrl.begin_attach() sess_ctrl.get_status().SoCs()[0].status_string()
'ATTACHED'
void isys::CSessionCtrl::begin_prepare | ( | ) |
Begins session, does not attach to any SoC.
In other words, init Blue Box and debug session, but stop just before accessing the target.
TException | if session initialization fails. |
Python example: test_begin_prepare.py
cmgr = ic.ConnectionMgr() cmgr.connect() sess_ctrl = ic.CSessionCtrl(cmgr) sess_ctrl.begin_prepare() sess_ctrl.get_status().SoCs()[0].status_string()
'DETACHED'
void isys::CSessionCtrl::begin_program | ( | ) |
Begins new debug session, starts emulation (HAR) on all SoCs and programs them.
In other words, downloads code to target and stops on reset vector.
TException | if session initialization fails. |
Python example: test_begin_program.py
cmgr = ic.ConnectionMgr() cmgr.connect() sess_ctrl = ic.CSessionCtrl(cmgr) sess_ctrl.begin_program() sess_ctrl.get_status().SoCs()[0].status_string()
'ATTACHED'
void isys::CSessionCtrl::begin_reset | ( | ) |
Begins new debug session, starts emulation (HAR) on all SoCs.
In other words, resets target and stops on reset vector. No programming is done.
TException | if session initialization fails. |
Python example: test_soc_ctrl_attach.py
cmgr = ic.ConnectionMgr() cmgr.connect() sess_ctrl = ic.CSessionCtrl(cmgr) sess_ctrl.begin_reset() sess_ctrl.get_status().SoCs()[0].status_string()
'ATTACHED'
void isys::CSessionCtrl::end | ( | ) |
Ends debug session (detaches from all SoCs).
Python example: test_begin_prepare.py
cmgr = ic.ConnectionMgr() cmgr.connect() sess_ctrl = ic.CSessionCtrl(cmgr) sess_ctrl.begin_prepare() sess_strl.end() len(sess_ctrl.get_status().SoCs())
0
SPProcessCtrl isys::CSessionCtrl::get_process | ( | const std::string & | strProcessURL | ) |
Returns CProcessCtrl for the specified process.
strProcessURL | URL of the process to return |
TException | if operation fails. |
Python example: test_get_process.py
cmgr = ic.ConnectionMgr() cmgr.connect() sess_ctrl = ic.CSessionCtrl(cmgr) sess_ctrl.begin_attach() sess_ctrl.get_topology().processes()[0].URL()
'App/CORE0'
type(sess_ctrl.get_process('App/CORE0'))
<class 'isystem.connect.CProcessCtrl'>
SPSoCCtrl isys::CSessionCtrl::get_SoC | ( | const std::string & | strSoC | ) |
Returns CSoCCtrl for the specified SoC.
The session must be active (started with one of begin_ calls).
strSoC | name (as configured in winIDEA) of the SoC to return. IF a single SoC is used, this string may be empty |
TException | if operation fails. |
Python example: test_get_soc.py
conn_mgr = ic.ConnectionMgr() conn_mgr.connect() sess_ctrl = ic.CSessionCtrl(conn_mgr) sess_ctrl.begin_attach() soc_ctrl = sess_ctrl.get_SoC('') type(soc_ctrl)
<class 'isystem.connect.CSoCCtrl'>
SPSessionStatus isys::CSessionCtrl::get_status | ( | ) |
Returns session state.
TException | if status cannot be obtained. |
cmgr = ic.ConnectionMgr() cmgr.connect() sess_ctrl = ic.CSessionCtrl(cmgr) sess_ctrl.begin_prepare() sess_ctrl.get_status().SoCs()[0].status_string()
'DETACHED'
SPTerminalCtrl isys::CSessionCtrl::get_terminal | ( | std::string | strConfiguration = "" | ) |
Returns CTerminalCtrl for the specified terminal configuration.
strConfiguration | name of terminal configuration, empty string uses the first/default |
TException | if operation fails. |
Python example: test_get_terminal.py
conn_mgr = ic.ConnectionMgr() conn_mgr.connect() sess_ctrl = ic.CSessionCtrl(conn_mgr) sess_ctrl.begin_attach() terminal_ctrl = sess_ctrl.get_terminal('') type(terminal_ctrl)
<class 'isystem.connect.CTerminalCtrl'>
SPSessionTopology isys::CSessionCtrl::get_topology | ( | ) |
Returns session topology - attached SoCs and processes.
TException | if topology cannot be obtained. |
Python example: test_get_topology.py
cmgr = ic.ConnectionMgr() cmgr.connect() sess_ctrl = ic.CSessionCtrl(cmgr) sess_ctrl.begin_prepare() sess_ctrl.get_topology().SoCs()[0].name()
'MCU'
sess_ctrl.get_topology().SoCs()[0].device()
'STM32F412xG'
sess_ctrl.get_topology().SoCs()[0].cores()[0].name()
'CORE0'
SPConnectionMgr isys::CSessionCtrl::instance_attach | ( | const std::string & | strName | ) |
Returns a connection manager for the specified instance, possibly launching a new winIDEA instance.
strName | name of the instance - as given in SPSessionTopology_CoreBinding |
TException | if invalid instance |
cmgr = ic.ConnectionMgr() cmgr.connect() sess_ctrl = ic.CSessionCtrl(cmgr) sess_ctrl.begin_prepare() sess_ctrl.get_topology().SoCs()[0].cores()[0].name()
'CORE0'
cmgr1 = ses_ctrl.instance_attach('CORE0') cmgr1.isAttached()
True
SPConnectionMgr isys::CSessionCtrl::instance_attach | ( | uint32_t | dwCoreIndex | ) |
Returns a connection manager for the specified instance, possibly launching a new winIDEA instance.
dwCoreIndex | the core index |
TException | if invalid instance |
cmgr = ic.ConnectionMgr() cmgr.connect() sess_ctrl = ic.CSessionCtrl(cmgr) sess_ctrl.begin_prepare() cmgr1 = ses_ctrl.instance_attach(0) cmgr1.isAttached()
True
bool isys::CSessionCtrl::instance_is_attached | ( | uint32_t | dwCoreIndex | ) | const |
Returns true if the winIDEA instance controlling dwCoreIndex is attached.
dwCoreIndex | the core index |
cmgr = ic.ConnectionMgr() cmgr.connect() sess_ctrl = ic.CSessionCtrl(cmgr) sess_ctrl.begin_prepare()
std::string isys::CSessionCtrl::process_attach | ( | ) |
Attaches to the specified process.
Loads its symbol files, creates working image
TException | if operation fails. |
Python example: test_process_attach.py
void isys::CSessionCtrl::process_focus | ( | const std::string & | strProcessURL | ) |
Focuses the specified process.
strProcessURL | URL of the process to focus |
TException | if operation fails. |
Python example: test_process_focus.py
cmgr = ic.ConnectionMgr() cmgr.connect() sess_ctrl = ic.CSessionCtrl(cmgr) sess_ctrl.begin_attach() sess_ctrl.get_topology().processes()[0].URL()
'App/CORE0'
sess_ctrl.process_focus('App/CORE0')